hardkernel / linux

Linux kernel source tree
Other
426 stars 406 forks source link

ip rule uidrange issue on C4 and N2 #409

Open bno1 opened 3 years ago

bno1 commented 3 years ago

I have an Odroid C4 and I want to set some policy-based routing rules for a VPN. The problem is that the rules are always added with uidrange 0-0, meaning that they are effective only for traffic generated by root.

# ip rule add from 10.70.1.1 lookup 51900
# ip rule list
0:      from all lookup local
32765:  from 10.70.1.1 uidrange 0-0 lookup 51900
32766:  from all lookup main
32767:  from all lookup default

Even if I explicitly specify uidrange, it's being ignored:

# ip rule add from 10.70.1.1 uidrange 0-1001 lookup 51900
# ip rule list
0:      from all lookup local
32765:  from 10.70.1.1 uidrange 0-0 lookup 51900
32766:  from all lookup main
32767:  from all lookup default

Someone else has the same issue on an N2: https://forum.odroid.com/viewtopic.php?t=39413

To circumvent this issue, I run any services that need VPN access as root inside docker containers.

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

$ uname -a
Linux odroid 4.9.241-66 #1 SMP PREEMPT Wed Jan 6 21:41:24 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux