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)

charite-mgojowy.log (5.5 KB) - added by hildeb 4 years ago.
Log file

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by hildeb

Attachment: charite-mgojowy.log added

Log file

comment:1 Changed 4 years ago by Gert Döring

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 Selva Nair

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.

comment:3 Changed 4 years ago by tincantech

CC

Note: See TracTickets for help on using tickets.