[NCLUG] Permanent -vs- Temporary Changes to Network Settings

k.h.olson at att.net k.h.olson at att.net
Tue Apr 27 12:50:16 MDT 2004


Rich,

  There are several files that you would need to edit to make the changes stable across reboots.

/etc/sysconfig/network-scripts/ifcfg-eth0 (there may be eth1, eth2, etc. depending upon how many network cards you have)
  This file has the IP address. 

/etc/hosts
  You may need to change this file if the original hostname is in it.

/etc/sysconfig/network
  This file has the hostname in it. It may also have the default gateway, though you can set a gateway in the ifcfg-eth0

/etc/sysconfig/static-routes
  You may have this file, and it may need to be changed.

The basic process for startup is in /etc/init.d/network. You can follow through the script to see what it does.

It is likely that the routing will adjust automatically after you have made the edits to these files and rebooted. I presume your routing has to do with networks and gateways, though you do not indicate if there are specific additional routes you have to add.

If you have to change often, I would think it would be easiest to create two sets of files on each machine, and then write a script that copies the correct set of files to the normal operating files. You would then need to reboot. Using hostname, ifconfig, and route only effect the current session. One could also write a pretty simple perl/shell/python/etc script to prompt you for the values and edit the files.

Someone else may know if there is a parameter to pass to the commands to make the changes persistent, but I have always edited the files.

I hope this helps.

Kevin


> Hi, all-
> I have two machines here.  One or the other is always acting as a
> production web server, the other is development/testing/repair/etc.
> When I switch their roles, I change hostname, IP address and sometimes
> gateway settings with the hostname, ifconfig, and route commands because
> the production server always needs to have a certain IP address &
> hostname, whichever machine it is.  
> 
> The problem I'm having is that if either machine is rebooted, it returns
> to the network settings specified when it was installed.  If the machine
> was installed with the network settings for test, and it's supposed to
> be the current production machine, it will come back up with the test IP
> & hostname, and the website no longer has a server answering its
> address. Similarly, if the machine was installed with the network
> settings for production, and it's supposed to be the current test
> machine, it comes back up with the production IP and hostname, and the
> resulting network conflict takes the web site down.  The latter problem
> is more common, but either is pretty frustrating.
> 
> So I need to know how to make persistent changes to network settings,
> ones that will last beyond a reboot.  Anyone have any pointers?  Both
> machines are running recent KRUD/Fedora installations, though they're
> not on the same month's release.  
> 
> --Rich
> _______________________________________________
> NCLUG mailing list       NCLUG at nclug.org
> 
> To unsubscribe, subscribe, or modify 
> your settings, go to: 
> http://www.nclug.org/mailman/listinfo/nclug



More information about the NCLUG mailing list