①写路由器各个接口的ip地址
②向ISP写缺省
③打开Tunnel隧道
④写隧道ip地址
⑤写隧道协议为gre
⑥写source和destination
//配置过程中写入de然后按tab第一个弹出来的是description而不是destination,注意甄别
⑦向两边环回写静态,下一跳为Tunnel0/0/0
[r1]int l0
[r1-LoopBack0]ip add 192.168.1.1 24
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.0.12.1 24
[r1]ip route-static 0.0.0.0 0 10.0.12.2
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 20.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre
[r1-Tunnel0/0/0]source 10.0.12.1
[r1-Tunnel0/0/0]destination 10.0.23.3
[r1]ip route-static 192.168.2.0 24 Tunnel 0/0/0
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 10.0.12.2 24
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 10.0.23.2 24
[r3]int l0
[r3-LoopBack0]ip add 192.168.2.1 24
[r3-LoopBack0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 10.0.23.3 24
[r3]ip route-static 0.0.0.0 0 10.0.23.2
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 20.1.1.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre
[r3-Tunnel0/0/0]source 10.0.23.3
[r3-Tunnel0/0/0]destination 10.0.12.1
ip route-static 192.168.1.0 24 Tunnel 0/0/0
[r3]ping -a 192.168.2.1 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/34/50 ms
[r1]undo ip route-static 192.168.2.0 24 Tunnel 0/0/0
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
//注意:宣告的是环回口网段和tunnel网段
[r3]undo ip route-static 192.168.1.0 24 Tunnel 0/0/0
[r3]ospf 1
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 20.1.1.0 0.0.0.255
版权说明:如非注明,本站文章均为 扬州驻场服务-网络设备调试-监控维修-南京泽同信息科技有限公司 原创,转载请注明出处和附带本文链接。
请在这里放置你的在线分享代码