找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 12651|回复: 5

[基础] 新手求助,这种情况该佮设置。

[复制链接]
发表于 2014-9-28 14:22:01 | 显示全部楼层 |阅读模式

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

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

×
WLan: 两个出口  IP:219.150.232.19 掩码:248  网关:18  另外一个是: IP 202.102.71.20 掩码:252  网关:21

DNS:4.4.4.4  8.8.8.8  

内网分为:192.168.0.254/24 192.168.1.254/24 192.168.2.254/24 192.168.3.254/24 等四个Vlan。 网关都是254 ,4.254 这个Vlan是 动态分配 DHCP。其固定IP。已有DHCP服务器是 192.168.0. 1  

ros 版本是V5.4 ,三个网卡: E1,E2,E3

请问,该如何配置,做到均衡负载。应该如何配置,详细配置。就是小白,很多不知道。

请大侠指点
routeros
发表于 2016-7-26 11:13:16 | 显示全部楼层
/interface ethernet set [ find default-name=ether1 ] name=LAN
/interface ethernet set [ find default-name=ether2 ] name=WAN1
/interface ethernet set [ find default-name=ether3 ] name=WAN2
/ip address add address=192.168.0.254/24 interface=LAN
/ip address add address=192.168.1.254/24 interface=LAN
/ip address add address=192.168.2.254/24 interface=LAN
/ip address add address=192.168.3.254/24 interface=LAN
/ip address add address=219.150.232.19/29 interface=WAN1
/ip address add address=202.102.71.20/30 interface=WAN2
/ip dns set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4

/ip route add check-gateway=ping comment=WAN1_to distance=1 gateway=219.150.232.18 routing-mark=to_wan1
/ip route add check-gateway=ping comment=WAN2_to distance=1 gateway=202.102.71.21 routing-mark=to_wan2
/ip route add check-gateway=ping comment=WAN1-MAIN distance=2 gateway=219.150.232.18
/ip route add check-gateway=ping comment=WAN2-MAIN distance=3 gateway=202.102.71.21

/ip firewall address-list add address=192.168.0.0/24 list=lan_address
/ip firewall address-list add address=192.168.0.0/24 list=lan_address
/ip firewall address-list add address=192.168.0.0/24 list=lan_address

/ip firewall nat add action=masquerade chain=srcnat out-interface=WAN1 src-address-list=lan_address
/ip firewall nat add action=masquerade chain=srcnat out-interface=WAN2 src-address-list=lan_address
/ip firewall nat add action=masquerade chain=srcnat out-interface=WAN3 src-address-list=lan_address

/ip firewall mangle add action=mark-connection chain=prerouting in-interface=WAN1 new-connection-mark=wan1_conn
/ip firewall mangle add action=mark-connection chain=prerouting in-interface=WAN2 new-connection-mark=wan2_conn

/ip firewall mangle add action=mark-routing chain=output connection-mark=wan1_conn new-routing-mark=to_wan1 passthrough=no
/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=wan1_conn new-routing-mark=to_wan1 passthrough=no src-address-list=lan_address

/ip firewall mangle add action=mark-routing chain=output connection-mark=wan2_conn new-routing-mark=to_wan2 passthrough=no
/ip firewall mangle add action=mark-routing chain=prerouting connection-mark=wan2_conn new-routing-mark=to_wan2 passthrough=no src-address-list=lan_address

/ip firewall mangle add action=mark-routing chain=output new-routing-mark=to_wan1 out-interface=WAN1 passthrough=no
/ip firewall mangle add action=mark-routing chain=output new-routing-mark=to_wan2 out-interface=WAN2 passthrough=no

/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=to_wan1 passthrough=no per-connection-classifier=src-address-and-port:2/0 src-address-list=lan_address
/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=to_wan2 passthrough=no per-connection-classifier=src-address-and-port:2/1 src-address-list=lan_address
routeros
回复

使用道具 举报

发表于 2016-7-26 11:31:58 | 显示全部楼层
我来看下,只是看看,这帖子供测试
routeros
回复

使用道具 举报

发表于 2016-7-26 12:44:59 | 显示全部楼层
要求里说:内网分为:192.168.0.254/24 192.168.1.254/24 192.168.2.254/24 192.168.3.254/24 等四个Vlan

echochio 的办法  lan没有分vlan,可行吗?
routeros
回复

使用道具 举报

发表于 2016-7-30 17:44:29 | 显示全部楼层
xuxi3201 发表于 2016-7-26 12:44
要求里说:内网分为:192.168.0.254/24 192.168.1.254/24 192.168.2.254/24 192.168.3.254/24 等四个Vlan
...

負載均衡不要想的太難,它只是用機率或比例的方式將您的"連線要求"分配到不同的指定出口(out-interface).

所以重點從不在"來源"是vlan 或是lan ,
而是到達目的(遠端伺服器)時,用機率非配不同的通道(pppoe1,或是pppoe2,或者是其它).
讓封包不全往固定的out-interface塞,就這樣!




routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-12-25 23:15 , Processed in 0.146690 second(s), 18 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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