Re: Simple one: How to set a static IP address?



On 30 Dec 2005 07:51:21 -0800, Thommy M.
<thommy.m.malmstrom@xxxxxxxxx> wrote:
> I'm a bit new (or rather on/off) to Linux (but quite experienced with
> Solaris). For fun I installed
> Ubuntu on a spare PC and the it got an IP from my DHCP server. Now I
> want to set a static
> IP and edited /etc/network/interfaces to this:
>
> # The loopback network interface
> auto lo
> iface lo inet loopback
>
> # This is a list of hotpluggable network interfaces.
> # They will be activated automatically by the hotplug subsystem.
> mapping hotplug
> script grep
> map eth0
>
> # The primary network interface
> iface eth0 inet static
> address 192.168.0.7
> netmask 255.255.255.0
> network 192.168.0.0
> broadcast 192.168.0.255
> gateway 192.168.0.2
>
> Then I set IP on eth0 to 192.168.0.7 with ifconfig
>
> However, from time to time, eth0 falls back to a DHCP address.
> Do I really need to reboot, or have I set something wrong in the above?
>
Remove or comment the "mapping hotplug" and the following two lines,
unless your eth0 is a PCMCIA card. You could even uninstall the DHCP
client if you are always going to use a static address.

.



Relevant Pages

  • Re: Simple one: How to set a static IP address?
    ... Ubuntu on a spare PC and the it got an IP from my DHCP server. ... # They will be activated automatically by the hotplug subsystem. ... iface eth0 inet static ...
    (comp.os.linux.setup)
  • Re: setting a static ip for my lenny box
    ... allow-hotplug eth0 ... auto eth0 ... iface eth0 inet static ...
    (Debian-User)
  • Re: How to set up wi-fi device?
    ... Can anyone share how they set up their card? ... is setup for dhcp, and for that reason I added some stuff to dhclient.conf. ... How is your eth0 setup? ... interface file above is only commented instructions to me. ...
    (Debian-User)
  • Re: Help: configure networking
    ... Because this is an LTSP server, it will have a DHCP server in it. ... The router connects to the Edubuntu server on eth0, and the clients connect on eth1. ... This server is inside a Windows network serving DHCP that in turn connects to the internet. ...
    (Ubuntu)
  • Re: unable to bring up eth0
    ... hope this link will help with DHCP. ... >> iface lo inet loopback ... >> iface eth0 inet static ... > Are other DHCP-Clients in the same network running properly? ...
    (Debian-User)