ros 端口分流
ros 3.0 端口分流
实例:现在网吧有2条线,一条12M,一条8M,决定进行端口分流,80端口走12M线(网页视频等),其他走8M(游戏等)账号设置这里不说了
主要是80端口分流
先做路由标记,如下图:
/ip firewall mangle
add action=mark-routing chain=prerouting comment="端口分流" disabled=no dst-port=\
80 new-connection-mark=80_route passthrough=yes protocol=tcp
后设置路由
/ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=80_route check-gateway=ping
#如果你是ADSL动态IP和动态网关,请用动态脚本改变,注意修改红色部分
:global assignaddress
:global newaddress
:global status
:set status [/interface get [/interface find name=pppoe-out1] running]
:if ($status=true) do={
:set newaddress [/ip address get [/ip address find dynamic=yes interface=pppoe-out1] network]
:set assignaddress [/ip route get [/ip route find routing-mark="80_route"] gateway]
:if ($assignaddress != $newaddress) do={
/ip route set [/ip route find routing-mark=80_route] gateway=$newaddress
}
目录 返回
首页