cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1210
Views
4
Helpful
4
Replies

Choice of multiple default gateway

Hi,

If I have two default route (D1 and D2) with two subnet connected (S1 and S2), is there a way to forward traffic through D1 or D2 with reference to the sender IP, that is network hosts belonging to S1 have default route D1 and hosts belonging to S2 have default route D2?.

Thank you.

Best regards.

Massimiliano.

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

Hi Massimiliano

You can use PBR (Policy Based Routing) to achieve this.

S1 = 192.168.5.0/24

S2 = 192.168.6.0/24

access-list 101 permit ip 192.168.5.0 0.0.0.255 any

access-list 102 permit ip 192.168.6.0 0.0.0.255 any

route-map DEFR permit 10

match ip address 101

set ip next-hop

route-map DEFR permit 20

match ip address 102

set ip next-hop

Then you apply the policy onto the relative interface ie.

int fa0/0

ip polict route-map DEFR

HTH

Jon

View solution in original post

4 Replies 4

Jon Marshall
Hall of Fame
Hall of Fame

Hi Massimiliano

You can use PBR (Policy Based Routing) to achieve this.

S1 = 192.168.5.0/24

S2 = 192.168.6.0/24

access-list 101 permit ip 192.168.5.0 0.0.0.255 any

access-list 102 permit ip 192.168.6.0 0.0.0.255 any

route-map DEFR permit 10

match ip address 101

set ip next-hop

route-map DEFR permit 20

match ip address 102

set ip next-hop

Then you apply the policy onto the relative interface ie.

int fa0/0

ip polict route-map DEFR

HTH

Jon

Hi Jon,

Thank you.

Can I use PBR on switches Layer 3 also?

Can I apply route map to interface VLAN?

Best regards.

Massimiliano.

Massimiliano

Yes you should be able to use PBR on most layer 3 switches. Note that you may need to adjust the SDM template (to use the routing template) on some of the switches to get support for PBR.

HTH

Rick

HTH

Rick

Hi,

Thank you Rick.

Best regards.

Massimiliano.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco