DHCP server for two physical separate subnets

Franz Edler franz.edler at inode.at
Sun Nov 2 20:57:11 UTC 2008


Hi all, 

maybe anyone can help me solve the following DHCP problem:

I have three interface cards in my Debian 4.0 computer (eth0, eth1 and
eth2). The first (eth0) is the upstream connection and eth1 und eth2 are two
physically separate subnetworks.

The two interfaces are defined as follows (/etc/network/interfaces):
	allow-hotplug eth1
	iface eth1 inet static
		address 192.168.1.1
		network 192.168.1.0
		netmask 255.255.255.224
		broadcast 192.168.1.31

	allow-hotplug eth2
	iface eth2 inet static
		address 192.168.2.1
		network 192.168.2.0
		netmask 255.255.255.224
		broadcast 192.168.2.31

I have two subnet declarations in my /etc/dhcpd.conf	as follows:

  subnet 192.168.1.0 netmask 255.255.255.224
  {
	option broadcast-address 192.168.1.31;
	option subnet-mask 255.255.255.224;
	option routers 192.168.1.1;
	option domain-name-servers 172.16.0.1;
	range 192.168.1.2 192.168.1.20;
	default-lease-time 86400;
	max-lease-time 86400;
    
 	host wxp.dom11.fhtw 
  	{
  	hardware ethernet 00:11:11:76:6d:76;
  	fixed-address 192.168.1.21;
  	}
	...
  }

  subnet 192.168.2.0 netmask 255.255.255.224
  {
	option broadcast-address 192.168.2.31;
	option subnet-mask 255.255.255.224;
	option routers 192.168.2.1;
	option domain-name-servers 172.16.0.1;
	range 192.168.2.2 192.168.2.20;
	default-lease-time 86400;
	max-lease-time 86400;
    
 	host wxp.dom21.fhtw 
  	{
  	hardware ethernet 00:19:66:2a:4f:9a;
  	fixed-address 192.168.2.21;
  	}
	...
  }

The problem is that the clients irrespective from which subnet they send the
DHCP request always get an address from the first subnet range, even if the
client sits on the second subnet.

Isn't it possible to separate the two subnets also at the DHCP server?
Any help is highly appreciated.

regards
Franz



More information about the dhcp-users mailing list