找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3331|回复: 3

[负载平衡] ROS双线在同一网关上做的负载端口映射,怎么都设定不成功呢?

[复制链接]
发表于 2012-7-14 20:56:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
具体情况如下:
ros 5.18版本,共装3块网卡:
ether1------------内网,ip:172.16.0.254;
ether2------------外网,ip:10.0.0.2;网关:10.0.0.254
ether1------------内网,ip:10.0.0.3;网关:10.0.0.254
外网同网关:10.0.0.254
已经成功做成了pcc负载均衡,内网上网没有任何问题,
脚本如下:
  1. /ip firewall address-list
  2. add address=172.16.0.0/24 disabled=no list=All_IP

  3. /ip firewall mangle
  4. #路由原路返回策略
  5. add action=mark-connection chain=input comment=\
  6.     "\C2\B7\D3\C9\D4\AD\C2\B7\B7\B5\BB\D8\B2\DF\C2\D4" disabled=yes \
  7.     in-interface=ether2 new-connection-mark=ether2_conn passthrough=yes
  8. add action=mark-routing chain=output connection-mark=ether2_conn disabled=yes \
  9.     new-routing-mark=ether2_rout passthrough=yes
  10. add action=mark-connection chain=input disabled=yes in-interface=ether3 \
  11.     new-connection-mark=ether3_conn passthrough=yes
  12. add action=mark-routing chain=output connection-mark=ether3_conn disabled=yes \
  13.     new-routing-mark=ether3_rout passthrough=yes
  14. #标记ether2
  15. add action=mark-connection chain=prerouting comment="\B1\EA\BC\C7ether2" \
  16.     disabled=no dst-address-type=!local new-connection-mark=ether2_conn \
  17.     passthrough=yes per-connection-classifier=both-addresses:2/0 \
  18.     src-address-list=All_IP
  19. add action=mark-routing chain=prerouting connection-mark=ether2_conn disabled=\
  20.     no new-routing-mark=ether2_rout passthrough=yes src-address-list=All_IP
  21. #标记ether3
  22. add action=mark-connection chain=prerouting comment="\B1\EA\BC\C7ether3" \
  23.     disabled=no dst-address-type=!local new-connection-mark=ether3_conn \
  24.     passthrough=yes per-connection-classifier=both-addresses:2/1 \
  25.     src-address-list=All_IP
  26. add action=mark-routing chain=prerouting connection-mark=ether3_conn disabled=\
  27.     no new-routing-mark=ether3_rout passthrough=yes src-address-list=All_IP

  28. /ip firewall nat
  29. add action=src-nat chain=srcnat comment="ether2\BF\DANat" disabled=no \
  30.     out-interface=ether2 src-address-list=All_IP to-addresses=10.0.0.3
  31. add action=src-nat chain=srcnat comment="ether3\BF\DANat" disabled=no \
  32.     out-interface=ether3 src-address-list=All_IP to-addresses=10.0.0.2

  33. /ip route
  34. #添加外网1线到10.0.0.254的路由
  35. add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.0.0.254%ether2 \
  36.     routing-mark=ether2_rout scope=30 target-scope=10
  37. #添加外网2线到10.0.0.254的路由
  38. add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.0.0.254%ether3 \
  39.     routing-mark=ether3_rout scope=30 target-scope=10
  40. #添加默认路由
  41. add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=10.0.0.254 scope=30 \
  42.     target-scope=10
复制代码
可是,端口映射怎么也做不成,出现,在外网,有的机器可以用10.0.0.2访问内网服务器,有的机器只可以用10.0.0.3访问内网服务器,请问大师,如何设置此类同网关多线pcc负载下的端口映射呢??
恳请赐教!!
routeros
 楼主| 发表于 2012-7-14 20:58:12 | 显示全部楼层
本帖最后由 kice 于 2012-7-14 21:01 编辑

我需要在外网都能够通过10.0.0.2和10.0.0.3访问内网服务器,影射的端口是:80,我用winbox可以正常在外网登陆ros服务器!
愿意付铜板购买,谢谢·
routeros
回复

使用道具 举报

发表于 2012-7-14 21:25:23 | 显示全部楼层
你确定你的外网80端口可以用?电信没封?
可以试下做哪进哪出策略!
routeros
回复

使用道具 举报

 楼主| 发表于 2012-7-14 21:58:54 | 显示全部楼层
外网的80端口没有封,具体怎么设置呢?求教!
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-6 22:29 , Processed in 0.052219 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表