实验要求
拓扑图
命令
R1
[r1]int LoopBack 0
[r1-LoopBack0]ip add 192.168.1.1 24
[r1]ip route-static 0.0.0.0 0 17.1.1.2
[r1]int Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 封装
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 中心开启伪广播
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry 10.1.1.2 27.1.1.2 register
[r1-Tunnel0/0/0]nhrp entry 10.1.1.3 37.1.1.2 register
[r1-Tunnel0/0/0]source 17.1.1.1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1]int tu 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast 将接口的网络类型更改为广播。
R7
[r7-LoopBack0]ip add 7.7.7.7 24
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip add 17.1.1.2 24
[r7-GigabitEthernet0/0/0]int g 0/0/1
[r7-GigabitEthernet0/0/1]ip add 27.1.1.1 24
[r7-GigabitEthernet0/0/1]int g 0/0/2
[r7-GigabitEthernet0/0/2]ip add 37.1.1.1 24
R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 27.1.1.2 24
[r2-GigabitEthernet0/0/0]int lo 0
[r2-LoopBack0]ip add 192.168.2.1 24
[r2]ip route-static 0.0.0.0 0 27.1.1.1
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 27.1.1.2
[r2-Tunnel0/0/0]nhrp entry multicast dynamic
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 17.1.1.1 register
[r2-Tunnel0/0/0]nhrp entry 10.1.1.3 37.1.1.2 register
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[r2-Tunnel0/0/0]ospf network-type broadcast 修改接口网络类型为广播
R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 37.1.1.2 24
[r3]int lo0
[r3-LoopBack0]ip add 192.168.3.1 24
[r3]ip route-static 0.0.0.0 0 37.1.1.1
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 37.1.1.2
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 17.1.1.1 register
[r3-Tunnel0/0/0]nhrp entry 10.1.1.2 27.1.1.2 register
[r3]int tu 0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast 修改接口网络类型为广播
[r3]ospf 1
[r3-ospf-1]default-route-advertise 重发布缺省
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r3-GigabitEthernet0/0/1]int g 0/0/0
[r3-GigabitEthernet0/0/0]nat outbound 2000
[r3-GigabitEthernet0/0/0]nat server protocol tcp global current-interface 23 inside 192.168.6.1 23 实现telnet R3实际登陆R6
Warning:The port 23 is well-known port. If you continue it may cause function failure.
Are you sure to continue?[Y/N]:y
R4
[r4]int lo0
[r4-LoopBack0]ip add 192.168.4.1 24
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.0.5 30
[r4]ospf
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.1]network 192.168.4.1 0.0.0.0
R5
[r5]int lo 0
[r5-LoopBack0]ip add 192.168.5.1 24
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.0.6 30
[r5-GigabitEthernet0/0/1]ip add 192.168.0.9 30
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 1
[r5-ospf-1-area-0.0.0.1]network 192.168.0.6 0.0.0.0
[r5-ospf-1-area-0.0.0.1]network 192.168.5.1 0.0.0.0
[r5-ospf-1-area-0.0.0.2]net 192.168.0.9 0.0.0.0
[r5]ospf 1
[r5-ospf-1]ar 2
[r5-ospf-1-area-0.0.0.2]undo network 192.168.0.9 0.0.0.0
[r5]ospf 2
[r5-ospf-2]area 2
[r5-ospf-2-area-0.0.0.2]network 192.168.0.9 0.0.0.0
[r5-ospf-1]import-route ospf 2 引入ospf进程2
[r5-ospf-2]import-route ospf 1 引入ospf进程1
[r5-ospf-2]default-route-advertise 重发布缺省
R6
[r6]int lo 0
[r6-LoopBack0]ip add 192.168.6.1 24
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 192.168.0.10 30
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1-area-0.0.0.2]network 192.168.0.0 0.0.255.255
[r6]aaa
[r6-aaa]local-user wangdaye privilege level 15 password cipher a123456
[r6-aaa]local-user wangdaye service-type telnet
[r6]user-interface vty 0 4
[r6-ui-vty0-4]authentication-mode aaa