Community discussions

MikroTik App
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Ootbound load balancing an incoming trafic

Thu Aug 10, 2006 1:00 pm

I have been searching the forums, the wiki and the documentations , and noticed that this issue was raised many times but never really solved.

When using multiple gateways with some kind of (multiple ISPs) load balancing ( thanks to the wiki there are 3 good example to choose from) , a big problem remains: Regarding incoming trafic.

Say smtp ( or http...) trafic coming from one of the wans and dest-nated to the same local server ( 2 ore more wans are MX for that server for link redundancy). The local mail server when responding responds via the default route, wich is not necessarely the good one. ECMP (with multiple gateways with commas) doesn't solve the problem, since the current session ( say a smtp session) has to be responded EXACTLY from the same incoming wan link.

In simpler words, in incoming trafic (hhtp, smtp...) dest-nated to a local host, any session should always be responded via the SAME link that it was initiated from. Which is not the case in load balancing since the default gateway (seen from the LAN) changes.

I have been spending hours trying to solve the problem with policy routing, and tried all marks: routing, packets, connection.. No way.

Did anyone already face ? I have opened a cas @mikrotik but did not get an answer yet.

Thanks !
 
joeri91942
Frequent Visitor
Frequent Visitor
Posts: 88
Joined: Thu Mar 31, 2005 12:31 pm
Location: Sundsvall, Sweden

Thu Aug 10, 2006 2:40 pm

I wonder if this might be what you are looking for....?
http://forum.mikrotik.com/viewtopic.php ... highlight=

/Jörgen
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Thu Aug 10, 2006 4:52 pm

Sorry Guys for the unreadable title.

And many thanks also for redirecting me to this huge great thread. It looks like a good direction and I am going to give the 2 examples a close look, altough I believe, incoming trafic from ISPs links side should always be responded accros the initiating link and should therefore be a RouterOS default feature. What do you think ( and Mikrotik team) ?
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Thu Aug 10, 2006 5:58 pm

This is simple ... you need 3 mangle rules.

1 - mark connections as they come in - based on incoming interface.
2 - mark packets based on the above connection mark.
3 - mark routing based on the above packet mark.

Then you need to create separate routing tables, one for each gateway that's possible. Basically you are marking connections as they come in so you can send them back out the same interface. If you can't figure it out post your config and we'll help you fine tune it.

Sam
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Tue Aug 22, 2006 8:00 pm

Sorry Guys, I've been away for a week and could not follow up. I tried the mangle rules but it doesn't seem to be working for ... a good reason:

Mangle marks, at least according to the documentation do not exist anymore once they leave the router. Thus the server that responds to a request creates a new packet without any marks ( packet mark, routing mark or connection mark - not sure to understand what connection means-),thus making routing rules unusable for selecting a gateway for outgoing trafic.

Am I right ?

From the manuel : "The mangle marks exist only within the router, they are not transmitted across the network."
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Fri Aug 25, 2006 4:19 pm

Finally I did solve the problem with the help of all. The precious link directed by Jörgen was so helpfull that I did save it's content in my local pc.

Finally the solution was simple and involved only :
- connection marks
- routing marks
- and routing based on routing marks.

The difficulty I had was to select the RIGHT interface for the connection mark mangle rule and the RIGHT (a different one, that was where my mistake resided!) for the routing mark mangle rule.

I did appreciate the help, I mean it.

Who is online

Users browsing this forum: EnglishInfix and 15 guests