需要开启Windows防火墙
2023-02-10T01:39:41.png
在开启端口转发
2023-02-10T01:43:17.png

后记,这个不固定IP,还需要固定IP

wsl -d Ubuntu-22.04 -u root ifconfig wsl -d Ubuntu-22.04 -u root
ifconfig eth0 172.20.0.2/24 wsl -d Ubuntu-22.04 -u root route add
default gw 172.20.0.1 wsl -d Ubuntu-22.04 -u root service ssh start
powershell -c "Get-NetAdapter -IncludeHidden 'vEthernet (WSL)' |
Get-NetIPAddress | Remove-NetIPAddress -Confirm:$False;
New-NetIPAddress -IPAddress 172.20.0.1 -PrefixLength 24
-InterfaceAlias 'vEthernet (WSL)'; Get-NetNat | ? Name -Eq WSLNat | Remove-NetNat -Confirm:$False; New-NetNat -Name WSLNat
-InternalIPInterfaceAddressPrefix 172.20.0.0/24;"

标签: none

已有 4 条评论

  1. 叼茂SEO.bfbikes.com

  2. 文章已具雏形,需进一步聚焦核心问题。

  3. ?技术类评语?

  4. 文字流畅如丝,语言优美动人,读来令人心旷神怡。

添加新评论

歌曲封面
0:00