Linux ifconfig command ip address , subnet mask permanent

centosifconfiglinuxnetworking

I would like to change my ip address and subnet mask with the following command:
ifconfig eth1 192.168.1.2 netmask 255.255.255.0 up

and

route add default gw 192.168.1.1

when I reboot my linux it's gone. I would like to keep it permanent with this command.
is it possible?

Thanks

Best Answer

If you don't want the sys V way, you can add

/sbin/route add default gw 192.178.1.1

to /etc/rc.d/rc.local . Although, editing the initi scripts as qweet points out is better.