Tuesday 15 September 2015

networking - ip rule does not seem to be invoked -



networking - ip rule does not seem to be invoked -

i have 2 connections on local machine, 1 via eth0 (has static ip, allow 10.10.10.10), via ppp0 (has dinamic ip, illustration 10.20.30.40). both have access internet. have remote server (let's assume has ip 1.2.3.4) want connect local machine in such way packets having source address 10.10.10.10 (eth0) should go through eth0, while having 10.20.30.40 (ppp0) source address should go through ppp0.

preliminary deleted ip rule main route table in order prevent packets beingness treated rule.

after that, created 2 route tables, 1 eth0 (named eth) , ppp0 (named ppp). added routes these tables follows:

ip route add together default dev ppp0 table ppp ip route add together default dev eth0 table eth

then added ip rules followings:

ip rule add together 10.10.10.10 lookup eth ip rule add together 10.20.30.40 lookup ppp

and doesn't work. however, when utilize ip rule add together all instead of pointing specific ip works (sure, packets go through 1 interface in case). so, seems ip rule not invoked when specify ip.

what reason of such unusual behavior?

does have ideas?

i found reason. cause of problem programme (written usage of qt qtcpsocket::bind()) binds socket appropriate interface, not routing settings. not unknown reason. tried using native linux socket functions , runs clockwork.

networking iptables

No comments:

Post a Comment