GRE通过公网传输RIP路由
学习目标
• 掌握GRE隧道封装的配置方法
• 掌握GRE隧道接口的配置方法
• 理解GRE Keepalive功能的实现原理
网络拓扑图
路由器的配置
路由器R1的配置:
sysname R1
interface GigabitEthernet0/0/0
ip address 200.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
ip address 10.0.1.2 255.255.255.0
interface Tunnel0/0/0
ip address 100.1.1.1 255.255.255.0
tunnel-protocol gre
source 200.1.1.1
destination 201.1.1.2
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 100.0.0.0 0.255.255.255
network 200.1.1.0 0.0.0.255
rip 1
version 2
network 10.0.0.0
network 100.0.0.0
ip route-static 0.0.0.0 0.0.0.0 Tunnel0/0/0
路由器R2的配置:
sysname R2
interface GigabitEthernet0/0/0
ip address 200.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1
ip address 201.1.1.1 255.255.255.0
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 200.1.1.0 0.0.0.255
network 201.1.1.0 0.0.0.255
sysname R3
interface GigabitEthernet0/0/0
ip address 201.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
ip address 10.0.2.1 255.255.255.0
interface Tunnel0/0/0
ip address 100.1.1.2 255.255.255.0
tunnel-protocol gre
source 201.1.1.2
destination 200.1.1.1
rip 1
version 2
network 10.0.0.0
network 100.0.0.0
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 100.0.0.0 0.255.255.255
network 201.1.1.0 0.0.0.255
ip route-static 0.0.0.0 0.0.0.0 Tunnel0/0/0
联通测试:
ping -a 1.1.1.1 2.2.2.2
dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.0.1.2 on GigabitEthernet0/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
2.2.2.2/32 10.0.1.2 3 0 RA 29
10.0.2.0/24 10.0.1.2 2 0 RA 29
100.1.1.0/24 10.0.1.2 1 0 RA 29
dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.0.1.1 on GigabitEthernet0/0/2
Destination/Mask Nexthop Cost Tag Flags Sec
1.1.1.1/32 10.0.1.1 1 0 RA 12
Peer 100.1.1.2 on Tunnel0/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
10.0.2.0/24 100.1.1.2 1 0 RA 10
2.2.2.2/32 100.1.1.2 2 0 RA 10
dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.0.2.1 on GigabitEthernet0/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
100.1.1.0/24 10.0.2.1 1 0 RA 2
1.1.1.1/32 10.0.2.1 3 0 RA 2
10.0.1.0/24 10.0.2.1 2 0 RA 2
[R3]dis rip 1 route
Route Flags : R - RIP
A - Aging, G - Garbage-collect
Peer 10.0.2.2 on GigabitEthernet0/0/2
Destination/Mask Nexthop Cost Tag Flags Sec
2.2.2.2/32 10.0.2.2 1 0 RA 9
Peer 100.1.1.1 on Tunnel0/0/0
Destination/Mask Nexthop Cost Tag Flags Sec
10.0.1.0/24 100.1.1.1 1 0 RA 2
1.1.1.1/32 100.1.1.1 2 0 RA 2
[R3]