Policy Base Routing

要求:用主机上的IP地址192.168.1.1 ping R1上的1.1.1.1从R4上的192.168.34.4走,用主机上的IP地址192.168.1.2 ping R1上的1.1.1.1从R2上的192.168.23.2走。

Policy Base Routing_第1张图片
 
 
R1
en
conf t
hos r1
int e0/0
ip add 192.168.12.1 255.255.255.0
no shu
exi
int e0/1
ip add 192.168.14.1 255.255.255.0
no shu
exi
int lo 0
ip add 1.1.1.1 255.255.255.0
exi
router rip
ver 2
no au
net 1.1.1.0
net 192.168.12.0
net 192.168.14.0
exi
 
 
R2
en
conf t
hos r2
int e0/0
ip add 192.168.12.2 255.255.255.0
no shu
exi
int e0/1
ip add 192.168.23.2 255.255.255.0
no shu
exi
router rip
ver 2
no au
net 192.168.12.0
net 192.168.23.0
exi
 
 
 
R3
en
conf t
hos r3
int e0/1
ip add 192.168.23.3 255.255.255.0
no shu
exi
int e0/0
ip add 192.168.34.3 255.255.255.0
no shu
exi
int lo 0
ip add 3.3.3.3 255.255.255.0
exi
int e0/2
ip add 192.168.1.9 255.255.255.0
ip add 192.168.1.1 255.255.255.0 second
ip add 192.168.1.2 255.255.255.0 second
no shu
exi
router rip
ver 2
no au
net 192.168.23.0
net 192.168.34.0
net 3.3.3.0
net 192.168.1.0
exi
access-list 1 permit 192.168.1.1
access-list 2 permit 192.168.1.2
route-map netman permit 10
match ip address 1
set ip next-hop 192.168.34.4
exi
route-map netman permit 20
match ip address 2
set ip next-hop 192.168.23.2
exi
route-map netman permit 30
exi
int e0/2
ip policy route-map netman
exi
 
 
R4
en
conf t
hos r4
int e0/0
ip add 192.168.34.4 255.255.255.0
no shu
exi
int e0/1
ip add 192.168.14.4 255.255.255.0
no shu
exi
router rip
ver 2
no au
net 192.168.34.0
net 192.168.14.0
exi
 
 
 
实验结果:
 
 
当主机IP地址为192.168.1.1时:
        
 
 
当主机IP地址为192.168.1.2时:

 

你可能感兴趣的:(职场,休闲,PBR,基于策略路由)