OpenVPN dosen't put back def.gateway

Samples of working configurations.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

slupper
OpenVpn Newbie
Posts: 13
Joined: Tue Mar 24, 2015 2:53 pm

Re: OpenVPN dosen't put back def.gateway

Post by slupper » Tue Mar 31, 2015 10:08 pm

Can you elaborate on what you define "correctly" as?

I have set it up with a static ip, a netmask and the correct gateway. OpenVPN removes that gateway as it supposed to, but does not add it back correctly by not adding the -p switch

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: OpenVPN dosen't put back def.gateway

Post by Traffic » Tue Mar 31, 2015 10:15 pm

slupper wrote:its only when i restart the PC that it its not working and THEN i have to add the default gateway to tcp/ip
Configure windows with a default gateway :geek:
Last edited by Traffic on Tue Mar 31, 2015 10:19 pm, edited 1 time in total.

slupper
OpenVpn Newbie
Posts: 13
Joined: Tue Mar 24, 2015 2:53 pm

Re: OpenVPN dosen't put back def.gateway

Post by slupper » Tue Mar 31, 2015 10:19 pm

Its already configured with the correct def. gateway. I though I'd already written that a few times.


if you want specifics:
Computer: 10.0.0.5 mask 255.255.255.0 default gateway 10.0.0.1
Router: 10.0.0.1 255.255.255.0

Totally vanilla, plain simple config

slupper
OpenVpn Newbie
Posts: 13
Joined: Tue Mar 24, 2015 2:53 pm

Re: OpenVPN dosen't put back def.gateway

Post by slupper » Tue Mar 31, 2015 10:23 pm

... then i start openvpn and connect. If i then go to my TCP/IP settings, the default gateway has been removed (i assume as intended).

Then disconnect OpenVPN and it adds a route 0.0.0.0 0.0.0.0 10.0.0.1 which is correct.

After i restart windows that route has been flushen, and im left with no default gateway untill i add i manually.

I assume thats not working as intended.

- as i wrote earlier, it seems to me that OpenVPN need to close with:
route.exe ADD -p 0.0.0.0 MASK 0.0.0.0 10.0.0.1 and not route.exe ADD 0.0.0.0 MASK 0.0.0.0 10.0.0. as its doing now

slupper
OpenVpn Newbie
Posts: 13
Joined: Tue Mar 24, 2015 2:53 pm

Re: OpenVPN dosen't put back def.gateway

Post by slupper » Tue Mar 31, 2015 10:57 pm

I just did some testing.

route.exe ADD 0.0.0.0 MASK 0.0.0.0 10.0.0.1 will add the default route temporary while route.exe ADD -p 0.0.0.0 MASK 0.0.0.0 10.0.0.1 will add it permanently, so i assume it must be a bug in openVPN

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: OpenVPN dosen't put back def.gateway

Post by Traffic » Tue Mar 31, 2015 11:19 pm

slupper wrote:so i assume it must be a bug in openVPN
so report it ..

Regedit:
  • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Services\{your interface}\Parameters\Tcpip=DefaultGateway:?
You could also try this simple test (command prompt):
    • Reboot pc
      • Code: Select all

        ipconfig /all > defgw.txt  
        route print >> defgw.txt
    • Connect to VPN
      • Code: Select all

        ipconfig /all >> defgw.txt
        route print >> defgw.txt
    • Disconnect from VPN
      • Code: Select all

        ipconfig /all >> defgw.txt
        route print >> defgw.txt
    • post: defgw.txt

Post Reply