[Dnsmasq-discuss] Patch: forcing interface to hand out foreign dhcp-range

Marko Fritzsche fritzsche@emazynx.de
Sat, 26 Feb 2005 00:39:01 +0100


Hi,

This patch enables dnsmasq to hand out addresses from a pool which does 
not belong to the subnet the hand-out-interface belongs to.

Example:
eth3: 192.168.4.10 Subnet: 255.255.255.0
eth3:0: 192.168.101.10 Subnet: 255.255.255.0

My goals were:
a) Reserved addresses for known hosts get 192.168.4.xxx IPs
b) Unknown hosts should get an IP outside the trusted net 
(192.168.101.xxx IPs).

With the patch applied the dnsmasq.conf was extended:

# Only static IPs allowed on 192.168.4.0/24
dhcp-range=192.168.4.0,static
# Force eth3 to handout dynamic IP addresses in the specified range
# This range is called quaran
dhcp-range=eth:eth3:quaran,192.168.101.11,192.168.101.199,10m

# Set the DHCP options for the quaran net (MANDATORY)
dhcp-option=quaran,1,255.255.255.0
dhcp-option=quaran,3,192.168.101.10
dhcp-option=quaran,6,192.168.0.10
dhcp-option=quaran,28,192.168.101.255

The patch is available here:
http://0xcc.de/ethx.patch.gz

Cheers,
Marko