Can not connect to WSL2 ubuntu from windows 11 localhost

세규 황 0 Reputation points
2024-02-26T09:45:24.48+00:00

I try to make connection from wsl2 ubuntu to Windows 11. I install the apache flink on wsl2 ubuntu and installation is successful. As you know the port number of flink is 8081 , so I open the port number on wsl2 ubuntu like below,

$ sudo ufw allow 8081/tcp

And I find the ip address of WSL2 ubuntu with ifconfig command.

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.138.190  netmask 255.255.240.0  broadcast 172.18.143.255
        inet6 fe80::215:5dff:fe01:6dbc  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:01:6d:bc  txqueuelen 1000  (Ethernet)
        RX packets 11  bytes 1735 (1.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 17  bytes 1212 (1.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Then, I execute the following command on windows terminal as administrator mode,

> netsh interface portproxy add v4tov4 listenport=8081 listenaddress=0.0.0.0 connectport=8081 connectaddress=172.18.138.190

And I also make inbound rule of windows firewall which allow the 8081 port. The reference is here. But localhost:8081 on web browser on windows 11 bring no response. Do I miss some another step? Any reply will be deeply grateful.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
11,149 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.