Quantcast
Viewing all articles
Browse latest Browse all 60861

Re: Routing locally originated traffic after failover in 1.9.0

That is may be because you have valid routes in main table

 

I can't  fully agree with:

 

>> No, it can't be rubbish, it has to be real. The load-balance engine looks up the main table for default routes to establish default route for each defined load-balanced interface and it's respective routing table.

 

because  i don't have any valid routes in MAIN routing table. Only in policy routing tables and it still works.

 

That is because Linux make routing desicion twice.

APPLICATION -> Routing -> OUTPUT Mangle -> OUTPUT NAT -> OUTPUT  Filter -> Routing -> POSTROUTING Mangle -> POSTROUTING NAT -> out

 

The First routing (MAIN table) can have any route. The Second Policy Routing Table defines finle route.

I have a default route in MAIN table wich point to nonexistant host in LAN.

 

In case you have valid route on WAN, then this rules should be trigged on ICMP and DNS:

 

-A UBNT_WLBO_VPS -o eth0 -p icmp -j MARK --set-xmark 0x800000/0x7f800000

-A UBNT_WLBO_VPS -o eth1 -p icmp -j MARK --set-xmark 0x1000000/0x7f800000

-A UBNT_WLBO_VPS -o eth0 -p udp -m udp --dport 53 -j MARK --set-xmark 0x800000/0x7f800000

-A UBNT_WLBO_VPS -o eth1 -p udp -m udp --dport 53 -j MARK --set-xmark 0x1000000/0x7f800000

-A UBNT_WLBO_VPS -m mark ! --mark 0x0/0x7f800000 -j RETURN

 

After that it will exit from Load-Balance and will not reach LB rules:

 

-A UBNT_WLBO_VPS -m state --state NEW -m mark --mark 0x0/0x7f800000 -m dyn_random --prob-name "VPS_0"  -j MARK --set-xmark 0x800000/0x7f800000

-A UBNT_WLBO_VPS -m state --state NEW -m mark --mark 0x0/0x7f800000 -j MARK --set-xmark 0x1000000/0x7f800000

 

 But it still should work with other types of traffic.


Viewing all articles
Browse latest Browse all 60861

Trending Articles