如何让容器/进程不走代理

5202 年了, 还有人不会...根本不需要 macvlan

0. 创建一个用户

useradd -u 8964 xxx

usermod -aG sudo xxx

id xxx


以二进制版 snell-server 为例

1. 编辑 /etc/systemd/system/snell-server.service 里的 User

[Service]
User=xxx


2. 重启

systemctl daemon-reload
systemctl restart snell-server


3. 检查

ps -eo user,group,uid,gid,comm | grep snell
ps -u 8964


以容器版 snell-server 为例

1. 配置容器

user: 8964:8964


2. 检查

ps -eo user,group,uid,gid,comm | grep snell
ps -u 8964


以容器版 qBittorrent 为例

1. 配置容器

environment:
  - UID=8964
  - GID=8964


3. mihomo 配置参考, sing-box 同理
tun:
  exclude-uid: [8964]

重载配置/重启

4. 检查

ps -eo user,group,uid,gid,comm | grep qbittorrent
ps -u 8964


频道资源合集 恰饭推荐 群组

#代理 #容器 #配置 #服务 #TUN #mihomo #singbox #docker #绕过 #exclude #uid