LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   define tow gateway in linux (http://www.linuxquestions.org/questions/linux-networking-3/define-tow-gateway-in-linux-744460/)

e_sagheb 08-02-2009 01:41 AM

define tow gateway in linux
 
hi, I have a server with 192.1.9.10 ip address and I want to define two gateways with ip: 192.1.9.4 and 192.1.9.254 on it but I dont know how I can do it.I dont have professianal information in linux.
thanks for your help

jschiwal 08-02-2009 07:57 AM

Your network device configuration tool probably has a gateway entry field.

You can manually add a route using the "route" or the "ip" command.
For example, if the router at 192.1.9.4 is for the 10.0.0.0/8 network, and the router at 192.1.9.254 is the default gateway, you could use:

route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.1.9.4 dev eth0
route add default gw 192.1.9.254 dev eth0

Also look at the man page for the "routes" configuration file. You can enter routes there.
Indicating which distribution you are using might be helpful.


All times are GMT -5. The time now is 03:19 PM.