{"id":2341,"date":"2011-07-25T11:42:37","date_gmt":"2011-07-25T11:42:37","guid":{"rendered":"http:\/\/wiki.freeiz.com\/?p=2341"},"modified":"2016-08-09T12:08:27","modified_gmt":"2016-08-09T12:08:27","slug":"cisco-policy-based-routing-pbr-route-map-co","status":"publish","type":"post","link":"https:\/\/wiki-see.info\/wp\/2011\/07\/25\/cisco-policy-based-routing-pbr-route-map-co\/","title":{"rendered":"CISCO Policy based Routing (PBR) : route-map &#038; co."},"content":{"rendered":"<p><span style=\"color: #000000;\">Route-map can be used in a lot of application, in most of them, the aim is enabling the network engineer<br \/>\nto override\u00a0the route table and influence which way traffic flows.<\/span><\/p>\n<p><span style=\"color: #000000;\">Below you will find a configuration sample of Policy Based Routing (PBR) we use to route different<br \/>\nsubnet through\u00a0different equipments.<\/span><\/p>\n<p><span style=\"color: #000000;\">!<\/span><\/p>\n<p><a href=\"http:\/\/www.wikisee.info\/wp-content\/uploads\/2011\/07\/Dessin192111.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2343\" title=\"Dessin19\" src=\"http:\/\/wiki.freeiz.com\/wp-content\/uploads\/2011\/07\/Dessin191-300x139.jpg\" alt=\"\" width=\"300\" height=\"139\" \/><\/a><\/p>\n<p><span style=\"color: #000000;\"><span style=\"color: #000080;\"> <\/span><\/span><\/p>\n<p><span style=\"color: #000000;\">!<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><br \/>\n<span style=\"color: #000000;\"> !<\/span><\/p>\n<p><span style=\"color: #000080;\">We\u2019ll route<\/span> :<\/p>\n<p>&#8211;\t<span style=\"color: #800000;\">Packets from 10.20.10.0\/24 (vlan 10) to 172.20.10.0\/24 thru Link 2<\/span><br \/>\n&#8211;\t<span style=\"color: #800000;\">Packets from 10.20.20.0\/24 (vlan 20) to 172.20.10.0\/24 thru Link 1<br \/>\n<\/span><span style=\"color: #800000;\"><span style=\"color: #000000;\">&#8211;<\/span> Other Packets thru gateway 10.20.5.254 on Gigabit Ethernet interface 3\/48<\/span><\/p>\n<p><span style=\"color: #000080;\">Policy based routing<\/span> <span style=\"color: #000000;\">in Cisco Routers can be performed by using \u201c<\/span><span style=\"color: #000080;\">route-map<\/span><span style=\"color: #000000;\">\u201d and then applying as a<br \/>\npolicy to\u00a0the interface of the IP Packets.<\/span><\/p>\n<p><span style=\"color: #000000;\">The route-map has a list of \u201c<span style=\"color: #800000;\">match<\/span>\u201d and \u201c<span style=\"color: #800000;\">set<\/span>\u201d commands where match defines the criteria under which the<br \/>\npolicy routing is performed (<span style=\"color: #000080;\">standard <\/span>or <span style=\"color: #000080;\">Extended ACL<\/span>) and set defines the actions to perform when match<br \/>\ncriteris met (i.e.,<span style=\"color: #000080;\"> set next hop<\/span>)<\/span>.<\/p>\n<p><span style=\"color: #000000;\">I change the routing to a particular network only from a particular subnet which is defined<br \/>\nin a<span style=\"color: #000080;\"> standard ACL<\/span>.\u00a0This ACL is then matched in a route-map and applied as an IP policy for<br \/>\nrouting change for the change in\u00a0routing behaviour.<\/span><\/p>\n<p><strong> <\/strong><strong><span style=\"color: #800000;\">First Step create ACLs <span style=\"color: #000000;\">:<\/span><\/span><\/strong><\/p>\n<div>\n<div>\n<pre><span style=\"color: #000000;\">BraveHeart-R-C#conf t\nEnter configuration commands, one per line.  End with CNTL\/Z.\nBraveHeart-R-C(config)# access-list 100 permit ip 10.20.10.0 0.255.255.255 172.20.10.0 0.255.255.255\nBraveHeart-R-C(config)# access-list 101 permit ip 10.20.20.0 0.255.255.255 172.20.10.0 0.255.255.255\nBraveHeart-R-C(config)# access-list 102 permit ip 10.20.10.0 0.255.255.255 any\nBraveHeart-R-C(config)# access-list 102 permit ip 10.20.20.0 0.255.255.255 any<\/span><\/pre>\n<\/div>\n<\/div>\n<p><span style=\"color: #000000;\">The access list <span style=\"color: #800000;\">id<\/span> doesn\u2019t matter for the matching order<\/span>.<\/p>\n<p><strong><span style=\"color: #800000;\">Second Step create route-map<\/span> :<br \/>\n<\/strong><br \/>\n<span style=\"color: #000000;\">We will create a route map named <\/span><span style=\"color: #000080;\">Global-route map<\/span>.<br \/>\n<span style=\"color: #000000;\">The matching order is the <span style=\"color: #800000;\">id<\/span> number of the route map <span style=\"color: #800000;\">9<\/span>-&gt;<span style=\"color: #800000;\">10<\/span>-&gt;<span style=\"color: #800000;\">11<\/span><\/span><\/p>\n<div>\n<div>\n<pre><span style=\"color: #000000;\">BraveHeart-R-C#conf t\nEnter configuration commands, one per line.  End with CNTL\/Z.\nBraveHeart-R-C(config)# <span style=\"color: #800000;\">route-map Sample-routemap permit 9<\/span>\nBraveHeart-R-C(config-route-map)# match ip address 101\nBraveHeart-R-C(config-route-map)# <span style=\"color: #000080;\">set ip next-hop 10.20.6.1<\/span><\/span><\/pre>\n<\/div>\n<\/div>\n<div>\n<div>\n<pre><span style=\"color: #000000;\">BraveHeart-R-C(config)# <span style=\"color: #800000;\">route-map Sample-routemap permit 10<\/span>\nBraveHeart-R-C(config-route-map)#  match ip address 100\nBraveHeart-R-C(config-route-map)#  <span style=\"color: #000080;\">set ip next-hop 10.20.7.1<\/span><\/span><\/pre>\n<\/div>\n<\/div>\n<div>\n<div>\n<pre><span style=\"color: #000000;\">BraveHeart-R-C(config)# <span style=\"color: #800000;\">route-map Sample-routemap permit 11<\/span>\nBraveHeart-R-C(config-route-map)#  match ip address 102\nBraveHeart-R-C(config-route-map)# <span style=\"color: #000080;\">set default interface GigabitEthernet 3\/48<\/span><\/span><\/pre>\n<\/div>\n<\/div>\n<p><span style=\"color: #000000;\">That creates a route-map called \u201c<span style=\"color: #800000;\">Sample-routemap<\/span>\u201d and matches the ACLs <span style=\"color: #000080;\">100,101,102<\/span> where the<br \/>\nsource network\u00a0for which the route-map should be actioned.<\/span><\/p>\n<p><strong><span style=\"color: #800000;\">Apply Policy Route-map to interface<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">This route-map is now applied to the interface vlan<span style=\"color: #800000;\"> 10<\/span> and <span style=\"color: #800000;\">20<\/span>.<\/span><\/p>\n<div>\n<div>\n<pre><span style=\"color: #000000;\">BraveHeart-R-C#conf t\nEnter configuration commands, one per line.  End with CNTL\/Z.\nBraveHeart-R-C(config)#int vlan 10\nBraveHeart-R-C(config-if)# <span style=\"color: #800000;\">ip policy route-map Sample-routemap<\/span>\nBraveHeart-R-C(config-if)#exit\n!\nBraveHeart-R-C(config)#int vlan 20\nBraveHeart-R-C(config-if)# <span style=\"color: #800000;\">ip policy route-map Sample-routemap<\/span>\nBraveHeart-R-C(config-if)#end<\/span><\/pre>\n<\/div>\n<\/div>\n<p><span style=\"color: #000000;\">Now all rules configured should work (use traceroute to check the link you use<\/span> <img decoding=\"async\" src=\"http:\/\/blog.ronanfoucher.fr\/wp-includes\/images\/smilies\/icon_wink.gif\" alt=\";-)\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Route-map can be used in a lot of application, in most of them, the aim is enabling the network engineer to override\u00a0the route table and influence which way traffic flows. Below you will find a configuration sample of Policy Based Routing (PBR) we use to route different subnet through\u00a0different equipments. ! ! ! ! ! [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[607],"class_list":["post-2341","post","type-post","status-publish","format-standard","hentry","category-cisco-routers","tag-route-map"],"_links":{"self":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/2341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/comments?post=2341"}],"version-history":[{"count":1,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/2341\/revisions"}],"predecessor-version":[{"id":5065,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/2341\/revisions\/5065"}],"wp:attachment":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/media?parent=2341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/categories?post=2341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/tags?post=2341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}