实验要求:全网互通(pc间互通)
1、二层交换机之间做lacp链路聚合
2、R1到R4有一条链路做浮动路由
(1)R1配置
interface GigabitEthernet0/0/0
ip address 192.168.80.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 12.0.0.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 13.0.0.1 255.255.255.0
#
interface NULL0
#
ip route-static 192.168.10.0 255.255.255.0 192.168.80.254
ip route-static 192.168.20.0 255.255.255.0 192.168.80.254
ip route-static 192.168.30.0 255.255.255.0 192.168.80.254
ip route-static 192.168.40.0 255.255.255.0 192.168.80.254
ip route-static 192.168.50.0 255.255.255.0 192.168.80.254
ip route-static 192.168.60.0 255.255.255.0 192.168.80.254
ip route-static 192.168.70.0 255.255.255.0 12.0.0.2
ip route-static 192.168.70.0 255.255.255.0 13.0.0.2 preference 70
#
(2)R2配置(配置路由时,vlan10到vlan60可以看成在一个网段中)
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 24.0.0.1 255.255.255.0
#
interface NULL0
#
ip route-static 192.168.0.0 255.255.0.0 12.0.0.1
ip route-static 192.168.70.0 255.255.255.0 24.0.0.2
#
(3)R3配置(配置路由时,vlan10到vlan60可以看成在一个网段中)
#
interface GigabitEthernet0/0/0
ip address 13.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 34.0.0.1 255.255.255.0
#
interface NULL0
#
ip route-static 192.168.0.0 255.255.0.0 13.0.0.1
ip route-static 192.168.70.0 255.255.255.0 34.0.0.2
#
(4)R4配置(路由器R4处于网络末梢,可配置默认路由,但是由于有两个直连路由器,配置浮动路由)
interface GigabitEthernet0/0/0
ip address 24.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 34.0.0.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.70.254 255.255.255.0
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 24.0.0.1
ip route-static 0.0.0.0 0.0.0.0 34.0.0.1 preference 70
#
(5)SW1配置(可以看成网络末梢,出网都会经过R1,配置一条默认路由)
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
ip address 192.168.30.254 255.255.255.0
#
interface Vlanif40
ip address 192.168.40.254 255.255.255.0
#
interface Vlanif50
ip address 192.168.50.254 255.255.255.0
#
interface Vlanif60
ip address 192.168.60.254 255.255.255.0
#
interface Vlanif80
ip address 192.168.80.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 80
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.80.1
#
#
(6)SW2配置
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
#
interface Ethernet0/0/4
eth-trunk 1
#
interface Ethernet0/0/5
eth-trunk 1
#
interface Ethernet0/0/6
eth-trunk 1
#
(7)SW3配置
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type access
port default vlan 30
#
interface Ethernet0/0/3
port link-type access
port default vlan 40
#
interface Ethernet0/0/4
eth-trunk 1
#
interface Ethernet0/0/5
eth-trunk 1
#
interface Ethernet0/0/6
eth-trunk 1
#
interface Ethernet0/0/7
eth-trunk 2
#
interface Ethernet0/0/8
eth-trunk 2
#
interface Ethernet0/0/9
eth-trunk 2
#
(8)SW4配置
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Eth-Trunk2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
mode lacp-static
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/2
port link-type access
port default vlan 50
#
interface Ethernet0/0/3
port link-type access
port default vlan 60
#
interface Ethernet0/0/4
eth-trunk 2
#
interface Ethernet0/0/5
eth-trunk 2
#
interface Ethernet0/0/6
eth-trunk 2
(9)检验
①PC1 ping PC7
②PC2 ping PC7
③PC3 ping PC7
④PC4 ping PC7
⑤PC5 ping PC7
⑥PC6 ping PC7