10-20-2023 09:13 AM
Hi all,
I have a default static route in my environment pointing to 10.21.2.1. However, I wish to enable specific traffic destined for the network 172.16.110.0/24 to be routed through another gateway, which is 10.22.0.1.
How can I accomplish this? If I simply create a static route for 172.16.110.0, the traffic continues to flow through 10.21.2.1.
Solved! Go to Solution.
10-20-2023 09:29 AM
Hello @vtrovao,
Policy-Based Routing (PBR) is another approach to direct specific traffic based on defined criteria, offering even more flexibility than static routing. If you want granular control over which traffic is sent through a different gateway, you can use PBR. Here's how you can configure PBR for your scenario:
Create an ACL that matches the specific traffic you want to route differently. In your case, this would be traffic destined for 172.16.110.0/24:
ip access-list extended ACL-PBR
permit ip any 172.16.110.0 0.0.0.255
Create a route map that references the ACL you just created and sets the next-hop IP address to your desired gateway:
route-map PBR-MAP permit 10
match ip address ACL-PBR
set ip next-hop 10.22.0.1
Apply the route map to the interface where the traffic will enter your network:
interface [your_interface]
ip policy route-map PBR-MAP
This configuration will ensure that traffic matching the ACL-PBR will be policy-routed through the next-hop IP address defined in the route map, which, in your case, is 10.22.0.1. All other traffic not matching the ACL will follow the normal routing table.
PBR allows you to have more flexibility in defining the criteria for forwarding specific traffic to a different gateway, making it a powerful tool for traffic management in your network. Just make sure to thoroughly test your PBR configuration to ensure it behaves as expected.
10-20-2023 09:21 AM
You can use PBR based on the configuration
what is the source IP address ?
take example if you have 192.168.1.0/24 network going to 172.16.110.0/24 ( you want to send to different gteway than default - in your case -10.22.0.1)
PBR example : (make sure check the device IOS guide syntax may change)
https://www.cisco.com/c/en/us/support/docs/ip/ip-routed-protocols/47121-pbr-cmds-ce.html
10-20-2023 09:29 AM
Hello @vtrovao,
Policy-Based Routing (PBR) is another approach to direct specific traffic based on defined criteria, offering even more flexibility than static routing. If you want granular control over which traffic is sent through a different gateway, you can use PBR. Here's how you can configure PBR for your scenario:
Create an ACL that matches the specific traffic you want to route differently. In your case, this would be traffic destined for 172.16.110.0/24:
ip access-list extended ACL-PBR
permit ip any 172.16.110.0 0.0.0.255
Create a route map that references the ACL you just created and sets the next-hop IP address to your desired gateway:
route-map PBR-MAP permit 10
match ip address ACL-PBR
set ip next-hop 10.22.0.1
Apply the route map to the interface where the traffic will enter your network:
interface [your_interface]
ip policy route-map PBR-MAP
This configuration will ensure that traffic matching the ACL-PBR will be policy-routed through the next-hop IP address defined in the route map, which, in your case, is 10.22.0.1. All other traffic not matching the ACL will follow the normal routing table.
PBR allows you to have more flexibility in defining the criteria for forwarding specific traffic to a different gateway, making it a powerful tool for traffic management in your network. Just make sure to thoroughly test your PBR configuration to ensure it behaves as expected.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide