2015年2月5日 星期四



Policy base route

BorderRouter>
BorderRouter>en
BorderRouter#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
BorderRouter(config)#access-list 101 permit tcp any any eq www
BorderRouter(config)#route-map pbr permit 10
BorderRouter(config-route-map)#match ip address 101
BorderRouter(config-route-map)#set ip next-hop 10.1.101.1
BorderRouter(config-route-map)#exit
BorderRouter(config)#route-map pbr permit 20
BorderRouter(config-route-map)#exit
BorderRouter(config)#int fa0/0
BorderRouter(config-if)#ip policy route-map pbr
BorderRouter(config-if)#exit
BorderRouter(config)#exit
BorderRouter#
BorderRouter#


R4 send www traffic and other traffic
====================================
R4#telnet 1.1.1.1
Trying 1.1.1.1 ...
% Destination unreachable; gateway or host down

R4#telnet 1.1.1.1 www
Trying 1.1.1.1, 80 ...
% Connection timed out; remote host not responding
R4#
====================================
BorderRouter#show route-map
route-map pbr, permit, sequence 10
  Match clauses:
    ip address (access-lists): 101
  Set clauses:
    ip next-hop 10.1.101.1
  Policy routing matches: 4 packets, 240 bytes

route-map pbr, permit, sequence 20
  Match clauses:
  Set clauses:
  Policy routing matches: 1 packets, 60 bytes
BorderRouter#
====================================


complete configuration
====================================
R1#sh run
!
interface FastEthernet0/0
 ip address 192.168.73.254 255.255.255.0
 ip policy route-map pbr
!
interface FastEthernet0/1
 ip address 10.1.102.2 255.255.255.0
!
interface Serial1/0
 ip address 10.1.101.2 255.255.255.0
!
access-list 101 permit tcp any any eq www
!
route-map pbr permit 10
 match ip address 101
 set ip next-hop 10.1.101.1
!
route-map pbr permit 20
!
R1# 
====================================
R2#sh run
!
hostname R2
!
interface Serial1/0
 ip address 10.1.101.1 255.255.255.0
 no fair-queue
!
R2#         
====================================
R3#sh run
!
hostname R3
!
interface FastEthernet0/1
 ip address 10.1.102.1 255.255.255.0
 duplex auto
 speed auto
!
R3#
====================================
R4#sh run
!
hostname R4
!
interface FastEthernet0/0
 ip address 192.168.73.4 255.255.255.0
 duplex auto
 speed auto
!
ip route 0.0.0.0 0.0.0.0 192.168.73.254
!
R4# 
====================================

沒有留言:

張貼留言