实验步骤
一、配置单臂路由
二、配置RIPv2,RIP路由汇总,开启身份验证
三、配置多区域OSPf,开启身份验证
四、配置路由重分发
五、将R6 的Telnet发布到外网,桥接远程访问
六、全网互通
实验过程
**一、给路由器配置IP地址
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/1]quit
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R1-GigabitEthernet0/0/0]quit
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.3.1 24
[R2-GigabitEthernet0/0/1]quit
[R2]int loo1
[R2-LoopBack1]ip address 172.16.1.1 24
[R2-LoopBack1]quit
[R2]int loo2
[R2-LoopBack2]ip address 172.16.2.1 24
[R2-LoopBack2]quit
[R2]int loo3
[R2-LoopBack3]ip address 172.16.3.1 24
[R2-LoopBack3]quit
[R2]int loo4
[R2-LoopBack4]ip address 172.16.4.1 24
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.2 24
[R3-GigabitEthernet0/0/0]quit
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R3-GigabitEthernet0/0/1]quit
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.2 24
[R4-GigabitEthernet0/0/1]quit
[R4]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.5.1 24
[R4-GigabitEthernet0/0/2]quit
[R4]int loo0
[R4-LoopBack0]ip address 1.1.1.1 32
[R4-LoopBack0]quit
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.5.2 24
[R5-GigabitEthernet0/0/0]quit
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.6.1 24
[R5-GigabitEthernet0/0/1]quit
[R5]int loo0
[R5-LoopBack0]ip address 2.2.2.2 32
[R5-LoopBack0]quit
[R6]int loo0
[R6-LoopBack0]ip address 3.3.3.3 32
[R6-LoopBack0]quit
[R6]int loo1
[R6-LoopBack1]ip address 192.168.7.1 24
[R6-LoopBack1]quit
二、交换机添加VLAN
[LSW1]vlan 10
[LSW1-vlan10]quit
[LSW1]vlan 20
[LSW1-vlan20]quit
[LSW2]vlan 10
[LSW2-vlan10]quit
[LSW2]vlan 20
[LSW2-vlan20]quit
三、创建聚合链路,将接口加入聚合链路加快传输速度,配置trunk,并设置承载所有VLAN
[LSW1]int Eth-Trunk 1
[LSW1-Eth-Trunk1]port link-type trunk
[LSW1-Eth-Trunk1]port trunk allow-pass vlan all
[LSW1]int e0/0/3
[LSW1-Ethernet0/0/3]eth-trunk 1
[LSW1-Ethernet0/0/3]quit
[LSW1]int e0/0/4
[LSW1-Ethernet0/0/4]eth-trunk 1
[LSW2]int th-Trunk 1
[LSW2-Eth-Trunk1]port ink-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan all
[LSW2]int 0/0/3
[LSW2-Ethernet0/0/3]eth-trunk 1
[LSW2-Ethernet0/0/3]quit
[LSW2]int e0/0/4
[LSW2-Ethernet0/0/4]eth-trunk 1
配置接入链路,将接口加入VLAN
[LSW1]int e0/0/1
[LSW1-Ethernet0/0/1]port link-type access
[LSW1-Ethernet0/0/1]port default vlan 10
[LSW1-Ethernet0/0/1]quit
[LSW1]int e0/0/2
[LSW1-Ethernet0/0/2]port link-type access
[LSW1-Ethernet0/0/2]port default vlan 20
[LSW1-Ethernet0/0/2]quit
[LSW2]int e0/0/1
[LSW2-Ethernet0/0/1]port link-type access
[LSW2-Ethernet0/0/1]port default vlan 10
[LSW2-Ethernet0/0/1]quit
[LSW2]int e0/0/2
[LSW2-Ethernet0/0/2]port link-type access
[LSW2-Ethernet0/0/2]port default vlan 20
[LSW2-Ethernet0/0/2]quit
交换机配置trunk,承载所有VLAN
[LSW1]int g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type trunk
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
四、配置单臂路由
[R4]int g0/0/0.10
[R4-GigabitEthernet0/0/0.10]ip address 192.168.10.254 24
[R4-GigabitEthernet0/0/0.10]dot1q termination vid 10
[R4-GigabitEthernet0/0/0.10]arp broadcast enable
[R4-GigabitEthernet0/0/0.10]int g0/0/0.20
[R4-GigabitEthernet0/0/0.20]ip address 192.168.20.254 24
[R4-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R4-GigabitEthernet0/0/0.20]arp broadcast enable
五、置RIPv2,RIP路由汇总,身份验证
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 172.16.0.0
[R2-rip-1]network 192.168.3.0
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-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.10.0
[R4-rip-1]network 192.168.20.0
RIP路由汇总
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]rip summary-address 172.16.0.0 255.255.0.0
身份验证
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]rip authentication-mode simple pwd@123
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]rip authentication-mode simple pwd@123
[R3-GigabitEthernet0/0/0]quit
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]rip authentication-mode simple pwd@123
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]rip authentication-mode simple pwd@123
六、配置OSPF多区域,身份验证
[R4]ospf router-id 1.1.1.1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R5]ospf router-id 2.2.2.2
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]network 192.168.6.0 0.0.0.255
[R6]ospf router-id 3.3.3.3
[R6-ospf-1]area 1
[R6-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R6-ospf-1-area-0.0.0.1]network 192.168.6.0 0.0.0.255
[R6-ospf-1-area-0.0.0.1]network 192.168.7.0 0.0.0.255
身份验证
[R4]ospf router-id 1.1.1.1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
[R5]ospf router-id 2.2.2.2
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
[R5-ospf-1]area 1
[R5-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
[R6]ospf router-id 3.3.3.3
[R6-ospf-1]area 1
[R6-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
七、R1、R2配置默认路由(缺省路由)
[R1]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/0 192.168.2.2
[R2]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/0 192.168.2.1
八、配置路由重分发
a) 将RIP重分发到OSPf中
[R4-ospf-1]rip 1
[R4-rip-1]import-route ospf
b) 将OSPF重分发到RIP中
[R4]ospf
[R4-ospf-1]import-route rip
c) 重分发默认路由
[R4]ospf
[R4-ospf-1]default-route-advertise
[R2]rip 1
[R2-rip-1]default-route originate
九、开启R6远程功能
[R6]user-interface vty 0 4
[R6-ui-vty0-4]authentication-mode password
[R6-ui-vty0-4]set authentication password simple pwd@123
[R6-ui-vty0-4]user privilege level 15
十、将R6Telnet映射到外网
[R2]int GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]nat server protocol tcp global 192.168.2.10 23 inside 192.168.7.1 23
十一、配置桥接