Force default gateway with automatic DHCP [SOLVED]

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sun Mar 14, 2021 7:18    Post subject: Force default gateway with automatic DHCP [SOLVED] Reply with quote
If I use "Automatic Configuration - DHCP", my ISP gives me a private WAN IP and a public IP behind cg-nat.

I asked to be out of cg-nat and the private WAN IP changed (the router connected to another gateway - DHCP server) and I got a public IP without cg-nat.

The problem is that in dd-wrt I only connect to the cg-nat gateway. I get to connect to the new gateway only with the ISP router. Both routers use automatic DHCP configuration.

I asked to be out of cg-nat again thinking they used a MAC address filter and that they needed to include my new MAC. I also tried to clone the old MAC (I'm 100% user I got it right, I even used wireshark to capture the traffic).

Nothing works. Any way to force "Automatic Configuration - DHCP" + custom gateway. I want both, the automatic IP without DHCP authentication but with the gateway of my choosing.

The ISP router was using Automatic DHCP but had a field called DHCP vendor class (or similar) called "nocgnat"). I'm not sure if it is a parameter or only an informative field.

Thanks.
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Sun Mar 14, 2021 17:37    Post subject: Reply with quote
There is a gateway address entry on the main setup page in the webUI. Your ISP will have to give you what to enter there unless their network configuration won't allow that.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sun Mar 14, 2021 19:16    Post subject: Reply with quote
That does not work. I always though "Network Setup" was for the local net. "WAN Setup -> WAN Connection Type" is where I could change the default Gateway but I only have "DHCP Authentication" with no DHCP server option.

Gateway for "Local Network" -> Status_Lan.asp in web gui
Gateway for WAN -> Status_Internet.asp in web gui

2 different things with different IPs
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Sun Mar 14, 2021 19:34    Post subject: Reply with quote
The vendor class id sets the extra options like gateway etc.

You can set it on the services tab.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Sun Mar 14, 2021 20:54    Post subject: Reply with quote
egc wrote:
The vendor class id sets the extra options like gateway etc.

You can set it on the services tab.


And that worked!

In my old router it was called DHCP 60 and the field was "nocgnat".

Serives -> Services Management -> DHCP Client -> DHCP Vendorclass = nocgnat

Thank you!
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Mon Mar 15, 2021 1:10    Post subject: Reply with quote
There must've been a code revision that I wasn't aware of, because the gateway setting on the main setup page is the router's upstream gateway IP address. News to me, but glad you got it sorted out.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Mon Mar 15, 2021 7:14    Post subject: Reply with quote
kernel-panic69 wrote:
There must've been a code revision that I wasn't aware of, because the gateway setting on the main setup page is the router's upstream gateway IP address. News to me, but glad you got it sorted out.


You are right that is still the case.

But this router maybe needs more instructions via the vendor class?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5705

PostPosted: Mon Mar 15, 2021 13:16    Post subject: Reply with quote
Maybe Gateway is static, or not DHCP, and vendorclass nocgnat determines which IP the ISP hands out?

Set vendorclass, request IP, what's that for?
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Mon Mar 15, 2021 14:20    Post subject: Reply with quote
The gateway field applies to both the router itself and connected clients. It's the main reason why certain configurations *require* that field to be populated with an ip address so ntp will sync. Some configurations also require an entry elsewhere in the webUI so things work. So, *unless* something changed in the way this is handled within the firmware, there technically should be no need to intervene with this added instruction, but it wouldn't surprise me at the same time that it is required.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5705

PostPosted: Mon Mar 15, 2021 14:36    Post subject: Re: Force default gateway with automatic DHCP Reply with quote
Veole wrote:
The ISP router was using Automatic DHCP but had a field called DHCP vendor class (or similar) called "nocgnat").
phuzi0n wrote:
The vendor class is something you define so that you can give your DHCP server parameters specific to the class. ie. you could use it to, say, give different DNS servers to a certain class.

The request IP option is pretty self explanatory, it specifies what IP address you want the router to ask for. DHCP servers have no obligation to honor your requested IP even if it is valid for their lease pool and available.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Mon Mar 15, 2021 15:03    Post subject: Reply with quote
Ok, so what is the vendor class that you use for each mode of operation to link routers, then...
since populating the gateway field on the main setup page is obviously wrong in all configurations...
obviously lol

The gateway field on the main setup page is not anything that is requested by the udhcpc client,
whatsoever. In other words, you're going off on a tangent that has nothing to do with the gateway
configuration field or how it works within the firmware, but hey, let's just keep hammering nails
after I already conceded Rolling Eyes Arrow

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
blkt
DD-WRT Guru


Joined: 20 Jan 2019
Posts: 5705

PostPosted: Mon Mar 15, 2021 15:16    Post subject: Reply with quote
I did not say basic setup gateway configuration is wrong, only static.

Sticking with OP, no tangent, DHCP vendor class is configured by ISP am I wrong?
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Mon Mar 15, 2021 15:40    Post subject: Reply with quote
I wasn't saying you were wrong and I already conceded to the point of the vendor class being required. Just keep hammering away if you must...
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Veole
DD-WRT Novice


Joined: 06 Oct 2018
Posts: 20

PostPosted: Mon Mar 15, 2021 16:30    Post subject: Reply with quote
blkt wrote:
Sticking with OP, no tangent, DHCP vendor class is configured by ISP am I wrong?


Yes, I think "nocgnat" is a custom ISP parameter for their own DHCP server (run trough the ONT).

I asked to leave cgnat and they don't use MAC filters like other ISPs, so cloning the old MAC or trying to add my new router MAC did not work. They used remote configuration for their router and enabled a field called DHCP 60 with parameter "nocgnat".

DHCP is always automatic. The nocgnat parameter makes the DHCP server connect the router to another gateway (I get WAN IP from a different private server). And I also have a different public IP, without any proxy.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum