组网大致如下:
SWA(1.1.1.1)----(1.1.1.2)SWB
SWA和SWB之间用vlan 1互联,SWA上loopback0:2.2.2.2模拟业务地址,SWB上loopback0:3.3.3.3模拟业务地址。SWB上的int vlan 1是加入了vpn实例的,现在2台设备之间跑ospf,SWB上的3.3.3.3网段SWA学习不到。
SWA大概配置如下:
#
interface Vlan-interface1
ip address 1.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.0
#
ospf 1
area 0.0.0.0
network 1.1.1.0 0.0.0.255
network 2.2.2.2 0.0.0.0
#
SWB上配置大概如下:
#
interface Vlan-interface1
ip binding vpn-instance 1
ip address 1.1.1.2 255.255.255.0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 1 vpn-instance 1
area 0.0.0.0
network 1.1.1.0 0.0.0.255
network 3.3.3.3 0.0.0.0
#
ospf邻居正常建立:
SWB侧:
[H3C]dis ospf peer
OSPF Process 1 with Router ID 1.1.1.2
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
1.1.1.1 1.1.1.1 1 32 Full/DR Vlan1
但SWA上学习不到对应的3.3.3.3网段:
[H3C]dis ip routing-table
Destinations : 20 Routes : 20
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.0/24 Direct 0 0 1.1.1.1 Vlan1
1.1.1.0/32 Direct 0 0 1.1.1.1 Vlan1
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.255/32 Direct 0 0 1.1.1.1 Vlan1
2.2.2.0/24 Direct 0 0 2.2.2.2 Loop2
2.2.2.0/32 Direct 0 0 2.2.2.2 Loop2
2.2.2.2/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.255/32 Direct 0 0 2.2.2.2 Loop2
4.4.4.0/24 Direct 0 0 4.4.4.1 Vlan2
4.4.4.0/32 Direct 0 0 4.4.4.1 Vlan2
4.4.4.1/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.255/32 Direct 0 0 4.4.4.1 Vlan2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
查看SWB的VPN路由表发现,没有3.3.3.3这个直连路由:
[H3C]dis ip routing-table vpn-instance 1
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.0/24 Direct 0 0 1.1.1.2 Vlan1
1.1.1.0/32 Direct 0 0 1.1.1.2 Vlan1
1.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.255/32 Direct 0 0 1.1.1.2 Vlan1
2.2.2.2/32 O_INTRA 10 1 1.1.1.1 Vlan1
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
查看SWB的全局路由表,是有3.3.3.3的直连路由的:
[H3C]dis ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.0/24 Direct 0 0 4.4.4.2 GE1/0/2
4.4.4.0/32 Direct 0 0 4.4.4.2 GE1/0/2
4.4.4.2/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.255/32 Direct 0 0 4.4.4.2 GE1/0/2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
因为配置的3.3.3.3是在全局下配置,未加VPN实例,所以需要把全局路由表引入VPN路由表,让VPN路由表里有3.3.3.3的直连路由
在SWB的VPN下:
ip vpn-instance 1
#
address-family ipv4
route-replicate from public protocol direct advertise
#
route-replicate命令用来将公网或其他VPN实例的路由信息引入到指定VPN实例中。
advertise:允许发布引入的路由。如果未指定本参数,则表示引入的路由不允许发布。
此时再查看SWB的VPN路由表:
[H3C]dis ip routing-table vpn-instance 1
Destinations : 18 Routes : 18
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.0/24 Direct 0 0 1.1.1.2 Vlan1
1.1.1.0/32 Direct 0 0 1.1.1.2 Vlan1
1.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.255/32 Direct 0 0 1.1.1.2 Vlan1
2.2.2.2/32 O_INTRA 10 1 1.1.1.1 Vlan1
3.3.3.3/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.0/24 Direct 0 0 4.4.4.2 GE1/0/2
4.4.4.0/32 Direct 0 0 4.4.4.2 GE1/0/2
4.4.4.2/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.255/32 Direct 0 0 4.4.4.2 GE1/0/2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
但是如果需要对端学习到的话,需在SWB的ospf里再引入直连:
#
ospf 1 vpn-instance 1
import-route direct
area 0.0.0.0
network 1.1.1.0 0.0.0.255
network 3.3.3.3 0.0.0.0
#
此时SWA上查看路由表,能正常学习:
[H3C]dis ip routing-table
Destinations : 22 Routes : 22
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.0/24 Direct 0 0 1.1.1.1 Vlan1
1.1.1.0/32 Direct 0 0 1.1.1.1 Vlan1
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.255/32 Direct 0 0 1.1.1.1 Vlan1
2.2.2.0/24 Direct 0 0 2.2.2.2 Loop2
2.2.2.0/32 Direct 0 0 2.2.2.2 Loop2
2.2.2.2/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.255/32 Direct 0 0 2.2.2.2 Loop2
3.3.3.3/32 O_ASE2 150 1 1.1.1.2 Vlan1
4.4.4.0/24 Direct 0 0 4.4.4.1 Vlan2
4.4.4.0/32 Direct 0 0 4.4.4.1 Vlan2
4.4.4.1/32 Direct 0 0 127.0.0.1 InLoop0
4.4.4.2/32 O_ASE2 150 1 1.1.1.2 Vlan1
4.4.4.255/32 Direct 0 0 4.4.4.1 Vlan2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作