第一种
宿主机unRAID网关走的clash代理。
qbittorrent下载希望能绕过
翻找了许多案例,最终参考
qBittorent 直连配置方法
的方法
version: "3.5"
services:
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Shanghai
- WEBUI_PORT=8889
- TORRENTING_PORT=6881
volumes:
- /mnt/user/appdata/qbittorrent/config:/config
- /mnt/user/downloads:/downloads
ports:
- 8889:8080
- 6881:6881
- 6881:6881/udp
networks:
pt_network:
ipv4_address: 192.168.0.212
restart: unless-stopped
networks:
pt_network:
driver: macvlan
driver_opts:
parent: br0
ipam:
config:
- subnet: 192.168.0.0/24
gateway: 192.168.0.1 # 容器专用网关
ip_range: 192.168.0.210/28
# 若无需 IPv6,可删除以下部分
#- subnet: fd0d:7eb5:2afd::/64
#- gateway: fd0d:7eb5:2afd::1
移除旧的qBittorent,重命名config文件夹
待compose拉取部署完成后再停止容器,将旧的qBittorent下列表文件复制到新的文件夹里头。
下载做种列表存在 BT_backup
文件夹中。
第二种
搞了一台双网口的设备做测试,插上两个网线。
eth0,ip192.168.0.135 系统默认使用,走的代理网关192.168.0.254
eth0,ip192.168.0.136 准备给qBittorent使用用于下载,不走代理,网关192.168.0.1
设置好后保存。
来到docker设置里,Docker自定义网络类型选了ip vlan,不要选macvlan不是很懂,没搞成。
然后蓝色框部分不要启用!!!开启后docker选择网络会失败,不知道什么原因,没有深究。
设置好后保存。
启动阵列。
来到终端页面或者使用ssh工具,创建一个网络pt_network,名字随便取。
docker network create -d macvlan \
--subnet=192.168.0.0/24 \
--gateway=192.168.0.1 \
--ip-range=192.168.0.128/26 \ #ip范围
-o parent=brX \ #这个X是桥接的网口
pt_network
检查网络
docker network inspect pt_network | grep -A 10 IPAM
OK创建网络完成。
开始创建docker容器,并选择使用刚刚创建的网络。
注意固定ip范围
安装完后正常运行。
进入容器终端验证一下:
docker exec -it qbittorrent sh
查看路由表(网关即 default 对应的 IP):
ip route show
或:
bash
route -n
输出示例:
default via 192.168.0.1 dev eth0 # 网关是 192.168.0.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.132
OK大功告成~
保险起见再去猫咪里面把该ip添加到黑名单。
评论 (0)