大概的设定如下:
interface FastEthernet0/0.26
description connected to PE
encapsulation dot1Q 26
ip address 10.13.6.2 255.255.255.252
interface FastEthernet0/0.61
description connected to LAN
encapsulation dot1Q 61
ip address 10.13.60.1 255.255.255.224
ip policy route-map IPVPN
interface FastEthernet0/0.567
description connected to e-VLAN OSPF area 0
encapsulation dot1Q 567
ip address 10.13.3.132 255.255.255.192
router ospf 1
router-id 10.13.60.1
log-adjacency-changes
network 10.13.3.128 0.0.0.63 area 0
network 10.13.60.0 0.0.0.31 area 0
#-------------------------------------------------------
ip sla 100
icmp-echo 10.13.7.2
timeout 1000
frequency 10
ip sla schedule 100 life forever start-time now
track 100 rtr 100 reachability
access-list 111 permit ip 10.13.60.0 0.0.0.31 any
route-map IPVPN permit 10
match ip address 111
set ip next-hop verify-availability 10.13.6.1 10 track 100
#-------------------------------------------------------
#-------------------------------------------------------
这下面的本不用写,不过现有的设定把remote site 连接PE的link,在OSPF中有宣告,
所以在OSPF的路由表里有路由条目。考虑到下面不设的话,icmp-echo会从OSPF的路由表中选路。不能真正反映出IP-VPN的路径可达。
ip local policy route-map REMOTESITE
access-list 100 permit ip any host 10.13.7.2
route-map REMOTESITE permit 10
match ip address 100
set ip next-hop 10.13.6.1
#-------------------------------------------------------