LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up DHCPd on firewall to serve 3 internal subnets (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-dhcpd-on-firewall-to-serve-3-internal-subnets-661391/)

ocgltd 08-08-2008 07:44 AM

Setting up DHCPd on firewall to serve 3 internal subnets
 
I have a simple Fedora Core 5 installation acting as a firewall bridging 4 subnets (3 internal). I want it to serve IP addresses to 3 of these subnets.

From everything I have read, DHCPd can't serve different IP ranges to different subnets (based on NIC)...

Is there a way to achieve this that I'm missing?

Thanks,
MD

estabroo 08-08-2008 10:51 AM

Are you running vlans? Have separate ethernet cards per subnet?

You should be able to have dhcpd serve up a different block to each vlan or separate card. For doing it on the same nic without vlans I'm not sure, you might be able to do it if you have an alias on it in the block you want to serve.

On debian and ubuntu you just edit the /etc/default/dhcp3-server file and tell it what interfaces you want to serve on and then in the server config file you just put in your different ip blocks, it sorts them out by the ips you have assigned to the various interfaces.

ocgltd 08-08-2008 11:39 AM

I have 4 seperate NIC's, each with unique IP and range. Can you link/post a sample config?

grepmasterd 08-08-2008 12:26 PM

not sure how exactly it is configured on fedora, but on debian-based distros like ubuntu you just need to update two files. for this example I'll assume that your 4 interfaces are configured as such:

eth0 : 10.1.1.1/24
eth1 : 10.1.2.1/24
eth2 : 10.1.3.1/24
eth3 : 10.1.4.1/24


then, update /etc/default/dhcp3-server (you'll have to find the equivalent file for fedora, since this is debian-specific) to contain:

INTERFACES="eth0 eth1 eth2 eth3"

and then your /etc/dhcp3/dhcpd.conf could contain:

Code:

option domain-name "my.net";
option domain-name-servers ns1.my.net, ns2.my.net;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 10.1.1.0 netmask 255.255.255.0 {
  range 10.1.1.10 10.1.1.39;
  option domain-name "netA.my.net";
  option routers 10.1.1.1;
  option broadcast-address 10.1.1.255;
}

subnet 10.1.2.0 netmask 255.255.255.0 {
  range 10.1.2.10 10.1.2.39;
  option domain-name "netB.my.net";
  option routers 10.1.2.1;
  option broadcast-address 10.1.2.255;
}

subnet 10.1.3.0 netmask 255.255.255.0 {
  range 10.1.3.10 10.1.3.39;
  option domain-name "netC.my.net";
  option routers 10.1.3.1;
  option broadcast-address 10.1.3.255;
}

subnet 10.1.4.0 netmask 255.255.255.0 {
  range 10.1.4.10 10.1.4.39;
  option domain-name "netD.my.net";
  option routers 10.1.4.1;
  option broadcast-address 10.1.4.255;
}



All times are GMT -5. The time now is 10:08 AM.