2 gateways on debian or ubuntu

Discussion in 'Installation/Configuration' started by syadnom, Jul 28, 2009.

  1. syadnom

    syadnom New Member

    I am trying to get my ubuntu box to have 2 gateways and respond via the appropriate gateway when a request comes in.

    here is my network map

    DSL=71.x.x.10 gw 71.x.x.1
    LAN eth0 =
    LAN eth0.1=
    the 10Mb connection does NAT to get email traffic to eth0.1

    DSL(gw1)<-->eth1(email server)eth0<-->LAN
    10Mb(gw2)<-->eth0.1(email server)

    The problem is that the default gw is out eth1 to the DSL. I cant just switch the gw as it will just reverse the direction of the issue.

    Can someone help me change my routes so that anything coming in to eth0.1 uses gw2 as its route and anything coming in eth1 uses gw1 as its route?

    Once this is done I can switch my default route to gw2 but I still need traffic coming in on eth1 to route out gw1.

    Thanks for any help in advance. I have seen the multiple gateway info here: http://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html but dont know how to implement that.

Share This Page