Help to configure subnets and DHCP

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

beneix

New Around Here
Hi, just joined to seek some advice.

The modem/router provided by my ISP is crippled, so I want to replace it – but I can't completely for ADSL and VoIP reasons. It also can't be put in bridge mode (did I mention it is crippled?) so I will have to use its DMZ functionality and put my main router behind it. This raises a couple of basic questions:

1. Can/should the ISP router and the main router be on the same subnet, e.g. ISP router = 192.168.1.1 and main router 192.168.1.2?
2. Let's say that instead the ISP router is 192.168.2.1 and the main router is 192.168.1.1. Does this mean the main router should have a WAN address on the 192.168.2.x subnet while handing out IP leases to LAN clients on the 192.168.1.x subnet?
3. Should the main router WAN interface be set to a static IP towards the ISP router, or get its IP via DHCP from the ISP router but have a static lease defined (on the ISP router)?
4. Can you even have cascading DHCP, i.e. both the ISP router and the main router act as DHCP servers? I assume it definitely isn't good if the answer to question 1 is yes – i.e. they are both on the same subnet, but perhaps fine if they are on different subnets?
5. If the ISP router is 192.168.2.1 and the main router is 192.168.1.1, I assume that "Gateway" for the WAN on the main router should be 192.168.2.1? Should "Gateway" on the LAN on the main router also be 192.168.2.1, or is it 192.168.1.1?

My current LAN is 192.168.1.1/24, and since I have quite a few things defined in scripts and configurations accordingly, I would like to keep several clients' IP addresses – hence some of the above questions.
 

ColinTaylor

Part of the Furniture
1. Depends. If the "main router" is configured as a router it must be on a different subnet. If it's configured as "just an access point" then it's just another device on the ISP router's LAN (without a separate network behind it).
2. Yes.
3. Either, your choice.
4. Each subnet should only have one DHCP server.
5. LAN gateway on the main router network should be 192.168.1.1, which should be the default given out by its DHCP server.
 

beneix

New Around Here
1. Depends. If the "main router" is configured as a router it must be on a different subnet. If it's configured as "just an access point" then it's just another device on the ISP router's LAN (without a separate network behind it).
2. Yes.
3. Either, your choice.
4. Each subnet should only have one DHCP server.
5. LAN gateway on the main router network should be 192.168.1.1, which should be the default given out by its DHCP server.
Thanks for your help. I must say I don't fully understand the "Gateway" concept. I always see in router configurations both "WAN Gateway" and "LAN Gateway". Sometimes these fields are left blank, and things work anyway. Sometimes, there is (in addition to the LAN Gateway IP address) a checkbox "Use default gateway".

What is the meaning for the router of WAN Gateway and LAN Gateway, respectively? What does each of them instruct the router to do, how does it affect routing?
 

ColinTaylor

Part of the Furniture
A router routes traffic between two (or more) networks. In other words the router is acting as a gateway between these networks.

From the router's perspective it needs to know the IP address of the router that connects it to "the internet". This is its WAN gateway address which it usually obtains via DHCP from the ISP's servers.

For client's on the LAN they need to be told the IP address of a local router that connects them to the internet. Clients usually obtain this information from a DHCP server on the LAN (which usually runs on the router). In the DHCP server settings there will be a field that specifies the IP address of the LAN gateway device. Leaving this field blank on a home router often has the same effect as entering the IP address of the router itself.

Untitled.png
 

beneix

New Around Here
Thanks @ColinTaylor – that makes perfect sense and is sort of what I assumed. I suppose the reason I was confused was the fact that there is even an option to specify the gateway on a LAN – I wonder when you would need to specify the gateway as anything different than the LAN router's IP. I also still wonder about the tick box "Use default gateway [If unchecked, no default route is configured]".
 

ColinTaylor

Part of the Furniture
Thanks @ColinTaylor – that makes perfect sense and is sort of what I assumed. I suppose the reason I was confused was the fact that there is even an option to specify the gateway on a LAN – I wonder when you would need to specify the gateway as anything different than the LAN router's IP.
In most home setups there would never be a need to specify a gateway that wasn't the router itself. There will always be some edge cases where you might be running a network of multiple subnets, or have multiple internet connections, or have an ISP-supplied gateway device that doesn't include a (decent) DHCP server, but that's not typical.

I also still wonder about the tick box "Use default gateway [If unchecked, no default route is configured]".
I don't know where you're seeing this message (or its context) so can't comment on its usefulness. I'm guessing this is an OpenWRT WAN option, but I don't use OpenWRT myself.
 
Last edited:

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top