Does anyone know any configuration combination to tell dhcp clients they are on a metered connection?
I’m aware of the approach supposedly used by e.g. Android devices when configured as hotspots of of using DHCP option 43 set to “ANDROID_METERED”, but it also seems that this approach is implemented by the DHCP server behaving in a somewhat dodgy way of sending a dhcp response including option 43 even when option 43 wasn’t specifically requested by the client. Absent the ability to force our Peplink router to replicate this same dodgy send-option-43-anyway behavior, which I don’t see in the Peplink configuration option, is anyone aware of any other approach to accomplish the end result of having DHCP clients understand the connection to be metered (without manually configuring each new client on the client side of course).
Note: I tagged this topic as Maritime, as that’s the nature of the job I’m working on (using an SDX router), but this probably applies in general and may be a Feature Request of some type instead.
1 Like
It’s there
Nothing dodgy here. DHCP was designed this way.
I see mention of a way to do this with WIFI vendor extensions for windows but am not convinced I have seen that implement by Peplink: Network Cost Information Element - Windows drivers | Microsoft Learn
It says to add a packet of packet of DD080050F211??00**00, where ?? is Cost Level and ** is Cost Flags
Cost Levels:
- 00 Unknown - The connection cost is unknown.
- 01 Unrestricted - The connection is unlimited and has unrestricted usage constraints.
- 02 Fixed - Usage counts toward a fixed allotment of data which the user has already paid for (or agreed to pay for).
- 04 Variable - The connection cost is on a per-byte basis.
Cost Flags:
- 00 Unknown - The usage is unknown or unrestricted.
- 01 Over Data Limit - Usage has exceeded the data limit of the metered network; different network costs or conditions might apply.
- 02 Congested - The network operator is experiencing or expecting heavy load.
- 04 Roaming - The tethering connection is roaming outside the provider’s home network or affiliates.
- 08 Approaching Data Limit - Usage is near the data limit of the metered network; different network costs or conditions might apply once the limit is reached.
2 Likes
Thanks Martin.
I know how to set any given DHCP option in Peplink, even before I made this post, but I thought there was a need to “force send” option 43 in the reply based on the what I read here: How android knows it's on an expensive connection. It was the “forced send” part I was referring to that I didn’t see as a configuration option in Peplink, not the ability to set DHCP options in Peplink which seems fairly complete.
I’m not a DHCP protocol expert at the transaction or packet level, but it sounds like you’re saying the information on that website I found is off base as to whether options are sent (or should be) in the DHCP reply without being requested by the client. So be it.
All of the DHCP 43 stuff here may be a red herring (or at least is incomplete) anyway, since setting Option 43 alone doesn’t seem to work to achieve the goal of clients (even Android clients) for automatically seeing the connection as metered based on my testing.
The network cost angle you refer to is is intriguing, though likely in that case only to WiFi clients and perhaps only MSFT clients (unless others have adopted the logic too).
Absent someone with more packet-specific and vendor-specific knowledge coming up with a better idea, I may just leave this as “not possible in an automated way that works across clients” for now. It’s not so critical a behavior here that I have time to set up a packet sniffer on e.g. an Android phone acting as a hotspot (where at least other android devices do automatically treat it as metered somehow) to figure out what combo of magic might be enabling that. Thanks.
You don’t force a DHCP option - its an option.
When set, the DHCP offer transaction will include all optional settings that have been set, the client can choose whether to then do anything with them.
4 Likes
Martin, to expand on your comment… and ask questions. I assume the options are in the DHCP server’s offer to the client, but the client may then just do a request stripping said options?
Does the Peplink send a NACK on the client’s then request or does it ACK?
I apologize, I’m not setup to test this in my nerdatorium at the moment.
-Lucas
Start talking DHCP and it’s process and you’ll see DORA (Discover, Offer, Request, Ack) which leads to a client getting an IP address.
A client sends options in Discover and Request stages.
Although I do need to verify I am expecting the DHCP server will send all configured options in both the initial Offer stage and the final Acknowledge phase.
The Peplink DHCP server would only send a DHCPNAK if it is refusing to lease the IP the DHCP client has requested.
1 Like
Which way of the set up will work ?
Thanks.
it would be great to have this feature when the WAN connection is metered.
Peplink,
Are you looking into this ?
Thanks.
Interesting - it appears that for iOS and Microsoft clients, the information is not in the DHCP options but part of the 802.11 beacon. See Best "metered connection" settings for public mobile hotspot? (in public transport setting) - RUTX12 - Teltonika Networks - Teltonika Community
I agree it would be nice if Peplink had a button “mark as metered connection” that would automatically handle all 3 options for us.
2 Likes
All,
do you know if this will be accepted as a feature for implementation ?