Click to See Complete Forum and Search --> : Quick question for changing ip address for eth1


mingshun
12-26-2002, 06:45 PM
I do know that ifconfig can change an ip address for an interface but til today, then I realise that I do not know how to make the ip address substain after rebooting or switching off of my computer. :p


i.e:
$ /sbin/ipconfig eth1 192.168.0.2/24

After rebooting, eth1 cannot remember that it is already assigned "192.168.0.2/24". Can any kind soul tell me how do I fix this besides using linuxconf or netconf?

Thanks

element-x
12-26-2002, 08:31 PM
I assume you're using a SyStemV based distribution, so here goes:

look in:

/etc/sysconfig/network-scripts

There should be a file called ifcfg-eth1, follow your already setup eth0, and assign it an ip address.

Just change
ONBOOT=no
to
ONBOOT=yes

This may not be 100% correct, but it'll point you in the right direction.

mingshun
12-27-2002, 06:35 PM
Originally posted by element-x
I assume you're using a SyStemV based distribution, so here goes:

look in:

/etc/sysconfig/network-scripts

There should be a file called ifcfg-eth1, follow your already setup eth0, and assign it an ip address.

Just change
ONBOOT=no
to
ONBOOT=yes

This may not be 100% correct, but it'll point you in the right direction.

Wow, this is something new to me. Thanks.
I got the problem fixed by appending this line to my /etc/rc.d/rc.local

/sbin/ifconfig eth1 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0

Forgot to mention my OS earlier. I'm running on RedHat 7.3