[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting up dhcp-server on my desktop machine

On Sun, Aug 7, 2011 at 4:00 AM, Bob Proulx <bob@proulx.com> wrote:

>> I have sofar following setup on my desktop system:
>>  * /etc/network/interfaces
>> auto lo
>> iface lo inet loopback
>> allow-hotplug eth1 # to my ISP
> Normally you would not mention eth1 at all if you want network-manager
> to manage it.

NetworkManager is *NOT* your friend for any stable server. It should
be disabled, by default, in any system that doesn't need to manage
wifi devices or migrating VPN connections. In fact, ripping it *out*
by the roots is usually safest on any desktop or server class host..

>> allow-hotplug eth0 # LAN to my server
>> iface eth0 inet static
>>     address
>>     netmask
>>     network
>>     broadcast
>>     gateway
> For your own sanity you probably want to add 'auto eth0' in addition
> to the 'allow-hotplug eth0' line.

Replace "allow-hotpug eth0" with "auto eth0". Don't just add it.

> For eth0 you have netmask set which is good.  But you also have
> network and broadcast set and those are not necessary to set
> explicitly since setting netmask is sufficient.  Having all three
> appear in one of the examples as an example of something you could
> change if needed but it wasn't expected for them to always be set.

Yeah, this is a bit of old "let the system derive the correct value,
it's safer" programming. It's too easy when things move around to
forget to change the "network" or "broadcast" setting in concert with
the "netwmask" and IP address.

> But in error you have set a second gateway on your secondary interface
> and are gatewaying back to yourself.  You will get the default gateway
> from your ISP on eth1 when network-manager dhcp's an address and
> gateway.  That is the one you want.  Remove this second gateway
> statement from eth0.  That isn't what you want there.  That by itself
> might be the cause of whatever problems you experienced.

Good point.

> Stop there for a moment and test the network and don't proceed to the
> dhcp server step until you think the networking is configured
> correctly.

> You are missing some of the standard configurations.  Some of this
> might not be needed but it is part of the standard template and what I
> have in my files.

[ good notes about setting additional options, such as default
domain-name, snipped. ]

>> Running /etc/init.d/networking restart is deprecated because it may not
>> enable again some interfaces ... (warning).
> Deprecated because things have moved to an event driven hotplug system
> instead.  But both can co-exist for a while longer if you add the auto
> line.  But in the future get used to interfaces being completely
> dynamic.  This topic gets discussion here in the mailing list
> regularly.

The "hotplug" business is unstable and inappropriate for servers.

>> I restarted networking with network-manager too but still get not eth0
>> up:
>> sudo /etc/init.d/network-manager restart
> If your desktop is always online then you might consider avoiding
> network-manager.  It is useful on a mobile device that needs to be
> selecting different networks at different times.  But wicd does the
> job better.  Adn you don't need it on an always on desktop or server
> and n-m has so many bad problems that it is best to avoid it when
> possible.  Stop network-manager and add this to your interfaces file.

If your network is at all stable you should avoid NetworkManager.
(That's what the software is actually called.)

> auto eth1
> allow-hotplug eth1 # to my ISP
>        iface eth1 inet dhcp
> Then bring the interface up with ifup.

See my note above. There is no *point* to allow-hotplug for a desktop
or server system.

Reply to: