DHCP through router

Status
Not open for further replies.

fitzjj

Daemon Poster
Messages
544
Hi guys. I'm hoping someone can help me.

I have just set up my own DHCP server to manage IP addresses on the network. I have two subnets. The main network (192.168.0.0) is where the DHCP server sits and this network is also my gateway to the internet - all computers on this network aquire their IP addresses from my DHCP server with no problems.

My Linksys router is plugged into this network (at IP address 192.168.0.11 and has an IP address of 192.168.1.1 on its network). Behind my Linksys router is the network 192.168.1.1. The router is a WRT54GS and is set up as a router rather than a gateway. However none of the computers on this subnet can see the DHCP server and so cannot aquire IP addresses (they get them fine when using the routers DHCP server).

I have gone back to a really basic dhcpd.conf file as shown below:
Code:
option domain-name-servers 192.168.0.12, 192.168.0.1;
ddns-update-style none;

subnet 192.168.0.0 netmask 255.255.255.0 {
  option routers 192.168.0.1;
  pool {
    range 192.168.0.11 192.168.0.14;
    default-lease-time 14400;
    max-lease-time 172800;
  }
}

# Linksys network
subnet 192.168.1.0 netmask 255.255.255.0 {
  # i dont know which interface to put here so just put both!
  option routers 192.168.1.1, 192.168.0.11;
  range 192.168.1.200 192.168.1.250;
}

I have a feeling it is something to do with broadcasts on the 192.168.1.0 network not being routed to the 192.168.0.0 network. - i can ping the DHCP server

any ideas? if it is to do with broadcasts not being routed to the lower networks is there a way to get round this by adding a new rule to the routing table?

thanks
 
Couple of questions. Is there a specific reason you need the two subnets rather than sticking to just one?

Your DHCP server is this another router or is it an actual computer with DHCP server software running on it such as Windows 2000/2003 Server Env?

Just want to be sure I am understanding the IP addresses on the linksys router I would assume the WAN=192.168.0.11 and the LAN=192.168.1.1.

Your subnet mask? Are both networks on 255.255.255.0?

Once you answer those I can get a better feel for what we need to do.
 
You are right in your suspiscion of the broadcasts not being passed. Just like any broadcast, routers still dont forward DHCP broadcasts. I dont know what kind of DHCP server you have, but I am much more familiar with Windows DHCP servers, than Linux.

For Windows, you would have to set up a DHCP relay agent on the other subnet. The relay agent is configured to forward the DHCP request broadcasts to the main DHCP server. The RA takes the broadcast and turns it into an directed broadcast (because it has the main DHCP server's IP address configured), which lets it contact the main server across the router.

Have a look at MS's website for more info:

http://www.microsoft.com/windows200...s2000/en/advanced/help/mpr_how_dhcprelay1.htm

Hopefully you are using Windows, or I just gave you a bunch of useless info:D

I'm sure Linux has something along the lines of a RA as well:confused:
 
No real reason for the two subnets, that has alway been how the network has been set up and it gives me space to prat around without taking everyone else offline when i screw up.

The DHCP server is a Linux machine running SuSE 9.2, it is not set up as a router and only has one interface to the network. The dhcp software is simply dhcpd.

Yep, for the Linksys router WAN=192.168.0.11 and LAN=192.168.1.1

Both networks have a 255.255.255.0 subnet mask


surely most networks dont have seperate dhcp server for each subnet?
 
There's at least one way to get around this problem. The one that comes to mind is to use your router as a DHCP server for one subnet. It's not the best solution, but it'll get the job done.

I dont see any other way due to the fact of routers not passing broadcasts. Mind you, I don't know everything;)
 
Elbatrop1 said:
For Windows, you would have to set up a DHCP relay agent on the other subnet

Hopefully you are using Windows, or I just gave you a bunch of useless info
Nope i'm not using windows, however the info was not useless. There is a relay agent for linux, does exactly as you say. I'll have a proper read of the documentation in the morning, as you say i'd need to install this on the other subnet. In the ideal case i suppose the perfect place to install this would be the linksys router, however that is not possible so in the case of my network i guess it would mean setting up a new machine solely for this task?

any chance it possible to play around with routing tables to forward broadcast?

cheers
 
To run a DHCP server from one side of a NAT'ted router, you need to enable broadcasts from either side of the firewall
 
Elbatrop1 said:
There's at least one way to get around this problem. The one that comes to mind is to use your router as a DHCP server for one subnet. It's not the best solution, but it'll get the job done.
Yeah, that is what's being done at the moment. It just seems a shame to have a DHCP server sitting there and working with the DNS server but only able to cater for one subnet.

I guess it would be possible to set the NIC on the server up to listen on both networks, or install a new NIC.

Obviously it makes sense not to relay DHCP requests through routers, i just kind of hoped there was a way round it :'(
 
Ah, i've played around with the routing on the main router, hopefully this should help. I have a feeling it might be something to do with the Linksys not being able to cope with anything greater than a class C network therefore I have changed the subnets in the dhcpd.conf file so that i have 192.168.0.0/28 and 192.168.0.128/25.

I'll wait until people have finished with the network to try this out though, since if it doesnt work it'll kill the network for a while.
 
Status
Not open for further replies.
Back
Top Bottom