Problem with multiple interfaces / multiple IPs per interface in linux, with dhcp server.

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jul 13 21:58:47 UTC 2006


psihozefir wrote:

>I run ISC DHCP server version 3.0.4-r1 on Gentoo Linux ~x86 and I have
>the following configuration:
>eth0 - ieee1394 LAN0 - not configured
>eth1 - The Internet (client of some dhcp server at my ISP)
>eth2 - intranet LAN1 configured with multiple IPs with the iproute2
>package (not aliasses); the configured addresses are:
>192.168.0.1/29; 192.168.0.9/29; 192.168.0.17/29;
>192.168.0.25/29; 192.168.0.33/29; 192.168.0.41/29;
>192.168.0.49/29; 192.168.0.57/29; 192.168.0.65/29;
>192.168.0.73/29;192.168.0.81/29;192.168.0.89/29;
>192.168.0.97/29 and 192.168.2.1/29.


I assume you have a reason for this, it's very wasteful of addresses 
(you lose 3 of each block of 8) but doesn't gain you anything traffic 
wise. It's not wrong, I'm just curious.


>Please notice the last one!
>eth3 - intranet LAN2 configured with the address 192.168.3.1/29.
>All works well with the 192.168.0.* subnets.
>When I connect a diskless computer to eth3
>_sometimes_ it gets 192.168.3.5 and other times
>it gets 192.168.2.3... This is very odd.
>if i restart the dhcp server, the problem persists.
>The error displayed by the PXE client is `PXE-E11: ARP-timeout.'
>This error is normal as the server is not connected to the client
>through eth2 (which has the address 192.168.2.1/29),
>but through eth3 (that has 192.168.3.1).
>The server serves the wrong address.
>Here is my dhcpd.conf file
>Until today the client got 192.168.3.5 address.
>I have no other clients connected to eth3.
>
># dhcpd.conf
>authoritative;
>
>default-lease-time 600;
>#max-lease-time 7200;
>max-lease-time 1800;
>ddns-update-style interim;
>ddns-ttl 7200;
>allow bootp;
>
>
>shared-network lasernet{
>
>subnet 192.168.3.0 netmask 255.255.255.248
>{
>     option subnet-mask 255.255.255.248;
>     allow client-updates;
>     allow unknown-clients;
>     allow booting;
>     allow bootp;
>     next-server 192.168.3.1;
>     filename "/pxelinux.0";
>     ping-check true;
>     server-identifier 192.168.3.1;
>     option domain-name-servers 192.168.3.1, 213.157.167.157;
>     option routers 192.168.3.1;
>     use-host-decl-names off;
>     range 192.168.3.2 192.168.3.6;
>     }


192.168.3.0/29 is NOT part of the shared network, it is a separate network.

Effectively you have lied to the dhcp server by telling it that the 
192.168.3.0/29 subnet is interchangable with any of the others - 
therefore any client attached to eth2 can be given an address in this 
subnet or any client attached to eth3 can be given an address from 
one of the other subnets.



>subnet 192.168.2.0 netmask 255.255.255.248
>{
>     option subnet-mask 255.255.255.248;
>     allow client-updates;
>     allow unknown-clients;
>     allow booting;
>     allow bootp;
>     next-server 192.168.3.1;
>     filename "/pxelinux.0";
>     ping-check true;
>     server-identifier 192.168.2.1;
>     option domain-name-servers 192.168.2.1, 213.157.167.157;
>     option routers 192.168.2.1;
>     use-host-decl-names off;
>     range 192.168.2.2 192.168.2.6;
>}
>
>subnet 192.168.0.8 netmask 255.255.255.248
>{
>     option subnet-mask 255.255.255.248;
>     deny client-updates;
>     deny unknown-clients;
>     allow booting;
>     allow bootp;
>     next-server 192.168.3.1;
>     filename "/pxelinux.0";
>     ping-check true;
>     server-identifier 192.168.0.9;
>     option domain-name-servers 192.168.0.9, 213.157.167.157;
>     option routers 192.168.0.9;
>     use-host-decl-names off;
>
>         host termita1 {
>             hardware ethernet 02:D0:B7:7E:23:25;
>             fixed-address 192.168.0.10;}
>
>         host termita2 {
>             hardware ethernet 02:50:BF:77:DA:C7;
>             fixed-address 192.168.0.10;}
>
>         host cristy {
>             hardware ethernet 00:E0:18:DC:E0:E8;
>             fixed-address 192.168.0.11;}
>
>         host mariana {
>             hardware ethernet 00:0F:EA:2C:5B:67;
>             fixed-address 192.168.0.13;}


Please note : host statements are GLOBAL, putting them inside the 
subnet will only cause confusion sooner or later.



More information about the dhcp-users mailing list