oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.76k stars 220 forks source link

Interface prioritization for first hop routes #2020

Closed jagerman closed 1 year ago

jagerman commented 1 year ago

Report with 0.9.10 rc: when exit mode gets enabled the device lost connectivity. The routing table looks like this:

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.16.0.1      128.0.0.0       UG    0      0        0 lokitun0
default         10.1.1.1        0.0.0.0         UG    100    0        0 enp34s0
default         192.168.0.1     0.0.0.0         UG    20425  0        0 br0
10.1.1.0        0.0.0.0         255.255.255.0   U     100    0        0 enp34s0
38.54.4.226     192.168.0.1     255.255.255.255 UGH   0      0        0 br0
38.54.61.45     192.168.0.1     255.255.255.255 UGH   0      0        0 br0
62.171.145.135  192.168.0.1     255.255.255.255 UGH   0      0        0 br00

where we've added the routes on the wrong interface.

$ ip a
2: enp34s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:d8:61:a6:9a:1c brd ff:ff:ff:ff:ff:ff
    inet 10.1.1.87/24 brd 10.1.1.255 scope global dynamic noprefixroute enp34s0
       valid_lft 7124sec preferred_lft 7124sec
    inet6 fe80::2b64:c0f0:776a:3a41/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.10/24 brd 192.168.0.255 scope global noprefixroute br0
       valid_lft forever preferred_lft forever
    inet6 fe80::7b03:4920:5c0e:9249/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

This looks like it has a couple things wrong:

majestrate commented 1 year ago

<NO-CARRIER,BROADCAST,MULTICAST,UP> , br0 is up but has no carrier, for a bridge this makes sense.