[Dnsmasq-discuss] Help me please! Multiple IPs on one interface - not working

Sorin Panca sorin.panca at gmail.com
Wed Nov 16 14:15:52 GMT 2005


Hello Simon and dnsmasq discuss list readers!
I've made some experimets.
First of all I modified the test configuration:

The server (same Gentoo box):
/etc/dnsmasq:
 ### DNS ###
domain-needed
bogus-priv
expand-hosts
domain=lasernet.rdslink.ro
cache-size=256
#localize-queries
# Not for Kerberos5 users
filterwin2k
resolv-file=/etc/resolver
strict-order
# redirect no.net hosts to my webserver
address=/no.net/127.0.0.1
interface=eth1
#interface=eth2
no-dhcp-interface=eth0
bind-interfaces
read-ethers
dhcp-authoritative

 ### DHCP ###
dhcp-range=lan1,192.168.1.10,192.168.1.14,255.255.255.248,2m
dhcp-range=lan2,192.168.1.18,192.168.1.22,255.255.255.248,2m
#dhcp-range=lan3,192.168.1.18,192.168.1.22,255.255.255.248,2m
dhcp-option=lan1,3,192.168.1.9
dhcp-option=lan2,3,192.168.1.17
#dhcp-option=lan3,3,192.168.1.17
dhcp-option=42,0.0.0.0
#dhcp-option=19,0           # option ip-forwarding off
dhcp-option=44,0.0.0.0     # set netbios-over-TCP/IP nameserver(s) aka
WINS server(s)
dhcp-option=45,0.0.0.0     # netbios datagram distribution server
dhcp-option=46,8           # netbios node type
dhcp-option=47             # empty netbios scope.
dhcp-leasefile=/var/lib/misc/dnsmasq.leases

#cache-size=150
#no-negcache
#local-ttl=
bogus-nxdomain=64.94.110.11 # VeriSign

# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
log-queries
EOF

/etc/ethers:
02:D0:B7:7E:23:25     192.168.1.10
00:E0:18:DC:E0:E8     192.168.1.11
00:D0:B7:08:31:BC     192.168.1.12
00:11:D8:14:D1:CC     192.168.1.13
00:B0:D0:70:D8:B5     192.168.1.14
00:0B:DB:DE:42:55     192.168.1.18
00:20:ED:86:51:32     192.168.1.19
00:60:08:4F:03:6C     192.168.1.20
00:C0:A8:FB:FC:E6     192.168.1.22
00:02:a5:68:07:fa     192.168.1.21 # this is a real machine
EOF

/etc/hosts:
# /etc/hosts:  This file describes a number of hostname-to-address
#              mappings for the TCP/IP subsystem.  It is mostly
#              used at boot time, when no name servers are running.
#              On small systems, this file can be used instead of a
#              "named" name server.  Just add the names, addresses
#              and any aliases to this file...
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8
2003/08/04 20:12:25 azarah Exp $
#

127.0.0.1       localhost zefir
192.168.1.1     zefir   zefir.lasernet.rdslink.ro.      lasernet.rdslink.ro.
192.168.0.9     zefir3
192.168.0.17    zefir4
192.168.0.25    zefir5
192.168.0.33    zefir6
192.168.0.41    zefir7
192.168.0.49    zefir8
192.168.0.57    zefir9
192.168.0.65    zefir10
192.168.0.73    zefir11
192.168.0.81    zefir12
192.168.0.89    zefir13
192.168.0.97    zefir14
# bogus machines do not exist.
# test machine is connected with crossover cable at eth1
192.168.1.10    bogus1
192.168.1.11    bogus2
192.168.1.12    bogus3
192.168.1.13    bogus4
192.168.1.14    bogus5
192.168.1.21    test
192.168.1.22    bogus6
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
EOF

tail -f /var/log/everything/current:
Nov 16 15:01:37 [kernel] e100: eth1: e100_watchdog: link down
Nov 16 15:01:39 [kernel] e100: eth1: e100_watchdog: link up, 100Mbps,
full-duplex
Nov 16 15:03:20 [dnsmasq] DHCPDISCOVER(eth1) 00:02:a5:68:07:fa no
address available
                - Last output repeated 3 times -

The test machine:
test	00:02:a5:68:07:fa	192.168.1.21

What I did:
1. I unmerged dnsmasq (the package built from the ebuild)
2. I downloaded dnsmasq-2.23.tar.gz and compiled and installed it
3. I started the tests.
	Results: the test machine gets an address at random. The information in
/etc/ethers is ignored. If an address in the first dhcp-range is not
available, an address in the second range is allocated (dhcp over an
alias works). If there is no free IP address in /etc/ethers, the IP
address mapped to the MAC address is *NOT* allocated.
4. I renamed the manually compiled binary and remerged the Gentoo package
	Results: same as above. DHCP over alias works but the configured IP to
MAC addresses don't...

I don't know what is now different. Last time the address mapping worked
and the aliases didn't.

Now I swap 192.168.1.11 with 192.168.1.21 so the configured MAC address
go in the first configured network to see if it gets the right IP
address. (I stoped & restarted dnsmasq).

It gets the address:
Nov 16 15:48:02 [dnsmasq] DHCPDISCOVER(eth1) 00:02:a5:68:07:fa
Nov 16 15:48:02 [dnsmasq] DHCPOFFER(eth1) 192.168.1.11 00:02:a5:68:07:fa
Nov 16 15:48:03 [dnsmasq] DHCPREQUEST(eth1) 192.168.1.11 00:02:a5:68:07:fa
Nov 16 15:48:03 [dnsmasq] DHCPACK(eth1) 192.168.1.11 00:02:a5:68:07:fa test

Shortly (my assumption):
A. First case = 00:02:a5:68:07:fa belongs in the second network.
1. A DHCPDISCOVER from 0.0.0.0/32 comes in on eth1
"I need an IP, and i have 00:02:a5:68:07:fa"
2. [dnsmasq] "Do I have a range for this interface? Yes. (not many?)
There is no such address in /etc/ethers for this MAC. I'll give it a
random IP if there is one available for this primary address of the
interface."
2a. There is an IP in the first range that has no MAC assigned
DHCPOFFER the free IP to 00:02:a5:68:07:fa. DHCPREQUEST; DHCPACK.
2b. There is no IP in the first range that has no MAC assigned
[dnsmasq] "I'll look at other ranges in dnsmasq.conf (/etc/ethers were
read already for that interface, but only for the primary IP). I have an
address range configured and I can reach that network on eth1. Do I have
a MAC in already read /etc/ethers for this interface? NO... I'll assign
a random IP. Do I have a free IP in that range? (reading /etc/ethers
again). No i don't -> no address available. Yes I do -> DHCPOFFER ...
DHCPACK."
B. Second case = 00:02:a5:68:07:fa belongs in the first network.
No problems. Works as expected.



More information about the Dnsmasq-discuss mailing list