Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux eth0 config

Status
Not open for further replies.

Rockman75

Technical User
Nov 2, 2002
17
0
0
US
Hi, im using RedHat 7.2 and am a linux starter.

Im configuring eth0 of NIC and assigned IP address via command prompt.
Then, ifconfig -a shows all interfaces are up and running and valid address are assinged.

However, everytime I shutdown or reboot the system, all ipaddress assigned to eth0 are erased and I need to re-do the same thing again. How do I keep the configuration? Is there save command or way to keep the setting all the time?

Someone let me know... Thank you
 
I'm running a debian-like installation, and perhaps the directories are located differently, so you have to modify it a bit:

I have a file /etc/init.d/if-up with the simple line
ifconfig eth0 192.168.0.3 up and a symbolic link to /etc/rc4.d/S40if-up (because runlevel 4 is multiuser + networking).

Perhaps I should have a file to stop networking - but I allways need networking, so why bothering?

seeking a job as java-programmer in Berlin:
 
Hi, Rockman75.

Redhat Linux stores network interface configuration information in files in /etc/sysconfig/network-scripts directory. For example ifcfg-eth0 - file for first ethernet interface.
For static IP the followin is needed:

DEVICE=eth0
IPADDR=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
BOOTPROTO=static
ONBOOT=yes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top