LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unable to save gateway address (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-save-gateway-address-4175484640/)

amartlk 11-14-2013 10:21 PM

unable to save gateway address
 
Hi
i have 2 network card in server having centos 5.3 naming etho and eth1 eth1 is connected to isp connection , i assign static ip to eth0 which is connected to my local lan , i want to change the default gateway of etho to another ip of lan , i fired command
route add default gw eth0 172.x.x.x . when i fired command route -n it is showing me the default gateway which i addded but after some time i.e few second this default gateway is vanished it is not shown by route -n command i.e it is not shown means it save for ome time then it get vanishes

gknetw 11-15-2013 01:25 PM

Can you post your ifconfig route -n output before and after assigning default gateway ?

Madhu Desai 11-15-2013 01:47 PM

If you have two network cards, then

first, remove line GATEWAY=xxx.xxx.xxx.xxx in /etc/sysconfig/network file.

second, to whichever interface you want to set default gateway, add following lines in ifcfg-ethX file.

GATEWAY=xxx.xxx.xxx.xxx
DEFROUTE=yes

third, restart network service

you are done.

amartlk 11-15-2013 11:40 PM

Thanks

Done


All times are GMT -5. The time now is 03:11 AM.