ros pcc配置方法
给大家说下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
/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
评论: