{"id":10,"date":"2013-06-24T21:35:33","date_gmt":"2013-06-24T20:35:33","guid":{"rendered":"http:\/\/www.segfault.be\/?p=10"},"modified":"2013-06-24T21:35:33","modified_gmt":"2013-06-24T20:35:33","slug":"policy-based-routing-on-cisco-catalyst-3560-series","status":"publish","type":"post","link":"https:\/\/www.segfault.be\/?p=10","title":{"rendered":"Policy-based routing on Cisco Catalyst 3560 Series"},"content":{"rendered":"<p>Hi,<\/p>\n<p>Small howto for people who are interested in making policy-based routing feature on Catalyst 3560.<br \/>\nFor example you need to use 2 different default routes for various VLANs.<br \/>\nImagine you receive a default route via a dynamic routing protocol (BGP, OSPF, \u2026).<br \/>\nYou need for VLAN ID 10 to take another default route for a specific reason.<br \/>\nYou create another default route via a static like this:<\/p>\n<p><code>ip route 0.0.0.0 0.0.0.0 outside_iface next_hop_ip 254<\/code><\/p>\n<p>With that, this second default route will never be used because the first has a better metric.<br \/>\n=&gt; the need to use PBR\u00a0<img alt=\";-)\" src=\"http:\/\/10.1.3.10\/wordpress\/wp-includes\/images\/smilies\/icon_wink.gif\" \/><\/p>\n<p>First, you need to activate this feature by changing a setting in the global configuration:<\/p>\n<p><code>sdm prefer routing<\/code><\/p>\n<p>This command allows to use the PBR feature on a Cisco Catalyst 3560 series which is by default not available.<br \/>\nYou have 4 modes:<\/p>\n<ul>\n<li>routing<\/li>\n<li>default<\/li>\n<li>vlans<\/li>\n<li>access<\/li>\n<\/ul>\n<p>You can find more information about that via this\u00a0<a href=\"http:\/\/www.cisco.com\/en\/US\/docs\/switches\/lan\/catalyst3560\/software\/release\/12.2_25_see\/configuration\/guide\/swsdm.html\">URL<\/a><\/p>\n<p>So \u2026 now you can start to configure PBR:<\/p>\n<p>&#8211; Define an ACL to match which traffic will be affected by PBR:<\/p>\n<p><code>access-list 2 permit 10.1.3.0 0.0.0.255<\/code><\/p>\n<p>&#8211; Define a route-map to define a condition for this traffic, for example to specify another next-hop:<\/p>\n<p><code>route-map PBR_VL10 permit 10<br \/>\nmatch ip address 2<br \/>\nset ip next-hop x.x.x.x ### where x.x.x.x corresponding to the IP next-hop for the second default route<br \/>\n<\/code><\/p>\n<p>&#8211; Apply PBR to the VLAN interface:<\/p>\n<p><code>interface vlan 10<br \/>\nip policy route-map PBR_VL10<br \/>\n<\/code><\/p>\n<p>That\u2019s all\u00a0<img alt=\";-)\" src=\"http:\/\/10.1.3.10\/wordpress\/wp-includes\/images\/smilies\/icon_wink.gif\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, Small howto for people who are interested in making policy-based routing feature on Catalyst 3560. For example you need to use 2 different default routes for various VLANs. Imagine you receive a default route via a dynamic routing protocol (BGP, OSPF, \u2026). You need for VLAN ID 10 to take another default route for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/posts\/10"}],"collection":[{"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.segfault.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10"}],"version-history":[{"count":2,"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":14,"href":"https:\/\/www.segfault.be\/index.php?rest_route=\/wp\/v2\/posts\/10\/revisions\/14"}],"wp:attachment":[{"href":"https:\/\/www.segfault.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.segfault.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.segfault.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}