Opened 4 years ago
Last modified 4 years ago
#875 new Bug / Defect
ERROR: netsh command failed: returned error code 1
Reported by: | hildeb | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Generic / unclassified | Version: | OpenVPN 2.4.0 (Community Ed) |
Severity: | Not set (select this one, unless your'e a OpenVPN developer) | Keywords: | 2.4.1 netsh.exe |
Cc: | Selva Nair |
Description
I haven't seen this bug before. Connection is being established, but in the end I'm getting:
Thu Apr 13 15:23:43 2017 NETSH: C:\Windows\system32\netsh.exe interface ip set address LAN-Verbindung 3 dhcp
Thu Apr 13 15:23:43 2017 ERROR: netsh command failed: returned error code 1
Three times ("LAN-Verbindung 3" meaning "LAN Connection 3" in english). Whole log attached.
Attachments (1)
Change History (4)
Changed 4 years ago by
Attachment: | charite-mgojowy.log added |
---|
comment:1 Changed 4 years ago by
Cc: | Selva Nair added |
---|
You have a knack for finding interesting (and well-hidden) spider-webs... :-)
This code is run if OpenVPN notices that the tap adapter is not set to use DHCP, to re-enable DHCP (and then poke the to-be-set IP address into the TAP adapter, so it can play DHCP server).
Without checking very closely, I assume that openvpn is run with interactive service, so openvpn.exe does not have the necessary privileges to do what it tries, and thus fails. (I dimly remember that we've had this before in another ticket, but can't remember the details... @selva, can you?)
comment:2 Changed 4 years ago by
Yes, this has to be due to dhcp disabled in the adapter and openvpn started using interactive service. As @cron2 said, it did come up in the past: See Trac #823
As suggested there we better implement dhcp mode setting through interactive service. Though not relevant here, also mutate --ip-win32 netsh to ipapi so that a run as admin with that option will not disable dhcp.
As a quick fix, set the adapter to use dhcp and reconnect:
netsh.exe int ip set addr "LAN-Verbindung 3" dhcp
from an elevated cmd prompt will do it.
Log file