Help - Search - Members - Calendar
Full Version: Assigning An Ip Address To Eth0
Linuxhelp > Support > Technical Support
zemecus
I'm setting up a small network using a few older machines that are running Mandrake 8.0. I configured each with their respective IP addresses to use in this network, but when I reboot or power off the machine, it loses any configuration that was done to eth0.

Any ideas or suggestions why this might be or what I could do to fix it?

Or is it just a case of old machines and there's nothing that can be done... dry.gif

Thanks!!
Joey
Check /etc/sysconfig/network-scripts/ifcfg-eth0

It should look something like this:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=10.1.1.255
IPADDR=10.1.1.1
NETMASK=255.255.255.0
NETWORK=10.1.1.0
ONBOOT=yes
hughesjr
Just to make this a more complete reference for future searches, I checked on different linux systems to see how to manually set IP addresses... here is the result {I assumed a manual IP of 192.168.0.2 on a class "C" (255.255.255.0) subnet}:
-------------------------------------------
Joey's posted solution works for RedHat (I checked 8 and 9), Mandrake (I checked 8.0,9.1,9.2) and SUSE (I checked 8.2 and 9.0). Adjusted for IP address of 192.168.0.2 it looks like this:

DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
-------------------------------------------
In slackware (i checked 9.0, 9.1), the file is /etc/rc.d/rc.inet1.conf (or rc.inet2.conf for a pcmcia network card). The info for a valid address looks like this:

# Config information for eth0:
IPADDR[0]="192.168.0.2"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
------------------------------------------
In gentoo (latest emerge sync 10/31/2003) the file is /etc/conf.d/net and a valid entry looks like this:

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
gateway="eth0/192.168.0.1"
-----------------------------------------
In debian (I checked latest SARGE and SID updated for 10/31/2003) the file is /etc/network/interfaces and a valid entry looks like this:

iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.