manually fixing IPs

Dan Williams dcbw at redhat.com
Thu Mar 31 17:28:30 UTC 2011


On Sun, 2011-03-27 at 17:57 +0200, Ralf Corsepius wrote:
> On 03/27/2011 05:27 PM, Chuck Anderson wrote:
> > On Sun, Mar 27, 2011 at 03:58:06PM +0200, Ralf Ertzinger wrote:
> >> Hi.
> >>
> >> On Sun, 27 Mar 2011 15:48:14 +0200, Kevin Kofler wrote
> >>> NM supports static IPs these days. So I think that rather than
> >>> hacking around NM, you should just fix the IP inside NM's
> >>> configuration and have NM work FOR you rather than AGAINST you.
> >>
> >> I'm sorry, but by the time I have clicked through the GUI to do
> >> that I have configured the interface via ip, did what I wanted to
> >> do and unconfigured the interface again.
> >>
> >> I uncheck "Enable networking" in nm-applet before doing that,
> >> and for me that makes NM keep it's grubby paws off my manually
> >> configured interface, so I'm not complaining.
> >
> > You don't need to use the GUI.  Just edit
> > /etc/sysconfig/network-scripts/ifcfg-* with a static IP and NM will
> > pick it up right away and configure it.
> 
> And how to tweak /etc/sysconfig/network-scripts/ifcfg-* (and/or 
> /etc/sysconfig/network) for static IPs such that NM sets 
> hostname/domainname correctly?

domainname is only used for NIS, which I assume you're not running.
Otherwise, if you have a persistent hostname set
in /etc/sysconfig/network (HOSTNAME=adasdasdf) then NM will respect
that.  If you do not have a persistent hostname set, then the hostname
will come from the DHCP server, or if not available from DHCP, from
reverse DNS lookup of your IP address, just as with the 'network'
service.

NM will update your /etc/resolv.conf with various domains taken from
your hostname, so if your hostname is "blah.foobar.com", NM will add
"foobar.com" to the searches in /etc/resolv.conf.

As has been stated before, NM does not touch /etc/hosts anymore.

Dan




More information about the devel mailing list