Choice of multiple default gateway

Answered Question
Mar 21st, 2008
User Badges:
  • Silver, 250 points or more

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.


Correct Answer by Jon Marshall about 9 years 2 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
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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
User Badges:
  • Silver, 250 points or more

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
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

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