I type the "neat" command (CentOS) A network configuration pop-up window is displayed. I double click on active eth1 And I change the Default gaeway address
Is there anyway to automate this?
You can use the two commands below
route del default # This removes the current default gateway
route add default gw "ipaddress" # This adds the new default gateway
This way you do not even have to restart the network.
the gateway is saved in the file /etc/sysconfig/network
. in the file you'll find an entry GATEWAY=a.b.c.d
. you could change this with:
sed -i -e 's/ol\.d\.i\.p/ne\.w\.i\.p/' /etc/sysconfig/network