R2配置
set ip next-hop verify-availabitity 让路由器搜索CDP邻居表来验证下一跳地址是否在列表中,如果不在,
则策略路由被拒绝,数据包将按常规被转发。
r2#show run
Building configuration...
Current configuration : 1594 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.3.1 255.255.255.0
ip policy route-map a
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 192.168.4.1 255.255.255.0
ip policy route-map a
duplex auto
speed auto
!
interface Serial3/0
ip address 192.168.7.1 255.255.255.0
serial restart-delay 0
!
interface Serial3/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/3
no ip address
shutdown
serial restart-delay 0
!
router eigrp 10
passive-interface FastEthernet1/0
passive-interface FastEthernet2/0
network 192.168.2.0
network 192.168.3.0
network 192.168.4.0
network 192.168.7.0
no auto-summary
!
ip http server
no ip http secure-server
!
ip forward-protocol nd
!
!
access-list 1 permit 192.168.4.0 0.0.0.255
!
route-map a permit 10
match ip address 1
set ip next-hop 192.168.7.1
set ip next-hop verify-availability
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
r1#show run
Building configuration...
Current configuration : 1409 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip policy route-map a
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.2.1 255.255.255.0
duplex auto
speed auto
!
interface Serial2/0
ip address 192.168.5.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router eigrp 10
passive-interface FastEthernet0/0
network 192.168.1.0
network 192.168.2.0
network 192.168.5.0
no auto-summary
!
ip http server
no ip http secure-server
!
ip forward-protocol nd
!
!
access-list 100 permit icmp 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255
access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255
!
route-map a permit 10
match ip address 100
set ip next-hop 192.168.5.2
set ip next-hop verify-availability
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end