I’ve got RB RB751G-2HnD and trying to do sth like this:
RB751G-2HnD:
eth1 - wan1 (dhcp public IP address 1, ISP1)
eth2 - wan2 (dhcp public IP address 2, ISP1)
eth3 - off
eth4 - off
eth5 - off
usb - wan3 (3G, dhcp private IP address 1, ISP2)
lan1, lan2, lan3 should be separate networks (different subnets). In general - three WiFis and three WANs in one box. No load balancing. No failover. No connectivity between LANs.
In second step (nice to have) wan3 should work both as internet gateway for lan3 and backup gateway for lan1 and lan2 when wan1 and wan2 are down (if they are down, they are always down together because of one ISP). So - if wan1 and wan2 are down wan3 should be default gateway to Internet for lan1, lan2 and lan3. When wan1 and wan1 are up previous setup should be automatically restored.
DHCP for each LAN is clear and working for me. Virtual AP, WAN DHCP Client, 3G connection - it’s a snap. I have routing / firewall problem to make this work and – I tried everything I found via google, nothing works for me. I restored inititial config so all help would be really appreciated.
You have to create mangle and routing marks./ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark=to_WAN1 src-address=<your LAN 1 IP Segment>
add chain=prerouting action=mark-routing new-routing-mark=to_WAN2 src-address=<your LAN 2 IP Segment>
add chain=prerouting action=mark-routing new-routing-mark=to_WAN3 src-address=<your LAN 3 IP Segment>
Oh… and I don’t think you can set the routes by interface. You can only use interface routes in certain circumstances. To get this to work will require a little bit of custom scripting. I would use 2 scripts…
To Detect DHCP Updates and Update the Appropriate Rules/Routes.
To Detect Dead Links and Chance the Routing Marks.