V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
muziling
V2EX  ›  OpenWrt

openwrt 上用 mark 标记数据包,然后根据标记走路由怎么做

  •  
  •   muziling · Aug 11, 2018 · 1277 views
    This topic created in 2818 days ago, the information mentioned may be changed or developed.
    比如创建了一个
    create chnroute hash:net

    然后执行
    echo "200 tinyfecvpn" >> /etc/iproute2/rt_tables
    iptables -t mangle -I PREROUTING -m set ! --match-set chnroute dst -j MARK --set-mark 8
    ip rule add fwmark 8 table 200
    ip route add default dev tun100 table 200
    ip route flush cache

    最终用 wget www.google.com 测试,并不会走标记的 tun100 网络,
    是不是哪里不正确。折腾了半天没弄出来。
    2 replies    2018-10-28 13:43:48 +08:00
    LGA1150
        1
    LGA1150  
       Aug 20, 2018
    你在路由器上做的 wget ?
    Frost
        2
    Frost  
       Oct 28, 2018
    https://github.com/lifetyper/FreeRouter_V2

    推荐看里面写的一个小册子
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1228 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 17:39 · PVG 01:39 · LAX 10:39 · JFK 13:39
    ♥ Do have faith in what you're doing.