[Dnsmasq-discuss] multiple ip on interface, dhcp not working
Sorin Panca
sorin.panca at gmail.com
Mon Nov 7 13:28:15 GMT 2005
Hello!
I've read the FAQ included in dnsmasq package an searched in Google
engine for some discussions upon the same problem I ran into.
I have a Gentoo box and I tried to setup dnsmasq to answer DHCP requests
in about 13 subnetworks connected to the same interface.
Each subnet has 8 IPs. One IP in each subnet is assigned to this
interface (eth1) with the command
ip addr add dev eth1 $IP/29 brd $BRD
where IP and BRD variables vary from subnetwork to subnetwork.
_After_ setting up all this IPs, I start dnsmasq.
I have a dhcp-range for each subnet and I use /etc/hosts and /etc/ethers
to assign static IPs to known hosts by MAC addresses.
I set read-ethers in dnsmasq.conf.
dnsmasq only respond to requests comming in on the first assigned IP.
Method I used to test this behaviour:
1. I reduced to 2 the number of subnetworks:
192.168.0.8/29 and 192.168.0.16/29
server's IPs: 192.168.0.9/29 brd 192.168.0.15
192.168.0.17/29 brd 192.168.0.23
2 stations (configured in /etc/ethers):
02:D0:B7:7E:23:25 192.168.0.10 (has a WindowsXP network bridge)
00:0B:DB:DE:42:55 192.168.0.18
Resaults:
192.168.0.10 was configured corectly and for 00:0B:DB:DE:42:55 was
assigned 192.168.0.14.
2. I populated /etc/ethers with stations in the first subnetwork, then I
stopped and I removed the /var/lib/misc/dnsmasq.leasses file and
started (not restarted) dnsmasq.
This is the error:
Nov 6 15:47:46 [dnsmasq] exiting on receipt of SIGTERM
Nov 6 15:47:50 [dnsmasq] started, version 2.23 cachesize 256
Nov 6 15:47:50 [dnsmasq] compile time options: IPv6 GNU-getopt
ISC-leasefile no-DBus
Nov 6 15:47:50 [dnsmasq] DHCP, IP range 192.168.0.18 -- 192.168.0.22,
lease time 2m
Nov 6 15:47:50 [dnsmasq] DHCP, IP range 192.168.0.10 -- 192.168.0.14,
lease time 2m
Nov 6 15:47:50 [dnsmasq] read /etc/hosts - 4 addresses
Nov 6 15:47:50 [dnsmasq] read /etc/ethers - 2 addresses
Nov 6 15:47:50 [dnsmasq] reading /etc/resolver
Nov 6 15:47:50 [dnsmasq] using nameserver 193.226.5.33#53
Nov 6 15:47:50 [dnsmasq] using nameserver 212.93.140.1#53
Nov 6 15:47:50 [dnsmasq] using nameserver 213.157.167.157#53
Nov 6 15:48:08 [dnsmasq] DHCPDISCOVER(eth1) 00:0B:DB:DE:42:55 no
address available
- Last output repeated 3 times -
3. /etc/init.d/dnsmasq stop
ip addr del dev eth1 192.168.0.17/29
/etc/init.d/dnsmasq start
* Started OK
Nov 6 15:59:29 [dnsmasq] DHCPREQUEST(eth1) 192.168.0.22 02:d0:b7:7e:23:25
Nov 6 15:59:29 [dnsmasq] DHCPACK(eth1) 192.168.0.22 02:d0:b7:7e:23:25
Termita
Nov 6 15:59:29 [dnsmasq] not giving name termita.lasernet.rdslink.ro to
the DHCP lease of 192.168.0.22 because the name exists in /etc/hosts
with address 192.168.0.10
and 02:d0:b7:7e:23:25 gets the 192.168.0.22 address corectly.
4. With same steps I tested with interface aliases. I used ifconfig this
time:
ifconfig eth1 192.168.0.9 netmask 255.255.255.248 up
ifconfig eth1:1 192.168.0.17 netmask 255.255.255.248 up
I report the same behavior as above.
{
zefir downloads # ip addr show
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: teql0: <NOARP> mtu 1500 qdisc noop qlen 100
link/void
3: tunl0: <NOARP> mtu 1480 qdisc noop
link/ipip 0.0.0.0 brd 0.0.0.0
4: gre0: <NOARP> mtu 1476 qdisc noop
link/gre 0.0.0.0 brd 0.0.0.0
5: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
6: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:90:27:be:b8:a3 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.2/29 brd 192.168.0.255 scope global eth0
inet6 fe80::290:27ff:febe:b8a3/64 scope link
valid_lft forever preferred_lft forever
7: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:90:27:89:81:c2 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.9/29 brd 192.168.0.15 scope global eth1
inet 192.168.0.17/29 brd 192.168.0.23 scope global eth1
inet6 fe80::290:27ff:fe89:81c2/64 scope link
valid_lft forever preferred_lft forever
8: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
link/ether 00:90:27:89:88:62 brd ff:ff:ff:ff:ff:ff
}
Please advise me. Thank You in advance.
More information about the Dnsmasq-discuss
mailing list