一、 配置链路聚合,配置成trunk,将接口加入聚合链路加快两个交换机传输速度
1) 链路聚合配置trunk
[SW1]interface Eth-Trunk 1
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan all
[SW2]interface Eth-Trunk 1
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan all
2) 配置链路聚合
[SW1]interface Eth-Trunk 1
[SW1]interface Ethernet 0/0/3
[SW1-Ethernet0/0/3]eth-trunk 1
[SW1]interface Ethernet0/0/4
[SW1-Ethernet0/0/4]eth-trunk 1
[SW2]interface Eth-Trunk 1
[SW2]interface Ethernet 0/0/3
[SW2-Ethernet0/0/3]eth-trunk 1
[SW2]interface Ethernet 0/0/4
[SW2-Ethernet0/0/4]eth-trunk 1
二、 交换机添加vlan,配置trunk承载vlan,配置接入链路,将接口加入vlan
1) 创建多个vlan,查看创建的vlan
[SW1]vlan batch 10 20
[SW2]vlan batch 10 20
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
3) 配置接入链路,把接口加入vlan,查看加入的vlan
[SW1]interface Ethernet 0/0/1
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]port default vlan 10
[SW1]interface Ethernet 0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
[SW2]interface Ethernet0/0/1
[SW2-Ethernet0/0/1]port link-type access
[SW2-Ethernet0/0/1]port default vlan 10
[SW2]interface Ethernet 0/0/2
[SW2-Ethernet0/0/2]port link-type access
[SW2-Ethernet0/0/2]port default vlan 20
4) 查看加入的vlan
三、 配置单臂路由
1) 配置单臂路由,和pc1、pc2、pc3、pc4IP地址
[R1]interface GigabitEthernet 0/0/0.10
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.10]ip address 192.168.10.1 24
[R1]interface GigabitEthernet0/0/0.20
[R1-GigabitEthernet0/0/0.20]arp broadcast enabl
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 192.168.20.1 24
2) 配置pc机IP地址
3) 验证
四、 配置路由器IP地址
1) 配置IP地址
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.4.2 24
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.5.1 24
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 1.1.1.1 32
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2]ip address 192.168.5.2 24
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.6.1 24
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 2.2.2.2 32
[R3]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.6.2 24
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 3.3.3.3 32
[R3]interface LoopBack 2
[R3-LoopBack2]ip address 192.168.7.1 24
[R4]interface GigabitEthernet0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.3.2 24
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 192.168.2.2 24
[AR1]interface LoopBack 1
[AR1-LoopBack1]ip address 172.16.1.1 24
[AR1]interface LoopBack 2
[AR1-LoopBack2]ip address 172.16.2.1 24
[AR1]interface LoopBack 3
[AR1-LoopBack3]ip address 172.16.3.1 24
[AR1]interface LoopBack 4
[AR1-LoopBack4]ip address 172.16.4.1 24
[R5]interface GigabitEthernet0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.2.1 24
[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.2 24
五、 配置ospf和配置ospf重分发直连
1) 配置ospf
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 192.168.6.0 0.0.0.255
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 192.168.6.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]network 192.168.7.0 0.0.0.255
2) 在R1上重分发直连路由
[R1]ospf 1
[R1-ospf-1]import-route direct type 2
3) PC1验证
六、 配置rip和路由汇总,将rip发布到ospf中,将ospf发布到rip中,rip在重分发一条直连路由
1) 配置rip
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.4.0
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.3.0
[AR1]rip 1
[AR1-rip-1]version 2
[AR1-rip-1]network 192.168.3.0
[AR1-rip-1]network 172.16.0.0
2) 将rip发布到ospf中,将ospf发布到rip中
[R1]ospf 1
[R1-ospf-1]import-route rip cost 1
[R1]rip 1
[R1-rip-1]import-route ospf cost 1
3) 在R1,rip在重分发一条直连路由
[R1]rip 1
[R1-rip-1]import-route direct
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.0.0
七、 R5,AR1配置默认路由,在AR1上配置rip重分发缺省路由,在R1上配置ospf重分发缺省路由
1) 配置默认路由
[AR1]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/1 192.168.2.1
[R5]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/1 192.168.2.2
2) 在AR1上配置rip重分发缺省路由
[AR1]rip 1
[AR1-rip-1]default-route originate cost 3
3)在R1上配置ospf重分发缺省路由
[R1]ospf 1
[R1-ospf-1]default-route-advertise
八、 开启R3的远程功能,将AR1telnet映射到外网
1) 开启r3的远程功能
[R3]user-interface vty 0 4
[R3-ui-vty0-4]authentication-mode password
[R3-ui-vty0-4]set authentication password cipher pwd@123
[R3-ui-vty0-4]user privilege level 15
2)将ar1telnet映射到外网
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]nat server protocol tcp global 192.168.2.10 23 inside 192.168.7.1 23