需求:总部与分支之间可以互访;分支之间不访问。
PE-1、PE-2之间访问通过GRE隧道;PE-1、PE-3之间访问通过GRE over GRE隧道(不仅在公网实现数据封装,在私网也实现数据封装),
即PE-1访问PE-3时,PE-1到PE-2之间的流量是双层GRE。
PE-1:
#
sysname PE-1
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface GigabitEthernet0/0
ip address 10.1.1.1 255.255.255.252
#
interface GigabitEthernet0/1
ip address 192.168.1.1 255.255.255.0
#
interface Tunnel0 mode gre
ip address 172.16.1.1 255.255.255.252
source 10.1.1.1
destination 10.1.1.2
#
interface Tunnel1 mode gre
ip address 172.17.1.1 255.255.255.252
source 1.1.1.1
destination 2.2.2.2
#
PE-2:
#
sysname PE-2
#
interface GigabitEthernet0/0
ip address 10.1.1.2 255.255.255.252
#
interface GigabitEthernet0/1
ip address 10.1.2.2 255.255.255.252
#
interface GigabitEthernet0/2
ip address 192.168.2.1 255.255.255.0
#
interface Tunnel0 mode gre
ip address 172.16.1.2 255.255.255.252
source 10.1.1.2
destination 10.1.1.1
#
ip route-static 1.1.1.1 32 Tunnel0
ip route-static 2.2.2.2 32 10.1.2.1
ip route-static 192.168.1.0 24 Tunnel0
#
PE-3:
#
version 7.1.064, Release 0821P11
#
sysname PE-3
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface GigabitEthernet0/0
ip address 10.1.2.1 255.255.255.252
#
interface GigabitEthernet0/1
ip address 192.168.3.1 255.255.255.0
#
interface Tunnel0 mode gre
ip address 172.17.1.2 255.255.255.252
source 2.2.2.2
destination 1.1.1.1
#
ip route-static 1.1.1.1 32 10.1.2.2
ip route-static 192.168.1.0 24 Tunnel0
#
测试:
<ZongBu>ping 192.168.3.2
Ping 192.168.3.2 (192.168.3.2): 56 data bytes, press CTRL+C to break
56 bytes from 192.168.3.2: icmp_seq=0 ttl=253 time=4.000 ms
56 bytes from 192.168.3.2: icmp_seq=1 ttl=253 time=2.000 ms
GRE Tunnel两端的源IP地址和目的IP地址要对应。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作