[Dnsmasq-discuss] Help me please! Multiple IPs on one interface
- not working
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):
### DNS ###
# Not for Kerberos5 users
# redirect no.net hosts to my webserver
### DHCP ###
#dhcp-option=19,0 # option ip-forwarding off
dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka
dhcp-option=45,0.0.0.0 # netbios datagram distribution server
dhcp-option=46,8 # netbios node type
dhcp-option=47 # empty netbios scope.
bogus-nxdomain=18.104.22.168 # VeriSign
# For debugging purposes, log each DNS query as it passes through
00:02:a5:68:07:fa 192.168.1.21 # this is a real machine
# /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.
# bogus machines do not exist.
# test machine is connected with crossover cable at eth1
# IPV6 versions of localhost and co
::1 ip6-localhost ip6-loopback
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,
Nov 16 15:03:20 [dnsmasq] DHCPDISCOVER(eth1) 00:02:a5:68:07:fa no
- 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
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 ...
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