how to change a dhcpd conf file using ISC to map a paricular subnet to a particuar interface ??????

Simon Hobson dhcp1 at thehobsons.co.uk
Mon Dec 26 09:30:21 UTC 2011


<ameen.shajahan at wipro.com> wrote:

># ifconfig
>ixp0      Link encap:EthernetHWaddr 00:60:43:80:41:92
>inet addr:25.1.1.1  Bcast:25.255.255.255  Mask:255.0.0.0
>inet6addr: fe80::260:43ff:fe80:4192/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:4767 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:3397 errors:0 dropped:0 overruns:0 carrier:0
>collisions:0 txqueuelen:256
>           RX bytes:451824 (441.2 KiB)  TX bytes:677416 (661.5 KiB)
>
>ixp1      Link encap:EthernetHWaddr 00:60:43:80:41:93
>inet addr:65.1.1.1  Bcast:65.255.255.255  Mask:255.0.0.0
>inet6addr: fe80::260:43ff:fe80:4193/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
>           RX packets:1251 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:590 errors:0 dropped:0 overruns:0 carrier:0
>collisions:0 txqueuelen:256
>           RX bytes:143248 (139.8 KiB)  TX bytes:205548 (200.7 KiB)
>
>ixp1:1    Link encap:EthernetHWaddr 00:60:43:80:41:93
>inet addr:75.1.1.1  Bcast:75.255.255.255  Mask:255.0.0.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
>
>lo        Link encap:Local Loopback
>inet addr:127.0.0.1  Mask:255.0.0.0
>inet6addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:16436  Metric:1
>           RX packets:397 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:397 errors:0 dropped:0 overruns:0 carrier:0
>collisions:0 txqueuelen:0
>           RX bytes:29628 (28.9 KiB)  TX bytes:29628 (28.9 KiB)



># ./dhcpd -d -4 -cf /opt/v1/etc/dhcpd.conf ixp1:1

You cannot do that


>So I would like to know is there any procedure for mapping subnet 
>declaration to particular interfaces in conf file.
>
>i.e   how to change a dhcpd.conf file to map 75.1.1.0 subnet to a 
>interface ixp1:1

You cannot. Since DHCP si a broadcast protocol, then you can only 
listen on a real interface, not a virtual one. Further, you cannot 
listen only to s certain subnet since the clients don't know what IP 
address they have until they've been configured via DHCP.

Look at it this way, when a broadcast packet comes into the physical 
port, with source address 0.0.0.0 and destination address 
255.255.255.255, how on earth can the network stack determine if it's 
for ixp1, ixp1:1, or something else ?

So in your situation, you **MUST** declare a shared network for the 
two subnets :

shared-subnet somename {
   subnet 65.0.0.0 netmask 255.0.0.0 {
     ...
   }
   subnet 75.0.0.0 netmask 255.0.0.0 {
     ...
   }
}

Note that by default, both subnets are equal, and so clients will be 
given an address from any pool in either subnet. If you require 
clients to be given an address in a specific subnet, then you will 
need to tell the server which clients belong where. There are many 
threads in the archives - the three principal methods are :

1) Declare host statements for clients required in one subnet, then 
use allow/deny known-hosts to allow them in one and deny them in the 
other.

2) Use classes and subclasses to assign clients in much the same way 
(typically by list of MAC addresses.

3) Use classes matches on some arbitrary expression (could be vendor 
ID etc) to separate clients.

Or perhaps better still, if it suits your requirements, then keep the 
networks separate and either connect using two NICs, or use a relay 
agent to connect a non-local subnet to the DHCP service.
This latter sounds more appealing, do you really need one network 
with support for over 33 million clients ?

-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list