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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find old IP on system 1

Status
Not open for further replies.

c567591

MIS
Aug 12, 2002
67
US
I am running RedHat v9
I setup a server to be a mail server and used an internal IP when I set it up in house.
I have since moved it to our hosted environment and have tried to set the IP to the new public IP.
This will take, but be forgotten on subsequent reboots.
I have tried using RH's setup util to change it.
I have tried editing the ifcfg-eth0 and ifcfg-eth1 files, and they are showing the right IP.
However on reboot, the public IP is forgotten as is the gateway.
Where else can I look to find where this evil IP is coming back from?
I need to make sure I get it right or if this box reboots, I will have to drive to the hosted facility.
Other locations that IP addresses can lurk would be greatly appreciated.

Thanks!
 
a) use a dhcp-server if available/ possible.
b) look into /etc/init.d/networking how the IP is set up.
c) use find:
Code:
find /etc -exec grep BAD_IP {} \;

I'm not using RH, so perhaps a real RH-user has more concrete knowledge.

seeking a job as java-programmer in Berlin:
 
Check in /etc/sysconfig/network for the gateway address. Otherwise, I don't know. You could put routing statements in rc.local, I suppose.
 
This may sound odd, but is it coded in /etc/hosts?

Maybe chmod 644 /etc/hosts. Possibly it's 444 (read only). I'm grasping at straws

Mark
 
When it comes up with the bad IP address, what does the contents of [tt]/etc/sysconfig/network-scripts/ifcfg-eth0[/tt] look like? Does it have the right address?

Are you using the GUI tools? If you are, use them to change the network config and save it there.

You might also look in /etc/sysconfig/network/profiles/default for additional config files if the GUI was ever used to config the network.

I try to stay away from the GUI tools because they tend to stash configuration files in weird locations.

Lorenzo Wacondo (System Administrator)

## Just because you can do something doesn't mean you should.
 
What is the difference between the following locations:
bad ip:
/etc/sysconfig/networking/devices/ifcfg-eth0
/etc/sysconfig/networking/profiles/default/ifcfg-eth0
good ip:
/etc/sysconfig/network-scripts/ifcfg-eth0
Other than the obvious.
I can change them, but I need to understand the difference.

Thanks

Here's the result (Public IP hidden) of the find:
[/root] #find /etc -exec grep 192.168.0.132 {} \; -print
IPADDR=192.168.0.132
/etc/sysconfig/networking/devices/ifcfg-eth0
IPADDR=192.168.0.132
/etc/sysconfig/networking/profiles/default/ifcfg-eth0
[/root] #find /etc -exec grep NEW IP {} \; -print
IPADDR=NEWIP
GATEWAY=NEWGW
/etc/sysconfig/network-scripts/ifcfg-eth0
 
Both
[tt]/etc/sysconfig/networking/devices/ifcfg-eth0[/tt]
and
[tt]/etc/sysconfig/networking/profiles/default/ifcfg-eth0[/tt]
is where the Redhat tools stash their configs. That is the reason I don't use the redhat-config-network or redhat-config-network-tui packages. If you use them (or have used them in the past) that is where the configs are kept aside from the [tt]/etc/network-scripts[/tt] location. Which is redundant.

You can get rid of them or rename them and the next time you issue [tt]service network restart[/tt] it should start using [tt]/etc/sysconfig/network-scripts/ifcfg-eth0[/tt] as the config.

I got bitten by the same snake in the grass when I first started using RH9.

I hope that is enough detail. [pipe]

Lorenzo Wacondo (System Administrator)

## Just because you can do something doesn't mean you should.
 
What a stupid concept!
WTF was RH thinking?!
[thumbsdown] Jeez, lets see how many places we can hide an IP. [thumbsdown]

Thanks for the help all.
I changed all occurances of 192.168.0.132 in /etc to the proper external IP. This fixed it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top