sudomesh / makenode

Configures new sudo mesh nodes
8 stars 8 forks source link

New policy routing prevents router from accessing local network #6

Closed max-b closed 9 years ago

max-b commented 9 years ago

Say one of the picostations has address 192.168.42.52/24 which has been assigned by dhcp and the default gateway is 192.168.42.1

traceroute 192.168.42.1:

root@my:~# traceroute 192.168.42.1
traceroute to 192.168.42.1 (192.168.42.1), 30 hops max, 38 byte packets
 1  10.42.0.99 (10.42.0.99)  23.763 ms  23.453 ms  24.050 ms
 2  104.236.128.253 (104.236.128.253)  25.631 ms  29.937 ms  104.236.128.254 (104.236.128.254)  24.122 ms
 3  198.199.99.237 (198.199.99.237)  25.928 ms  198.199.99.233 (198.199.99.233)  28.545 ms  198.199.99.237 (198.199.99.237)  28.536 ms

But if we specify an interface for traceroute: traceroute -i eth0 192.168.42.1

root@my:~# traceroute -i eth0 192.168.42.1
traceroute to 192.168.42.1 (192.168.42.1), 30 hops max, 38 byte packets
 1  192.168.42.1 (192.168.42.1)  0.343 ms  0.046 ms  0.392 ms

It's using the "public"(mesh) policy routing table instead of the main table and I can't seem to force it to use the main table....

I've tried the following:

ip rule add oif eth0 table main

and

iptables -A OUTPUT -o eth0 -J MARK SET-MARK=1
ip rule add fwmark 1 table main
max-b commented 9 years ago

Should be fixed here: e38d0caac74b0cf0421d1e93cb094e4df15dcc95