Community discussions

MikroTik App
 
GZ15
just joined
Topic Author
Posts: 15
Joined: Thu Sep 29, 2011 10:29 pm

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

Fri Feb 13, 2015 4:03 am

[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!
Last edited by GZ15 on Mon Feb 16, 2015 7:38 pm, edited 1 time in total.
 
Clauu
Member Candidate
Member Candidate
Posts: 217
Joined: Fri Mar 21, 2014 8:27 pm
Location: RO

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

Fri Feb 13, 2015 11:50 pm

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
 
GZ15
just joined
Topic Author
Posts: 15
Joined: Thu Sep 29, 2011 10:29 pm

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

Sat Feb 14, 2015 2:42 am

Hi,

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

Thank you.
 
Clauu
Member Candidate
Member Candidate
Posts: 217
Joined: Fri Mar 21, 2014 8:27 pm
Location: RO

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

Sat Feb 14, 2015 10:13 pm

Yes, you can use your pppoe client interface instead of ip
 
GZ15
just joined
Topic Author
Posts: 15
Joined: Thu Sep 29, 2011 10:29 pm

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

Sun Feb 15, 2015 4:52 pm

OK, I'll try that tomorrow. Thanks once again!
 
GZ15
just joined
Topic Author
Posts: 15
Joined: Thu Sep 29, 2011 10:29 pm

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

Mon Feb 16, 2015 7:37 pm

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.