Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Two default gateways on one NIC?

Options
  • 18-01-2008 2:02pm
    #1
    Registered Users Posts: 23,212 ✭✭✭✭


    As per the title.

    Firstly, I am a DBA, so I am not as well up on the whole networking things as you guys. :)

    A brief overview of what I have and what I am trying to achieve: an externally available web application, configured with a firewall and associated DMZ.

    The network card on the Database server has a default gateway set to a port on the firewall and it all works fine. The DB application needs to send e-mails, so it needs to connect to our internal network, so it needs a different default gateway. So, to send e-mails, we have to manually reset the default gateway each time, a bit of a pain.

    I tried setting two default gateways, but it doesn't work (the application breaks externally, which suggests it can get in to the DB, but can't get back out, due to the default gateway being changed).

    So what I have is:

    DB Server <----> External (via DMZ/firewall etc)

    When I change default gateway, I get:

    INTERNAL network <----> DB Server

    Basically, what I a looking for is something like this:
    INTERNAL network <----> DB Server <----> External network

    I know I can do this with two network cards, but can I do it with one network card?


Comments

  • Registered Users Posts: 319 ✭✭java


    Hi Tom

    You can just add a persistant route to point to the mailserver so you don't have to change the default route all the time. A google will show you the syntax for either unix or windows routing.

    Hope that helps.


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    That looks the job, but I am getting an error, which I don't quite understand (it's Windows server 2003, btw).

    So the current config is:
    <IP Address>
    <Netmask : 255.255.255.0>
    <Gateway address: X.X.X.5>

    I am entering the following:

    route add -p <mail sever IP> netmask 255.255.255.0 <X.X.X.1>

    Notice the gateway is different - is that a problem? It's the one we change manually to get to the mail server.

    I've just realised that the mailserver is actually out on the interweb, it's not on the local network - is that a problem?

    The error I am getting is : The route addition failed: The specified mask parameter is invalid.
    (Destination & Mask) != Destination.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,840 Mod ✭✭✭✭Capt'n Midnight


    Windows can't handle multiple gateways.

    to link to mail server

    route add -p <mail sever IP> netmask 255.255.255.255 <X.X.X.1>

    the 255.255.255.0 mask means a subnet, you would have to change the last number of the mail server to a 0, it would also connect to other pc's in that submet


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Lovely stuff, Captain, that worked a treat.

    Thanks. :D


Advertisement