Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Connect VPN

  2. In admin powershell:
    2.1 Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 1000
    2.2 Get-NetIPInterface | where {$.InterfaceAlias -eq 'Wi-Fi' -or $.InterfaceAlias -eq 'Ethernet 2' -or $.InterfaceAlias -eq 'vEthernet (WSL)'} | Set-NetIPInterface -Forwarding Enabled -Verbose
    2.3 Verify by running Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding,InterfaceMetric | Sort-Object -Property IfIndex | Format-Table check that forwarding is enabeled on wsl/wifi/anyconnect (Ethernet 2)

  3. In Linux shell:
    3.1 sudo bash -c "printf '[network]\ngenerateResolvConf = false' " > /etc/wsl.conf
    3.2 sudo rm /etc/resolv.conf
    3.3 Add in ~/.bashrc:

    1. alias vpn_off="sudo bash -c "printf 'nameserver 8.8.8.8' > /etc/resolv.conf""

    2. alias vpn_on="sudo bash -c "printf 'nameserver 172.16.254.82\nnameserver 172.16.254.247' > /etc/resolv.conf""

...