跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • deluge on docker 如何绕开旁路由 gateway?
未分類
28 12 月 2020

deluge on docker 如何绕开旁路由 gateway?

deluge on docker 如何绕开旁路由 gateway?

資深大佬 : jemyzhang 0

昨天折腾了一天,tracker 报错说是 invalid port,后来猛然发现是因为本机过了 clash 旁路由,但是 docker 好像不支持指定 gateway,host 方式如果用 route 设置就会同时改主机的,bridge 方式试了一下改 default gateway 就不能联网了。
不知道 iptables 能不能搞定这件事情,看看大侠有没有比较简单完美的解决方案。
大佬有話說 (3)

  • 資深大佬 : rrfeng

    bridge 肯定可以的。

  • 主 資深大佬 : jemyzhang

    @rrfeng 怎么玩,能不能给点方法或者例子?

  • 資深大佬 : whitegerry

    @jemyzhang 有个相反的需求,指定 gitea 容器走 clash 旁路由,用了 redsocks,192.168.100.2 是旁路,你这个需求类似的办法应该也行

    docker
    “`
    networks:
    gitea-net:
    driver_opts:
    com.docker.network.bridge.name: br_gitea
    “`

    iptables
    “`
    iptables -t nat -N REDSOCKS
    iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
    iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
    iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
    iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
    iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
    iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
    iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN
    iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
    iptables -t nat -A REDSOCKS -p tcp -j REDIRECT –to-ports 12345
    iptables -t nat -A PREROUTING -i br_gitea -j REDSOCKS
    “`

    redsocks.conf
    “`
    redsocks {
    local_ip = 0.0.0.0;
    local_port = 12345;

    ip = 192.168.100.2;
    port = 7891;
    type = socks5;
    }
    “`

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具