ros多线路叠加策略pcc超详细教程图文_第1页
ros多线路叠加策略pcc超详细教程图文_第2页
ros多线路叠加策略pcc超详细教程图文_第3页
ros多线路叠加策略pcc超详细教程图文_第4页
ros多线路叠加策略pcc超详细教程图文_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

PCC的负载均衡<互联网共享人人为我我为人人>这是ros最根本最重要的应用,网络上很多教程都比拟笼统,新手根本看不懂!

此教程,详细图文+脚本,新手老手都可以借鉴.

通分组源地址和源端口实现负载平衡,这里我们建立2个WAN出口分别是wan1和wan2,网接口是lan1网络环境如下:ISP1地址10.200.15.99/24,网关:10.200.15.1;ISP2地址10.200.100.99/24,网关:10.200.100.2;网IP地址192.168.100.1/24;启用DNS缓存功能,用192.168.100.1作网DNS解析;根本配置首先进入ipaddress配置IP地址:Mangle标记配置接下来我们进入ipfirewallmangle标记连接和路由,我们使用per-connection-classifier双向地址进展分类做连接分类标记。首先我们需要将进入路由的的进展标记如下列图,我们进入一条mangle规则,中的advanced标签容可以看到per-connection-classifier分类器,选择both-addresses的分类:然后选择dst-address-type=!local,即除了目标地址是本地以前的地址:注:2条线的分类代码定义是第一条线为2/0,第二条为2/1同样选择一下地址类型:下面命令是提取走第一条线路的连接标记取名位1st_conn,并从连接里提取路由标记名位1st_route,设置:per-connection-classifier=both-addresses:2/0,设置in-interface=lan/ipfirewallmangle

addaction=mark-connectionchain=preroutingment=""disabled=no\

in-interface=lannew-connection-mark=1st_connpassthrough=yes\

per-connection-classifier=both-addresses:2/0

addaction=mark-routingchain=preroutingment=""connection-mark=1st_conn\

disabled=noin-interface=lannew-routing-mark=1st_routepassthrough=yes提取走第二条线路的连接标记取名位2nd_conn,并从连接里提取路由标记名位2nd_route,设置:per-connection-classifier=both-addresses:2/1,设置in-interface=lan:/ipfirewallmangle

addaction=mark-connectionchain=preroutingment=""disabled=no\

in-interface=lannew-connection-mark=2nd_connpassthrough=yes\

per-connection-classifier=both-addresses:2/1

addaction=mark-routingchain=preroutingment=""connection-mark=2nd_conn\

disabled=noin-interface=lannew-routing-mark=2nd_routepassthrough=yes在winbo*在mangle中设置完成后如下:回程路由设置我们需要将从那个口进入就从相应的口回去,即保证每个外网口的数据能得到正确的路由/ipfirewallmangle

addchain=inputin-interface=wan1action=mark-connectionnew-connection-mark=1st_conn

addchain=inputin-interface=wan2action=mark-connectionnew-connection-mark=2nd_connwinbo*设置标记完进入接口的后,将这些指定到相应的路由标记上:addchain=outputconnection-mark=1st_connaction=mark-routingnew-routing-mark=1st_route

addchain=outputconnection-mark=2nd_connaction=mark-routingnew-routing-mark=2nd_routewinbo*设置路由配置配置完标记后路由后,我们进入iproute配置路由,首先设置负载均衡的标记路由,首先设置第一条线路的路由标记,设置routing-mark=1st_route:设置第二条线路的路由标记,设置routing-mark=2nd_route:配置默认网关和备份网关,默认网关的distance设置为1,并设置check-gateway=ping,通过ping监测网关状态:备份网关的distance设置为2,并设置check-gateway=ping,通过ping监测网关状态:配置完成后的路由标如下列图:配置nat最后配置nat转换规则,进入ipfirewallnat中配置action=masquerade,分别对2条线路做伪装:/ipfirewallnat

addaction=masqueradechain=sratout-interface=wan1

addaction=masqueradechain=sratout-interface=wan2命令代码如下:*添加ADSL1的pppoe-out密码并取取消自动添加网关及DNS

/interfacepppoe-clientaddname="pppoe-out1"interface="wan1"user="adsl1name"password="adsl1pass"add-default-route=nodisabled=no

/interfacepppoe-clientaddname="pppoe-out2"interface="wan2"user="adsl2name"password="adsl2pass"add-default-route=nodisabled=no*激活pppoe-out拨号

/interfacepppoe-clientenablepppoe-out1

/interfacepppoe-clientenablepppoe-out2*添加本地连接配置

/ipaddressaddaddress=192.168.1.254/255.255.255.0interface=lan1ment="LAN1"*设置DNS缓存

/ipdnssetprimary-dns="202.103.224.68"secondary-dns="202.103.225.68"allow-remote-requests=yes*设置MSS值为1440

/ipfirewallmangleaddaction="change-mss"chain="forward"ment="change-mss"disabled=nonew-mss="1440"protocol="tcp"tcp-flags="syn"*设置input

/ipfirewallmangleaddaction="mark-connection"chain="input"ment=""disabled=noin-interface="pppoe-out1"new-connection-mark="pppoe-out1_conn"passthrough=yes

/ipfirewallmangleaddaction="mark-connection"chain="input"ment=""disabled=noin-interface="pppoe-out2"new-connection-mark="pppoe-out2_conn"passthrough=yes*设置output

/ipfirewallmangleaddaction="mark-routing"chain="output"ment=""connection-mark="pppoe-out1_conn"disabled=nonew-routing-mark="to_pppoe-out1"passthrough=yes

/ipfirewallmangleaddaction="mark-routing"chain="output"ment=""connection-mark="pppoe-out2_conn"disabled=nonew-routing-mark="to_pppoe-out2"passthrough=yes*PCC设置

/ipfirewallmangleaddaction="mark-connection"chain="prerouting"ment=""disabled=nodst-address-type="!local"in-interface="lan1"new-connection-mark="pppoe-out1_conn"passthrough=yesper-connection-classifier="both-addresses:2/0"src-address="192.168.1.0/24"

/ipfirewallmangleaddaction="mark-connection"chain="prerouting"ment=""disabled=nodst-address-type="!local"in-interface="lan1"new-connection-mark="pppoe-out2_conn"passthrough=yesper-connection-classifier="both-addresses:2/1"src-address="192.168.1.0/24"/ipfirewallmangleaddaction="mark-routing"chain=preroutingment=""connection-mark="pppoe-out1_conn"disabled=noin-interface="lan1"new-routing-mark="to_pppoe-out1"passthrough=yessrc-address="192.168.1.0/24"

/ipfirewallmangleaddaction="mark-routing"chain=preroutingment=""connection-mark="pppoe-out2_conn"disabled=noin-interface="lan1"new-routing-mark="to_pppoe-out2"passthrough=yessrc-address="192.168.1.0/24"/iprouteaddment=1disabled=nodistance=1dst-address="0.0.0.0/0"gateway="pppoe-out1"routing-mark="to_pppoe-out1"check-gateway="ping"

/iprouteaddment=2disabled=nodistance=1dst-address="0.0.0.0/0"gateway="pppoe-out2"routing-mark="to_pppoe-out2"check-gateway="ping"/iprouteaddcheck-gateway="ping"ment="pppoe-out1"disabled=nodistance="10"dst-address="0.0.0.0/0"gateway="pppoe-out1"

/iprouteaddcheck-gateway="ping"ment="pppoe-out2"disabled=nodistan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论