Page 1 of 1

[solved] Two separate Internet connection for two LANs with one Routerboard

Posted: Fri Feb 13, 2015 4:03 am
by GZ15
[solved]

Hi,

I have recently re-did some networking setup at one company. They have two separate Internet connections via VDSL - one for the office and the second one for the guests. There are also two separate local networks, again, one for the office, one for the guests.

As the VDSL modems were really unstable, I switched them to bridge mode and set up a MikroTik RB750GL (5-port, 1 Gbit/s) to create the PPPoE connections. After the DSL connection is set up, I get a dynamic IP address from the ISP (on both connections).

Now, ideally, I would like to have each Internet connection to be used for one of the networks, i.e. both the office and guests will have their own Internet access and won't throttle the other one's connection (since both are only 8 Mbit/s at the moment, unfortunately).

There is however a problem of having two default routes, which are both acquired automatically via DHCP upon setting up the DSL connection. I cannot use two static routes because I don't know in advance which IP addresses I am going to get (as well as a gateway IP).

What is the best approach to this type of problem? One of my friends mentioned VRF, but all the MikroTik VRF articles seem to be only dealing with mid-infrastructure issues.

Quick setup overview:
ether1-gateway-office: first PPPoE connection, IP and default gw dynamically acquired from the ISP
ether2-gateway-guests: second PPPoE connection, IP and default gw dynamically acquired from the ISP
ether3-local-office: 10.0.5.1/24, DHCP server for the office
ether4-local-guests: 10.0.4.1/24, DHCP server for the guests
ether5-local: not used

If there is any information I omitted, please let me know, I will try to fill in as many details as possible.

Thank you!

Re: Two separate Internet connection for two LANs with one Routerboard

Posted: Fri Feb 13, 2015 11:50 pm
by Clauu
Use mangle to mark packets, let's say that your networks are 192.168.10.0/24 for office and 192.168.20.0/24 for guests
mangle
/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=routing_mark_office src-address=192.168.10.0/24
/ip firewall mangle add action=mark-routing chain=prerouting new-routing-mark=routing_mark_guests src-address=192.168.20.0/24
and routes
/ip route add gateway=pppoe_connection_office routing-mark=routing_mark_office
/ip route add gateway=pppoe_connection_guests routing-mark=routing_mark_guests

Re: Two separate Internet connection for two LANs with one Routerboard

Posted: Sat Feb 14, 2015 2:42 am
by GZ15
Hi,

thanks for the advice! Just to double-check, when specifying gateway, I can use interface, instead of an IP?

Thank you.

Re: Two separate Internet connection for two LANs with one Routerboard

Posted: Sat Feb 14, 2015 10:13 pm
by Clauu
Yes, you can use your pppoe client interface instead of ip

Re: Two separate Internet connection for two LANs with one Routerboard

Posted: Sun Feb 15, 2015 4:52 pm
by GZ15
OK, I'll try that tomorrow. Thanks once again!

Re: Two separate Internet connection for two LANs with one Routerboard

Posted: Mon Feb 16, 2015 7:37 pm
by GZ15
So I tried it and it works, awesome!

Important note for anyone trying to solve this in the future. Besides setting the routing marks as Clauu suggested, it is also necessary to add a second masquerade rule for the other pppoe interface.