Community discussions

 
cbera
just joined
Topic Author
Posts: 8
Joined: Fri Dec 16, 2016 6:10 pm

Dual wan for two gateway

Fri Dec 16, 2016 6:19 pm

Hi, i have this situation:

Port 1 - working ppoe-out1 connection (wan1)
Port 2 - working ppoe-out2 connection (wan2)
Port 5 - LAN

I have 192.168.1.0/24 and 192.168.2.0/24 ip on port5 LAN. I want set gateway of 192.168.1.0/24 to ppoe-out1 and gateway of 192.168.2.0/24 to ppoe-out2.
I tried this

/ip firewall mangle add chain=prerouting src-address=192.168.1.0/24 action=mark-routing new-routing-mark=isp1
/ip firewall mangle add chain=prerouting src-address=192.168.1.0/24 action=mark-routing new-routing-mark=isp2

/ip route add gateway=pppoe-out1 routing-mark=isp1
/ip route add gateway=pppoe-out2 routing-mark=isp2

but not working. Did I do something wrong?
 
tr00g33k
Frequent Visitor
Frequent Visitor
Posts: 84
Joined: Sun Mar 29, 2015 3:58 pm

Re: Dual wan for two gateway

Sat Dec 17, 2016 4:09 pm

Hi, i have this situation:

Port 1 - working ppoe-out1 connection (wan1)
Port 2 - working ppoe-out2 connection (wan2)
Port 5 - LAN

I have 192.168.1.0/24 and 192.168.2.0/24 ip on port5 LAN. I want set gateway of 192.168.1.0/24 to ppoe-out1 and gateway of 192.168.2.0/24 to ppoe-out2.
I tried this

/ip firewall mangle add chain=prerouting src-address=192.168.1.0/24 action=mark-routing new-routing-mark=isp1
/ip firewall mangle add chain=prerouting src-address=192.168.1.0/24 action=mark-routing new-routing-mark=isp2

/ip route add gateway=pppoe-out1 routing-mark=isp1
/ip route add gateway=pppoe-out2 routing-mark=isp2

but not working. Did I do something wrong?

First you have two same mangle rules src-address=192.168.1.0/24

You should create two NAT rules
/ip firewall nat add src-address=192.168.1.0/24 out-interface=pppoe-out1 action=masquerade
/ip firewall nat add src-address=192.168.2.0/24 out-interface=pppoe-out2 action=masquerade
IP ROUTE should look something like this:
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=isp1
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=isp2
Be sure to disable fastpath.

This are just quick tips, if you still cant get it to work, post your whole config, so we can help.
 
cbera
just joined
Topic Author
Posts: 8
Joined: Fri Dec 16, 2016 6:10 pm

Re: Dual wan for two gateway

Mon Dec 19, 2016 12:54 pm

Ok, now working with your help. Thanks you!
Only one question. Why its necessary disable fastpath?

Who is online

Users browsing this forum: No registered users and 15 guests