Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with suffix search order and lost connections #190

Closed
diehard2 opened this issue Feb 26, 2023 · 1 comment
Closed

Issues with suffix search order and lost connections #190

diehard2 opened this issue Feb 26, 2023 · 1 comment

Comments

@diehard2
Copy link

Hi, wsl-vpnkit is working pretty well. However, my connection will stop working after several hours or a VPN reconnect (GlobalProtect 6.0.3-38). Additionally I don't have domain suffix search. Not sure if there's any way to make this more seamless in wsl-vpnkit, but maybe this will help other people if it can't be built in.

#!/bin/bash

myarray=( $( /mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0//powershell.exe -Command "Get-DnsClientServerAddress -AddressFamily ipv4 | Select-Object -ExpandProperty ServerAddresses") )

mysuffixlist=$(/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command "(Get-DnsClientGlobalSetting | Select-Object -ExpandProperty SuffixSearchList) -join ' '")

echo "search ${mysuffixlist}" > /mnt/wsl/resolv.conf

for i in "${myarray[@]}"
do
    :
    echo "nameserver $i" >> /etc/resolv.conf
done

dos2unix /mnt/wsl/resolv.conf

Note that it has to be run as root

@sakai135
Copy link
Owner

@diehard2 Could you take a look at the wsl-vpnkit log files and see if there are any info related to it not working on a VPN reconnect?

The domain suffix search is an issue with normal WSL2 as well, which you can follow at microsoft/WSL#701.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants