Permanent IP address
Hi,
We have a Linux 5.4 version running on HP DL380. I assigned the IP address to the eth0 interface using the menu Settings --> Networks --> interface. Then I rebooted the machine and used "ifconfig -a" to check the IP, but it didn't show any IP assigned to eth0. Then I manually added the IP to eth0 as follows: ifconfig eth0 10.125.9.161 netmask 255.255.255.248 route add default gw 10.125.9.166 ifconfig -a showed the IP address assigned. However on reboot, it didn't show any IP to eth0. To permanently assign the IP address, do I have to define it in some configuration file? |
Yes you do. Use the system-config-network tool or directly edit /etc/sysconfig/network-scripts/ifcfg-eth0
|
do check *onboot* should be *yes* in configuration file.
|
Quote:
Also, the OP asked how to assign a static address, not how to make sure the interface is active on boot. acid_kewpie posted the correct solution, which is to use the system configuration tool, or edit the file. In the file, the OP needs to set the IPADDR and NETMASK parameters, along these lines: Code:
STARTMODE='onboot' |
Personally I've never seen a "STARTMODE" parameter. No sign of it in the init scripts of ifup scripts on centos 5.5
|
Quote:
|
TB0ne, I have just followed the line give below.
Quote:
|
Quote:
You SHOULD go through the system-network configuration tool, and make sure you set a static address, and that everything is set correctly. If not, edit /etc/sysconfig/network-scripts/ifcfg-eth0 as you were told above, and put the values in as shown. The line you quoted is a command that sets is temporarily...both myself and acid_kewpie gave you the answer, neither of which involve running ifconfig. Follow the instructions given. |
All times are GMT -5. The time now is 01:11 AM. |