Page 1 of 1

multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/17 21:32:12
by rrizwanahmed
I am trying to configure Multi Routing Load Sharing/ SPLIT on 2 different ISP's. I did this 3 years ago in Centos 5 and Fedora and its works like a charm and I implemented 7 Linux base routers in my country wide offices.
now its time for Centos 7 with kernel 5.6,
kernel source compiled manually with Combine jumbo Patch of http://www.ssi.bg/~ja/#combinations
as well as taking help from https://www.tldp.org/HOWTO/Adv-Routing- ... ilter.html and Christoph Simon guide lines, also etc...

p rule add prio 50 table main
ip route del default table main

ip rule add prio 249 fwmark 2 table satcom
ip route add default via 202.143.113.42 dev eth1 src 202.143.113.41 proto static table satcom
ip route append prohibit default table satcom metric 1 proto static

ip rule add prio 248 fwmark 3 table supernet
ip route add default via 203.130.10.41 dev eth2 src 203.130.10.42 proto static table supernet
ip route append prohibit default table supernet metric 1 proto static

iptables Prerouting mangle source LANPC destination server1 Mark 2
iptables Prerouting mangle source LANPC destination-all Mark 3

:?: :?: :?:
all working fine till I add second route and its rule and delete default route.
at this time suddenly all traffic automatically route through 2nd route.
I dont know why and I face this problem first time.
Please help me.

Re: multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/22 19:49:58
by rrizwanahmed
no one knows anything?
or my question is un-understandable? :|

Re: multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/23 13:09:13
by jlehtone
First, different kernel versions could behave differently. You are on your own with self-compiled kernel.


CentOS 7 has by default NetworkManager and Firewalld. You should be able to configure your routing
with them or you should disable them and use network.service and iptables.service.
If you haven't done either, then you have multiple services messing up.


I don't recall ever seeing route append prohibit or deletion of default route.

Your mangles seem to differentiate only by destination. That does not require separate tables.
Routes to specific destinations can be in the main table.


I would not say "un-understandable". Rather that given data is baffling.

Re: multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/29 13:02:56
by rrizwanahmed
as you said
"Routes to specific destinations can be in the main table"

help me to understand this line,
should I use metric 1 and 2 for different routes and just POSTROUTING in NAT to use gateway for specific destinaion?

Re: multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/29 13:20:09
by jlehtone
What you have shown so far
requires only two routes (in addition to the link-local eth1 and eth2 routes):

Code: Select all

IP-of-server1 via 202.143.113.42
default via 203.130.10.41
No marks, no rules, no tables, no metrics.

Re: multi route load sharing mull function when add second table route and its rule

Posted: 2020/06/29 23:39:33
by rrizwanahmed
and what about fail-over of each link.
means, what if one link down? how can I route down link traffic to live route? (automatically)
your guidance is helping me to solve my problem