Add WSL doc
This commit is contained in:
parent
bed0810a72
commit
a1db584b8f
34
wsl/README.md
Normal file
34
wsl/README.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
## Force DNS Usage inside VPN
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cat /etc/systemd/system/vpn-dns.service
|
||||||
|
[Unit]
|
||||||
|
Description=VPN DNS Configuration
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/bin/vpn-dns.sh
|
||||||
|
Environment=TERM=xterm
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cat /bin/vpn-dns.sh
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Getting current DNS servers, this takes a couple of seconds"
|
||||||
|
|
||||||
|
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '
|
||||||
|
$ErrorActionPreference="SilentlyContinue"
|
||||||
|
Get-NetAdapter -InterfaceDescription "WireGuard Tunnel*" | Get-DnsClientServerAddress | Select -ExpandProperty ServerAddresses
|
||||||
|
Get-NetAdapter | ?{-not ($_.InterfaceDescription -like "WireGuard Tunnel*") } | Get-DnsClientServerAddress | Select -ExpandProperty ServerAddresses
|
||||||
|
' | \
|
||||||
|
awk 'BEGIN { print "# Generated by vpn fix func on", strftime("%c"); print } { print "nameserver", $1 }' | \
|
||||||
|
tr -d '\r' > /etc/resolv.conf
|
||||||
|
clear
|
||||||
|
```
|
||||||
|
### Show Networks
|
||||||
|
|
||||||
|
c/> Get-NetAdapter
|
Loading…
x
Reference in New Issue
Block a user