![图片[1]-第15章 GRE隧道-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片19-7.png)
1.配置R1、R2、R3间OSPF路由
[R1]ospf 1
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
2.配置R1、R3Tunnel接口,建立GRE隧道
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]ip address 13.1.1.1 8
[R1-Tunnel0/0/1]source 12.1.1.1
[R1-Tunnel0/0/1]destination 23.1.1.3
[R3]interface Tunnel 0/0/1
[R3-Tunnel0/0/1]tunnel-protocol gre
[R3-Tunnel0/0/1]ip address 13.1.1.3 8
[R3-Tunnel0/0/1]source 23.1.1.3
[R3-Tunnel0/0/1]destination 12.1.1.1
[R1]ping -a 13.1.1.1 13.1.1.3
PING 13.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 13.1.1.3: bytes=56 Sequence=1 ttl=255 time=20 ms
[R3-Tunnel0/0/1]ping -a 13.1.1.3 13.1.1.1
PING 13.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 13.1.1.1: bytes=56 Sequence=1 ttl=255 time=40 ms
3.配置静态路由
[R1]ip route-static 192.168.2.0 255.255.255.0 13.1.1.3
[R3]ip route-static 192.168.1.0 255.255.255.0 13.1.1.1
4.PC连通性测试
PC1>ping 192.168.2.1
Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
From 192.168.2.1: bytes=32 seq=2 ttl=126 time=31 ms
PC2>ping 192.168.1.1
Ping 192.168.1.1: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: bytes=32 seq=1 ttl=126 time=31 ms
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容