ROS5.24负载均衡、静态路由.doc

上传人:cn****1 文档编号:560244837 上传时间:2022-12-22 格式:DOC 页数:3 大小:33KB
返回 下载 相关 举报
ROS5.24负载均衡、静态路由.doc_第1页
第1页 / 共3页
ROS5.24负载均衡、静态路由.doc_第2页
第2页 / 共3页
ROS5.24负载均衡、静态路由.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《ROS5.24负载均衡、静态路由.doc》由会员分享,可在线阅读,更多相关《ROS5.24负载均衡、静态路由.doc(3页珍藏版)》请在金锄头文库上搜索。

1、网卡1lan1网卡2wan1网卡3wan2因ROS的LAN口流量较大,需要使用较好的网卡(PCI的可以,USB的有问题)拨号上网设置网卡别名/interface set 0 name=eth1-lan/interface set 1 name=eth2-wan/interface set 2 name=eth3-wan/interface enable 0/interface enable 1/interface enable 2设置接口地址/PPPOE,并去除add default route选项/ip address add interface=lan1 address=192.168.3

2、1.1/24/interface pppoe-client add interface=eth2-wan name=pppoe-out1 user=*4 password=*/interface pppoe-client add interface=eth3-wan name=pppoe-out2 user=*3 password=*/interface pppoe-client enable pppoe-out1/interface pppoe-client enable pppoe-out2设置firewall做NAT转换/ip firewall nat add chain=srcnat

3、action=masquerade out-interface=pppoe-out1add chain=srcnat action=masquerade out-interface= pppoe-out2标记连接和路由提取第一条线路的连接标记取名为conn1,并从连接里提取路由标记名为route1,设置:per-connection-classifier=both-addresseses:2/0,设置in-interface=lan1/ip firewall mangleadd action=mark-connection chain=prerouting comment=” disable=

4、no in-interface=eth1-lan new-connection-mark=conn1 passthrough=yes per-connection-classifier=both-addresses:2/0 dst-address-type=!localadd action=mark-routing chain=prerouting comment=” connection-mark=conn1 disabled=no in-interface=eth1-lan new-routing-mark=route1 passthrough=yes提取第二条线路的连接标记取名为conn

5、2,并从连接里提取路由标记名为route2,设置:per-connection-classifier=both-addresseses:2/1,设置in-interface= lan1/ip firwall mangleadd action=mark-connection chain=prerouting comment=” disable=no in-interface=eth1-lan new-connection-mark=conn2 passthrough=yes per-connection-classifier=both-addresses:2/1 dst-address-type

6、=!localadd action=mark-routing chain=prerouting comment=” connection-mark=conn2 disabled=no in-interface=eth1-lan new-routing-mark=route2 passthrough=yes回程路由设置从哪个口进入就从相应的口回去,即保证每个外网口的数据能得到正确的路由/ip firewall mangleadd chain=input in-interface=eth2-wan action=mark-connection new-connection-mark=conn1ad

7、d chain=input in-interface=eth3-wan action=mark-connection new-connection-mark=conn2标记完进入接口的链接后,将这些链接指定到相应的路由标记上/ip firewall mangleadd chain=output connection-mark=conn1 action=mark-routing new-routing-mark=route1add chain=output connection-mark=conn1 action=mark-routing new-routing-mark=route2路由配置配

8、置完标记路由后,我们进入ip route配置路由,首先设置负载均衡的标记路由,首先设置第一条线路的路由标记,设置routing-mark=route1/ip routeadd gateway=pppoe-out1 check-gateway=ping type=unicast distance=1 scope=30 target-scope=10 routing-mark=route1设置第二条线路的路由标记,设置routing-mark=route2add gateway=pppoe-out2 check-gateway=ping type=unicast distance=1 scope=

9、30 target-scope=10 routing-mark=route2配置默认网关和备份网关/ip route默认网关的distance设置为1,并设置check-gateway=ping,通过ping监测网关状态add gateway=pppoe-out1 check-gateway=ping type=unicast distance=1 scope=30 target-scope=10 备份网关的distance设置为2,并设置check-gateway=ping,通过ping监测网关状态add gateway=pppoe-out2 check-gateway=ping type=unicast distance=2 scope=30 target-scope=10静态路由添加路由/ip route add dst-address=0.0.0.0/0 gateway=192.168.13.250 disabled=no check-gateway=ping routing-mark=net7-route添加规则/ip route rule add src-address=192.168.31.0/24 dst-address=192.168.0.0/21 action=lookup table=net7-route

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号