Configuring IP to network card
I am trying to assign a static IP address to a network card using the following command:
ifconfig eth0 10.4.12.21 After the command it works fine untill the system is rebooted and then I neet to issue the command again. How do you make the IP address stick? |
Most distros should have scripts configured to bring up network interfaces on start up.
|
Which distribution are you using ?
If your distro. has the sysconfig directory, you can edit the /etc/sysconfig/network/ifcfg-eth0 file. On RedHat / Mandrake, it would look like this: Code:
DEVICE=eth0 Code:
BOOTPROTO='static' |
I am running RedHat 7.3. I found the ifcfg-eth0 in the /etc/sysconfig/network-scripts/ directory. This is what is in it:
DEVICE='eth1' ONBOOT='no' BOOTPROTO='none' TYPE='Ethernet' USERCTR='no' NETWORK=10.4.0.0 BROADCAST=10.4.0.255 Should I change the NETWORK and BROADCAST lines and nothing else? |
All times are GMT -5. The time now is 07:50 AM. |