要求:
1,PC1,PC2,PC3互通
2,配置ACL限制PC2不能访问PC3
1,首先规划好IP,配置如上图
SW2配置
#
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
#
interface Vlanif20
ip address 20.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk pvid vlan 20//修改PVID为20(不修改ping不通路由器!!!)
port trunk allow-pass vlan 10 20
#
ip route-static 30.1.1.0 255.255.255.0 20.1.1.2
AR1配置
#
interface GigabitEthernet0/0/0
ip address 20.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 30.1.1.1 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 20.1.1.1
验证:
2,配置ACL限制访问流量
AR1配置
#
acl number 2000//建立ACL2000
rul 5 deny source 10.1.1.3 0.0.0.0//规则5拒绝源IP10.1.1.3
rule 10 permit//规则10允许所有
#
interface GigabitEthernet0/0/0
traffic-filter inbound acl 2000//接口下入方向调用ACL2000
配置完成
验证:PC1可以ping通30.1.1.2,PC2无法ping通30.1.1.2
========================================
作者:暖巷寻故人