请选择 进入手机版 | 继续访问电脑版

Blog.rosdns.cn 艾丝信息科技

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2099|回复: 0

指定IP走指定的出口线路

[复制链接]
发表于 2016-11-15 10:10:52 | 显示全部楼层 |阅读模式
指定IP走指定的出口线路
/ip firewall mangle
add action=mark-routing chain=prerouting comment=ALLtoWAN2 !connection-bytes !connection-limit \
    !connection-mark !connection-nat-state !connection-rate !connection-state !connection-type \
    !content disabled=no !dscp !dst-address !dst-address-list !dst-address-type !dst-limit \
    !dst-port !fragment !hotspot !icmp-options !in-bridge-port !in-bridge-port-list !in-interface \
    !in-interface-list !ingress-priority !ipsec-policy !ipv4-options !layer7-protocol !limit log=\
    no log-prefix="" new-routing-mark=router2 !nth !out-bridge-port !out-bridge-port-list \
    !out-interface !out-interface-list !p2p !packet-mark !packet-size passthrough=yes \
    !per-connection-classifier !port !priority !protocol !psd !random !routing-mark !routing-table \
    !src-address src-address-list=NATOB !src-address-type !src-mac-address !src-port !tcp-flags \
    !tcp-mss !time !ttl

/ip firewall address-list
add address=10.0.0.0/24 disabled=no list=NATOB
#10.0.0.0/24 修改成你自己需要指定走第二条线路的IP地址列表。

/ip route
add !bgp-as-path !bgp-atomic-aggregate !bgp-communities !bgp-local-pref !bgp-med !bgp-origin \
    !bgp-prepend !check-gateway disabled=no distance=10 dst-address=0.0.0.0/0 gateway=\
    61.160.0.1 !route-tag routing-mark=router2 scope=30 target-scope=10

#61.160.0.1 修改成你的ISP的第二条线路的网关即可。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|nowcc.cn ( 苏ICP备16033176

GMT+8, 2021-2-27 03:27 , Processed in 0.028903 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表