Hi. new user here…
How can i configure my rb2011 to use 2 wan ip in one isp.
id like to use lan port 1 as wan1 with lan2-5 as its lan. Lan port 6 as wan2 and lan7-10 as its lans.
Thank you!
This is a case where you need policy based routing.
First, specify a default GW for ISP2
e.g. /ip route add dst=0.0.0.0/0 gateway=x.x.x.x routing-mark=isp2
(x.x.x.x should be the correct default GW on that connection)
Of course the lan2 needs its own IP range - different than the lan1 range…
The easiest way to accomplish what you want is to add some route rules.
Assuming that you are using 192.168.x.x addresses for your LAN ranges:
/ip route rule
add action=lookup-only-in-table dst-address=192.168.0.0/16 table=main
add action=lookup-only-in-table interface=ether6 table=isp2
This will do what you want without requiring a bunch of gymnastics going on in the mangle table.
As for the interfaces’ configurations - set ether3-5 to use master-port=ether2 and configure ether2 as the IP interface for LAN1, and set ether8-10 to use ether7 as their master port and set ether7 to be the IP interface for lan2. Leave ether1 and ether6 configured as standalone interfaces (master-port=none)
Make sure that no bridge contains any of these interfaces.
If you also want to deny connectivity between LAN1 and LAN2, you can just do this with a firewall filter rule or two:
/ip firewall filter
add chain=forward in-interface=ether7 out-interface=ether2 action=drop
add chain=forward in-interface=ether2 out-interface=ether7 action=drop
With one correction - due to both WAN on the same provider I suspect both WANs have the same subnet/gateway?
If yes you must specify also interfaces in default routes.
Something like this:
/ip route add dst=0.0.0.0/0 gateway=gatewayip%ether1
/ip route add dst=0.0.0.0/0 gateway=gatewayip%ether6 routing-mark=isp2
If not specify “%etherX” you may get ECMP default route with random choosing between WAN1 and WAN2 for outgoing traffic.
Hi!
For thank you both for the response! I will try those configurations and will get back for updates.