ros pcc配置方法

post by rocdk890 / 2013-10-7 21:41 Monday 网络技术
  给大家说下ros的pcc配置方法,我的环境是ros3.3,外网网卡是3个,大家自己做好adsl的拨号,这个就不用说了,我们只看怎么做pcc,高手可以忽略这篇文章了,方法如下:
/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=1440 protocol=tcp tcp-flags=syn
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses:3/0 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses:3/1 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=3 passthrough=yes per-connection-classifier=both-addresses:3/2 src-address=192.168.1.0/24
add action=mark-routing chain=prerouting  connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting  connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting  connection-mark=3 disabled=no new-routing-mark=3 passthrough=yes src-address=192.168.1.0/24
/ip route
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=1
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=2
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=3

/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out3
或者也可以使用下面的方法:
/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=1440 protocol=tcp tcp-flags=syn
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out1 new-connection-mark=1 passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out2 new-connection-mark=2 passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out3 new-connection-mark=3 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=3 disabled=no new-routing-mark=3 passthrough=yes
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses:3/0 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses:3/1 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=3 passthrough=yes per-connection-classifier=both-addresses:3/2 src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=3 disabled=no new-routing-mark=3 passthrough=yes src-address=192.168.1.0/24

/ip route
add comment=adsl1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=1
add comment=adsl2 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=2
add comment=adsl3 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=3
add check-gateway=ping comment=adsl1 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out1
add check-gateway=ping comment=adsl2 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out2
add check-gateway=ping comment=adsl3 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out3

/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out3
夜空- 本站版权
1、本站所有主题由该文章作者发表,该文章作者与夜空享有文章相关版权
2、其他单位或个人使用、转载或引用本文时必须同时征得该文章作者和夜空的同意
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
4、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
5、原文链接:blog.slogra.com/post-461.html

标签: 配置 负载均衡 ros pcc adsl

评论: