惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
小众软件
小众软件
博客园 - 【当耐特】
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
H
Help Net Security
博客园_首页
P
Proofpoint News Feed
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
爱范儿
爱范儿
MyScale Blog
MyScale Blog
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News

博客园 - LungGiyo

Windows Codex 桌面版与 VSCode Codex 双账号隔离教程 frp 教程 nginx 跨域解决 001 nvm 管理不同版本的 node 与 npm 关于IP送中的影响和解决办法 Antigravity google ai 接入高德MCP 1.3.2 git使用ssh密钥 连接远程仓库 dynadot域名 托管到cloudflare , 使用cloudflare 的CDN功能 003 二进制日志-binlog Django 项目开发整体步骤(0 开始)+进阶 磊科N60Pro刷机 uni的页面解析 前端技术知识扫盲篇 使用 Lucky 为群晖 / 极空间 NAS 全服务启用 HTTPS 安全访问 00 docker 命令总结 001 Python 基础 麒麟系统升级openssh至openssh-10.0p1 零信任访问控制系统aTrust 蓝屏 Python PyInstaller 打包、Pyarmor加密等 001 安装wsl 2 && 开启 WSL2 Oxidized的model
001 局域网其他电脑也能访问wsl服务
LungGiyo · 2026-03-11 · via 博客园 - LungGiyo

问题:

比如我在wsl启动了:http://127.0.0.1:8000

但是局域网的其他人需要访问。

解决法:

Windows 做端口转发 

1)先在 WSL 里查当前 IP

lung@DESKTOP-3KOOMNE:~$ hostname -I
172.26.39.18
lung@DESKTOP-3KOOMNE:~$

2)Windows 管理员 PowerShell 添加端口转发

把 172.26.39.18 换成你的 WSL IP:

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8000 connectaddress=172.26.39.18 connectport=8000

查看是否添加成功:

netsh interface portproxy show all

Windows 防火墙规则:

netsh advfirewall firewall add rule name="WSL Django 8000 TCP" dir=in action=allow protocol=TCP localport=8000
netsh advfirewall firewall add rule name="WSL Django 8000 UDP" dir=in action=allow protocol=UDP localport=8000
netsh advfirewall firewall show rule name="WSL Django 8000 TCP"