Where to change eth0 IP address permantly?

Place to discuss Fedora and/or Red Hat
Post Reply
ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Where to change eth0 IP address permantly?

Post by ZiaTioN » Mon Feb 02, 2004 2:45 pm

I know I can do:
ifconfig eth0 <1.2.3.4> netmask <255.255.255.0>
But this is only permanent. I need to know where to change this setting for good.

Edit: Never mind I found the eth0 config file (ifcfg-eth0) in the /etc/sysconfig/network-scripts/ directory and changed it there.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Feb 02, 2004 4:50 pm

You can do it there or the GUI will also modify that file. I don't use the GUI but if you wanted to check it out it's on the menu. There are only a few files associated with the network configuration. The ifcfg-<iface> files in /etc/sysconfig/network-scripts as you already found, the /etc/sysconfig/network file which is where you define the system name and the default gateway, /etc/hosts of course, and there are some others that you probably will never use (I have) like /etc/sysconfig/network-scripts/route-<iface> which is where you can define routes for specific interfaces.

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Mon Feb 02, 2004 5:04 pm

Cool I did not know it was accessible in so many places. I am actually having an issue now with the dns servers assignment. I have always ran my Linux boxes via a dhcp server so I have never had to worry about this due to the fact that the dhcp will assign accordingly.

This box however has a static address and of course I cannot get outside my LAN to the net because I have no name server associated with it. Where would I set this up to use my dns server for resolution with a static address?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Mon Feb 02, 2004 5:12 pm

Your DNS client configuration file is /etc/resolv.conf (same in all *NIX OSs). It might look like this:

Code: Select all

search yourdomain.com
nameserver 192.168.0.1
nameserver 10.10.0.1

ZiaTioN
administrator
administrator
Posts: 460
Joined: Tue Apr 08, 2003 3:28 pm
Contact:

Post by ZiaTioN » Mon Feb 02, 2004 5:21 pm

Yeah thanks again man. I actually found that out on your site while I was looking around. The link was http://voidmain.kicks-ass.net/redhat/re ... c_dns.html which from reading I decided I needed to take a look at my resolv.conf file and see what it had in it.

Post Reply