配置如下:
R1:
[r1]int loo0
[r1-LoopBack0]ip add 192.168.1.1 24
[r1-LoopBack0]int loo1
[r1-LoopBack1]ip add 10.1.1.1 24
[r1-LoopBack1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[r1]bgp 1
[r1-bgp]router-id 1.1.1.1
[r1-bgp]peer 12.1.1.2 as-number 2
[r1-bgp]network 10.1.1.0 24
[r1]int tu0/0/0
[r1-Tunnel0/0/0]ip add 10.1.3.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre
[r1-Tunnel0/0/0]source 10.1.1.1
[r1-Tunnel0/0/0]destination 10.1.2.1
[r1]ip route-static 192.168.2.0 24 tu0/0/0
[r1]ping -a 192.168.1.1 192.168.2.1
PING 192.168.2.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=255 time=60 ms
Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=255 time=40 ms
R2:
[r2]int loo0
[r2-LoopBack0]ip add 172.16.2.1 24
[r2-LoopBack0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2