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

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
N
News and Events Feed by Topic
H
Hacker News: Front Page
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
SecWiki News
SecWiki News
N
News | PayPal Newsroom
T
Tor Project blog
W
WeLiveSecurity
A
Arctic Wolf
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Secure Thoughts
月光博客
月光博客
AWS News Blog
AWS News Blog
D
Docker
C
CERT Recently Published Vulnerability Notes
MyScale Blog
MyScale Blog
Google Online Security Blog
Google Online Security Blog
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
I
InfoQ
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
Recorded Future
Recorded Future
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
D
DataBreaches.Net
S
Security Affairs
WordPress大学
WordPress大学
T
Threatpost
Microsoft Security Blog
Microsoft Security Blog
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
B
Blog RSS Feed
Project Zero
Project Zero
P
Proofpoint News Feed

yyhhyyyyyy

Surge for Mac 配置教程:自用配置详解与 iOS 版差异 Surge for iOS 配置教程:自用配置文件逐段详解(General / 策略组 / 规则) Mac小企鹅输入法+雾凇拼音配置指南:从安装到同步 Winodws 双网卡实现内外网分流 VSCode 配置Ruff Cursor修改垂直布局 Clash Party/Clash Verge Rev/Sparkle 覆写与扩展脚本指南 Mihomo 配置教程:从零写一份完整配置文件(DNS / TUN / 分流规则详解) TUN 模式详解:System / gVisor / Mixed 三种堆栈的区别与选择 解决MoviePy保存视频时的视频质量降低问题 Tailscale+Headscale+自建Derp踩坑记录 解决Moviepy剪辑视频画面卡帧,但有声的问题 Surge Or Mihomo通过WireGuard回家 重装系统 -- Windows11 Win10/11配置fnm:解决PowerShell脚本运行受限问题 Ai 原画系统 基于社交媒体大数据的智慧政务系统 Miniconda安装教程 Doker-compose 网络互通 建立菲律宾台风损害模型
解决 WSL2 与 Tunnel 模式网络冲突:MTU 设置妙招
yyhhyyyyyy · 2024-09-26 · via yyhhyyyyyy

1. 起因

最近由于条件问题,没法使用公司服务器,但是部署dify的最佳条件是在Linux上,本来想继续沿用我以前的做法,装VMware。后面了解到有WSL这一虚拟机,因此决定使用其作为部署dify的设备。且dify又得内网都能使用,这边参考了一篇blog,因此只能使用WSL2的镜像模式了。附上.wslconfig配置:

[experimental]
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true
hostAddressLoopback=true

2. 具体问题

我的Windows本机是常年开启mihomo的,并且我也经常使用的是tunnel模式。但是我发现,一旦我开启tunnel模式,WSL2里面的网络环境就会异常,基本上就是处于无法上网的情形。看了不少文章,说改stackgVisor就行,然而实际测试下来是不行的。

3. 解决方案

只需要在mihomo中的tun部分的mtu改成1500即可

tun:
  enable: true
  stack: system
  device: utunmiho
  dns-hijack:
    - any:53
    - 'tcp://any:53'
  auto-route: true
  auto-detect-interface: true
  strict-route: true
  mtu: 1500

至此 问题直接迎刃而解,具体缘由不太清楚,后续如果有深入再做补充,也请有相关经验的朋友给予帮助~