LSW2:
#
vlan batch 10 20
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
LSW3:
#
vlan batch 10 20
#
acl number 3000 //PC3不能访问web服务器
rule 5 deny ip source 192.168.10.0 0.0.0.255 destination 192.168.20.105 0
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
traffic-filter inbound acl 3000 //ACL应用到接口上
#
interface Ethernet0/0/2
port link-type access
port default vlan 20
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
LSW1:
#
vlan batch 10 20 30
#
dhcp enable //开启DHCP功能
#
ip pool vlan10 //配置地址池
gateway-list 192.168.10.254
network 192.168.10.0 mask 255.255.255.0
#
ip pool vlan20 //配置地址池
gateway-list 192.168.20.254
network 192.168.20.0 mask 255.255.255.0
#
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
dhcp select global
#
interface Vlanif20
ip address 192.168.20.254 255.255.255.0
dhcp select global
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
##
interface Eth-Trunk1 //端口聚合
Trunkport GigabitEthernet 0/0/1 to 0/0/2
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
##
rip 1
version 2
network 192.168.10.0
network 192.168.20.0
network 192.168.30.0
#
AR1:
#
interface Eth-Trunk1 //端口聚合
undo portswitch //将聚合组二层端口关闭才能给聚合组配置IP地址
Trunkport GigabitEthernet 0/0/1 to 0/0/2 //将端口1和2 添加为聚合组的成员
ip address 192.168.30.254 255.255.255.0
#
interface GigabitEthernet0/0/0
ip address 10.0.10.1 255.255.255.0
#
rip 1
version 2
network 192.168.30.0
network 10.0.0.0
AR2:
#
interface GigabitEthernet0/0/0
ip address 10.0.10.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 200.0.10.254 255.255.255.0
#
rip 1
version 2
network 10.0.0.0
network 200.0.10.0
#