Community discussions

MikroTik App
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

Load Balancing problems

Wed Dec 24, 2008 8:16 am

Hello:
I want to create a load balancing application (including backup if one of both connection is down).

I follow the how to http://wiki.mikrotik.com/wiki/Improved_ ... e_Gateways,
but when I try to follow this step I've problems
"NAT
/ ip firewall nat
add chain=srcnat connection-mark=odd action=src-nat to-addresses=10.111.0.2 \
to-ports=0-65535 comment="" disabled=no
add chain=srcnat connection-mark=even action=src-nat to-addresses=10.112.0.2 \
to-ports=0-65535 comment="" disabled=no "
Because I'm using PPPoE Client (from a Adsl connection) and the IP address always change. What must I put there?

Thank you

Best regards
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Load Balancing problems

Wed Dec 24, 2008 10:00 am

If the public addresses are on separate interfaces, try using masquerade instead of src-nat. This is what it is for. It uses whatever IP is currently assigned to that interface. Just to be clear, order in this list is important. Each entry in the chain is evaluated in order. First one that matches is used, and all others in that chain are ignored.

In the following example, the routing-mark=ether2out will go out ether2, and all others route out through ether1.
/ip firewall nat
add chain=srcnat action=masquerade out-interface=ether2 routing-mark=ether2out
add chain=srcnat action=masquerade out-interface=ether1

Same here (*EDIT)
/ip route
add gateway=xxx.xxx.xxx.xxx interface=ether2 routing-mark=ether2out
add gateway=yyy.yyy.yyy.yyy interface=ether1

*EDIT: Changed gateway from gateway=ether1 to the IP. The previous assignment did NOT always find the gateway.
 
garage
just joined
Posts: 5
Joined: Sun Apr 01, 2007 8:27 pm

Re: Load Balancing problems

Wed Dec 24, 2008 4:16 pm

try this config

0 ;;; NETWORK MASQUERADE
chain=srcnat action=masquerade src-address=10.10.10.0/24
 
mobilexpi
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Thu May 26, 2005 5:24 am
Location: Santiago

Re: Load Balancing problems

Thu Dec 25, 2008 12:11 am

...Same here (*EDIT)
/ip route
add gateway=xxx.xxx.xxx.xxx interface=ether2 routing-mark=ether2out
add gateway=yyy.yyy.yyy.yyy interface=ether1

*EDIT: Changed gateway from gateway=ether1 to the IP. The previous assignment did NOT always find the gateway.
I can't modify the routes, because it's automatically assigned by the PPPoE client. How can I fix it?
Best regards
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: Load Balancing problems

Thu Dec 25, 2008 3:37 am

Do both gateways show up in '"ip route"? If so, try to ping out to the internet. It may work with just the masquerade rules, since the IP subnets are on different interfaces.