LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-16-2005, 10:39 PM   #1
pruhnke
LQ Newbie
 
Registered: Aug 2005
Distribution: RH9, FC4
Posts: 13

Rep: Reputation: 0
Static IP keeps changing


Ok, so yesterday I was lazy when setting up atest box, I used the GUI in Red Hat 9 (Gnome) to staticly set my IP, I powered it down and brought it home. (did it at work to get paid for my own personal project)

Anyway, I set it wrong for my home network but forgot to change it. So I brought it home, tried to get back into X, I don't think my monitor likes the resolution or refresh so no video. Fine, didn't need it anyway...

Went in the command line, vi'd /etc/sysconfig/network-scripts/ifcfg-eth0...

[root@RH9-FS /]# cat /etc/sys*/net*/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.230
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

That is what I wanted... ifup and ifdown.... Same IP as before.

Checked /etc/rc.local... nothing...

rebooted, came back up with the IP I set in x....

So anyone else have an idea where I can look?
 
Old 10-16-2005, 11:27 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Have a look at /etc/hosts to make sure the other IP isn't recorded there for your hosts' name.

Also verify you have disabled dhclient (or dhcpcd) from running as DHCP would of course overwrite your static IP.
 
Old 10-16-2005, 11:57 PM   #3
pruhnke
LQ Newbie
 
Registered: Aug 2005
Distribution: RH9, FC4
Posts: 13

Original Poster
Rep: Reputation: 0
Ok, so I found it... Not really sure how this was done....

In /etc/sysconfig/network-scripts/ there is what was either a real file or a hard link to /etc/sysconfig/networking/devices/ifcfg-eth0.

So when I vi'd the orginal file, for some reason the network script did not look here, although I can't see that in the network script in /etc/init.d, but I am not a scripter by any means, too new.

Anyway I deleted my vi'd file, vi'd the file under /etc/sysconfig/networking/devices and created a symbolic link to that file in /etc/sysconfig/network-scripts/, which is like the loopback interface.


Code:
[root@RH9-FS network-scripts]# ls -lt ifcfg*
lrwxrwxrwx    1 root     root           32 Oct 16 23:21 ifcfg-eth0 -> ../networking/devices/ifcfg-eth0
lrwxrwxrwx    1 root     root           22 Oct 15 09:50 ifcfg-lo -> ../networking/ifcfg-lo

[root@RH9-FS network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.230
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
See what you get when you trust the GUI...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCPD with static IP is changing itself gunterjl Linux - Networking 1 03-16-2005 01:58 AM
changing from dynamic to static ip sterrenkijker Debian 4 05-24-2004 05:11 PM
Changing from DHCP to static jbrashear Debian 2 02-18-2004 07:14 AM
Changing from static IP to DHCP in Slackware vipermuffin Linux - Networking 2 02-03-2004 02:03 AM
Changing from static IP to dynamic one cijunet Linux - Networking 1 04-10-2003 11:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration