[Dnsmasq-discuss] dnsmasq and eth0:1

Simon Kelley simon@thekelleys.org.uk
Mon, 15 Nov 2004 17:12:50 +0000


Jonathan Thackray wrote:
> Hi,
> 
> I'm on the end of a cable modem, and only have one ethernet card
> in my firewall/gateway box, so that eth0 is my DHCP address allocated
> by my ISP, and eth0:1 is a 10.x.x.x internal address for my network,
> as shown:
> 
> eth0    Link encap:Ethernet  HWaddr 00:40:63:D7:A6:6E
>         inet addr:213.107.x.x  Bcast:255.255.255.255 Mask:255.255.255.0
>         inet6 addr: fe80::240:63ff:fed7:a66e/64 Scope:Link
>         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>         RX packets:28529 errors:0 dropped:0 overruns:0 frame:0
>         TX packets:12111 errors:1 dropped:0 overruns:1 carrier:0
>         collisions:0 txqueuelen:1000
>         RX bytes:3166669 (3.0 MiB)  TX bytes:2389135 (2.2 MiB)
>         Interrupt:10 Base address:0xec00
> 
> eth0:1  Link encap:Ethernet  HWaddr 00:40:63:D7:A6:6E
>         inet addr:10.1.2.4  Bcast:10.1.2.255  Mask:255.255.255.0
>         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>         Interrupt:10 Base address:0xec00
> 
> However, when I configure dnsmasq to serve DHCP requests in that
> range, I get this error message logged:
> 
>     no address range available for DHCP request via eth0
> 
> Can dnsmasq work with eth0:1? Or am I just configuring it wrongly?
> I've tried configuring eth0 to be 10.x.x.x, but then dhclient3
> won't configure eth0:1 as a DHCP allocated address.
> 

Mixing DHCP and IP alias is generally pretty much impossible: the DHCP 
process involves broadcasts which are sent to the IP broadcast address 
(255.255.255.255) so there's no way to know which interface (eth0 or 
eth0:1) they are sent to, and therefore which network to allocate an 
address on.

Your scheme further involves mixing a DHCP server and a DHCP client on 
the same physical network - that would probably result in your DHCP 
server allocating an address to the interface which is meant to be 
connected to your ISP. You also risk having your DHCP server allocate 
addresses to your neighbours - my CM certainly receives DHCP discover 
packets from other machines on the subnet - I've never tested to see if 
the system filters reply packets from customer machines - I would hope 
it does!

If at all possible, get an extra physical interface and put your 
external and internal networks on different interfaces. That scheme 
works fine with dnsmasq - I use it here. If you can't do that, give up 
all plans to run a DHCP server, it won't work.

To answer the specific question - dnsmasq does not support DHCP on IP 
aliased interfaces - it does work for DNS though.


Cheers,

Simon.