[2 internet connections] Combining load balancing and rule based routing
Hi folks,
I have a firewall/gateway setup with 2 DSL connections (using PPPoe). As far as I know, there are 2 possibilities when someone wants to use both of them simultaneously (from behind a network, using NAT):
Now, finally my question: :) I want to combine both methods: As seen above, it's possible to add default gateways from different WAN links to different routing tables. Using these different WAN links, it's possible to use a WAN link (choosing witch routing table to lookup) based om some criteria. Now, what I actually want to achieve:
This would it make possible, to decide if a client in the network has to use:
... and of course other criteria, like:
Actually, this seems to be impossible, because something like: Code:
ip route add default equalize scope global \ Quote:
Thanks in advance :) |
hi,
i've never tried using complex routing using linux, but i do get your point in cisco's term -- you want to create both PBR and VRRP. but from your diagram - you only have 1 router. and, you need to do the policy-based routing after your VRRP properly configure. sure you can do PBR with 1 router - but you dont have the option of doing balanced-gateway. HTH. |
Unfortunately, Cisco routers are really to expensive for home usage. ;)
Actually, my setup works fine: the default route chosen is the latest one added with this script. So when the load balanced is the last one added, clients use it by default. Exceptions can be made through ip rules (for example, client a must use ISP 1, client b ISP 2, and client c a load balanced route of ISP 1 and 2). But: I just want to have the freedom to use 3 custom routing tables in stead of 2. That would it make possible to choose the routing table based on the earlier mentioned criteria. The default behavior would be: all clients, protocols, ports,... use ISP 1, all other exceptions to this default behavior can use ISP 2 or load balancing of both. One thing I still can try: the load balanced route was added by default in the "main" route table (actually, tis is the default routing table, also used by the "route" command). So what if I make routing rules for the main table? |
hi,
the idea of vrrp is that you create a virtual router with a virtual IP handling balanced-gateway - so that you can create a routing-table based on balanced-gateway. i understand that your : route A will be packet A and going to line A, route B will be packet B and going to line B, but then you need another route for both packet AB going line AB - right? this thing cant be done in a single router and policy-based routing. that is the function of VRRP - "another" virtual router which deliver your balanced traffic. and you can do GLBP (gateway load balancing) which is an alternative to VRRP. i think thats all for cisco'isme :) you've got me interested in developing complex routing based on linux. thanks for the idea. nice one. HTH. |
how to avoid Error: "nexthop" or end of line is expected instead of "table"
It's been a while since no-one posted on this topic, but...I've just found the solution to the initial problem mentioned here!
So, to TomG22: You can add a "weighted" rule to a user-defined routing table, using the following syntax: Code:
ip route add default scope global table MYTABLE nexthop via 10.0.1.1 dev eth3 weight 1 nexthop via 10.0.2.1 dev eth2 weight 1 This hint I've found at: http://mailman.ds9a.nl/pipermail/lar...q4/021875.html Hope this helps! :) Cheers |
All times are GMT -5. The time now is 09:15 PM. |