In my wsl2 ubuntu 22.04 in Windows 10
:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:f7:3c:a0 brd ff:ff:ff:ff:ff:ff
inet 172.27.139.188/20 brd 172.27.143.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fef7:3ca0/64 scope link
valid_lft forever preferred_lft forever
:~$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.27.128.1
:~$ ping 172.27.128.1
PING 172.27.128.1 (172.27.128.1) 56(84) bytes of data.
^C
--- 172.27.128.1 ping statistics ---
186 packets transmitted, 0 received, 100% packet loss, time 192400ms
I added nameserver 8.8.8.8 into /etc/resolve.conf and it works for public network. However, I still can't access the commany internal server via VPN or in office.
I also tried changed the vEthnet(wsl) setting or add inbound firewall rules still doesn't work.