cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
342
Views
0
Helpful
2
Replies

Create a static route

vtrovao
Level 1
Level 1

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.

vtrovao_0-1697818107106.png

vtrovao_1-1697818287958.png

 

 

1 Accepted Solution

Accepted Solutions

M02@rt37
VIP
VIP

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.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

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

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

M02@rt37
VIP
VIP

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.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
Review Cisco Networking for a $25 gift card