Archive for the ‘IOS Routing commands’ Category
Here is a quick example on how to perform some basic policy based routing.
Policy based routing means you want to route packets in different ways following your criteria’s.
For instance I want all packet for which IP route belongs to 192.168.10.0 /24 being routed through 10.1.1.1
Here I define my criteria:
access-list 101 permit ip 192.168.10.0 0.0.0.255 any
Define the route-map:
route-map my-map permit 10
match ip address 101
set ip next-hop 10.1.1.1
Now I have to bind the route-map on the interface where the interesting packets will be seen by the router:
interface FastEthernet0/0
ip address 2.2.2.2 255.255.255.0
ip policy route-map my-map
duplex auto
speed auto
Sometimes you need to filter based on the subnet mask length. With regular ACL you can only match the IP portion of routing updates (at my known).
Using prefix-list command allow you match the mask length, have a look on the below example :
#ip prefix-list LIST1 seq 10 permit 10.20.0.0/16 le 32
this will match only 10.20.0.0/16 to 10.20.0.0/32
You can use your prefixe-list with route-map :
#route-map TOTO permit 20
#match ip address prefix-list LIST1