Choice of multiple default gateway

Answered Question
Mar 21st, 2008

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.

I have this problem too.
0 votes
Correct Answer by Jon Marshall about 8 years 10 months ago

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

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
Correct Answer
Jon Marshall Fri, 03/21/2008 - 02:21

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

massimiliano.se... Fri, 03/21/2008 - 03:18

Hi Jon,

Thank you.

Can I use PBR on switches Layer 3 also?

Can I apply route map to interface VLAN?

Best regards.

Massimiliano.

Richard Burts Fri, 03/21/2008 - 03:54

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

Actions

This Discussion