princeofwales
V2EX  ›  服务器

求个 iptables 规则

  •  
  •   princeofwales · Oct 25, 2016 · 2782 views
    This topic created in 3493 days ago, the information mentioned may be changed or developed.
    背景:
    OpenWRT 路由器, 192.168.1.1 ,装了 adbyby 软件,代理的端口为 8118
    内网小米盒子,固定 IP , 192.168.1.2

    目标:
    小米盒子通过 adbyby 的代理访问外面的视频,即将访问 *:80 的连接,都通过 192.168.1.1:8118 出去

    问题:
    厂家给了个全局代理的规则 iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118
    但我不希望局域网内的其他设备也走这个代理,毕竟路由器的性能有限,且 PC 上过滤广告早有其他成熟方案
    4 replies    2016-10-26 00:35:29 +08:00
    20150517
        1
    20150517  
       Oct 25, 2016
    iptables -t nat -A PREROUTING -p tcp -s 192.168.1.2 --dport 80 -j REDIRECT --to-ports 8118
    20150517
        2
    20150517  
       Oct 25, 2016
    btw 什么叫厂家给了全局代理规则,是什么厂家啊
    princeofwales
        3
    princeofwales  
    OP
       Oct 25, 2016
    @20150517 谢谢,我试试,厂家就是指的 adbyby.com (广告屏蔽大师)
    20150517
        4
    20150517  
       Oct 26, 2016
    @princeofwales 没事,我在家弄过这个,不过我是为了给小米逆向翻墙到国内
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4266 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:14 · PVG 08:14 · LAX 17:14 · JFK 20:14
    ♥ Do have faith in what you're doing.