让IPv6下qBittorrent-nox的速度起飞

#docker #qbittorrent #network

宽带快到期,续费的时候被告知之前的动态公网 IP 续费后就回收了。现在也开不了。如果想开请去营业厅签协议并多交 ¥600 。滚犊子!折腾下IPv6 配置 qbittorrent。还好顺利搞定,不然就准备换宽带运营商了。

路由器开启IPv6

1️⃣ 开 Native IPv6 2️⃣ 选 PPP 3️⃣ 启用 DHCP-PD 4️⃣ 看是否拿到 非 fe80:: 地址

只要你在电脑或 BT 客户端里看到非 fe80:: 的 IPv6, 就等于你已经绕过 CGNAT 了。

qBittorrent-nox 的docker-compose.yml

Docker 里的 qBittorrent nox,network_mode: host这是跑 BT / PT 的标准解法

docker-compose 示例

services:
  qbittorrent-nox:
    image: qbittorrentofficial/qbittorrent-nox:latest
    container_name: qbittorrent-nox

    # ⭐ 核心:使用宿主机网络
    network_mode: host

    environment:
      - PGID=1000
      - PUID=1000
      - QBT_LEGAL_NOTICE=confirm
      - QBT_WEBUI_PORT=8080
      - TZ=Asia/Shanghai
      - UMASK=000

    read_only: false
    stop_grace_period: 30m
    tmpfs:
      - /tmp
    tty: true
    volumes:
      - ${QBT_CONFIG_PATH}:/config
      - ${QBT_DOWNLOADS_PATH}:/downloads
    restart: unless-stopped
    depends_on:
      - wait-service

  wait-service:
    image: busybox
    command: sleep 30

UFW防火墙配置

开启UFW,把qbittorrent中固定的端口(6881)放行。给内网网段开放所以端口

$ sudo ufw status
[sudo] password for yangpeiyuan: 
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  
6881/tcp                   ALLOW       Anywhere                  
6881/udp                   ALLOW       Anywhere                  
8080/tcp                   ALLOW       192.168.1.0/24            
Anywhere                   ALLOW       192.168.1.0/24            
22/tcp (v6)                ALLOW       Anywhere (v6)             
6881/tcp (v6)              ALLOW       Anywhere (v6)             
6881/udp (v6)              ALLOW       Anywhere (v6)  

Conclusion

第一次搞 ipv6 ,很多概念都不是很了解。幸好现在有 AI,不厌其烦的给出解答。最终磁力链速度稳稳的 >10Mb/s