[CentOS] Forgetting network settings

Les Mikesell lesmikesell at gmail.com
Mon Mar 29 13:04:46 UTC 2010

cahit Eyigünlü wrote:
> i am reaching the network with this :
> route add -net netmask dev eth0
> route add default gw 
> i have added eth0 
> address0=
> subnet0=
> the first command is ok but how could i set the second command to cent 
> os to do it automatically

If you create a file named /etc/sysconfig/network-scripts/route-eth0 you can put 
lines in it that will have 'ip route' added at the beginning and executed after 
the interface is up.  "ip route" takes some different arguments than the "route" 
command - see "man ip" for details.

   Les Mikesell
   lesmikesell at gmail.com

More information about the CentOS mailing list