记录日常工作关于系统运维,虚拟化云计算,数据库,网络安全等各方面问题。
 
0

ros 端口分流

发表者:分类:网络安全2013-10-28 21:55:03 阅读[2794]

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
}

转载请标明出处【ros 端口分流】。

《www.micoder.cc》 虚拟化云计算,系统运维,安全技术服务.

网站已经关闭评论