Add a warning for disabled DHCP media sense on Window
When DHCP media sense configuration is disabled, network applications including DHCP client will not receive information about link status changes and the link seems to be always connected. This lead to the non-renewal DHCP address on OpenVPN connect.
DHCP media sense status can by shown with command "netsh interface ipv4 show global"
There are several reports of problems with DHCP address renewal. https://community.openvpn.net/openvpn/ticket/665 https://community.openvpn.net/openvpn/ticket/807
Added checking of disabled DHCP media sense and print a warning with forced dhcp-renew option and suggestion to enable DHCP media sense.
Signed-off-by: Jiří Engelthaler [email protected]
Thank you for your contribution
You are welcome to open PR, but they are used for discussion only. All patches must eventually go to the openvpn-devel mailing list for review:
- https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Please send your patch using git-send-email. For example to send your latest commit to the list:
$ git send-email [email protected] HEAD~1
For details, see these Wiki articles:
- https://community.openvpn.net/openvpn/wiki/DeveloperDocumentation
- https://community.openvpn.net/openvpn/wiki/Contributing
This report helped me perfectly.
Oh I see, this is not yet in the release. Anyway, thanks and I welcome it but am not an openvpn-devel member so this comment probably doesn't influence much.
Would be nice to have this merged.. Windows Server 2019 seems to have DhcpMediaSense disabled by default and we run into this problem!
Hi,
On Sun, Jul 07, 2019 at 04:22:50PM -0700, Spacefish wrote:
Would be nice to have this merged.. Windows Server 2019 seems to have DhcpMediaSense disabled by default and we run into this problem!
The place to get this done is on the openvpn-devel mailing list.
A v2 patch with the suggested changes, rebased to master, needs to be sent to the list for this to proceed.
gert
"If was one thing all people took for granted, was conviction that if you feed honest figures into a computer, honest figures come out. Never doubted it myself till I met a computer with a sense of humor." Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]
@selvanair do you think it is still meaningful to purse the solution provided in this PR? Or should we go with "dhcp_new" is always on? (saw your comments in https://community.openvpn.net/openvpn/ticket/665)
As argued in ticket 665 that you point out, I still believe its so much simpler to just always enable dhcp-renew when dhcp is in use. The alternative of throwing more code at settings like "dhcp-media-sense" is engaging in a never ending fight with Windows internals.
Ok, then we should go with the approach suggested by Selva and avoid further corner cases. This patch as-is is therefore obsolete.
If interested, please send a patch to the ml that enables dhcp-renew everytime dhcp is used.