Skip to content

OpenVPN v3 core routes 255.255.255.255 broadcast into the tunnel, breaking LAN software #1847

Description

@ValdikSS

General information

  • Android Version: 10
  • Android Vendor/Custom ROM: LG
  • Device: LG V50
  • Version of the app (version number/play store version/self-built): 0.7.61 F-Droid

Description of the issue

On Android smartphone, connecting to the VPN with OpenVPN Connect or OpenVPN for Android with v3 core results in routing the 255.255.255.255 broadcast address into the tunnel, which makes some applications, such as KDE Connect, unable to discover LAN peers.

# With OpenVPN for Android, v2 core - destination is wlan0

flashlm:/ $ ip r g 255.255.255.255
broadcast 255.255.255.255 dev wlan0 table 1036 src 192.168.70.11 uid 2000 
    cache <local,brd> 

# With OpenVPN for Android, v3 core - destination is tun0

flashlm:/ $ ip r g 255.255.255.255                                                                                                                                                                            
broadcast 255.255.255.255 dev tun0 table 1089 src 192.168.101.37 uid 2000 
    cache <local,brd>

# With OpenVPN Connect, "Allow LAN access" enabled - destination is tun0

flashlm:/ $ ip r g 255.255.255.255
broadcast 255.255.255.255 dev tun0 table 1091 src 192.168.101.37 uid 2000 
    cache <local,brd>

OpenVPN for Android v2 adds a particular set of routes to route only "the internet" inside the tunnel with the default redirect-gateway configuration, without adding default route:

# ip route show table all

default via 192.168.70.1 dev wlan0 table 1036 proto static
192.168.70.0/24 dev wlan0 table 1036 proto static scope link
0.0.0.0/1 dev tun0 table 1088 proto static scope link
128.0.0.0/2 dev tun0 table 1088 proto static scope link
192.0.0.0/9 dev tun0 table 1088 proto static scope link
192.128.0.0/11 dev tun0 table 1088 proto static scope link
192.160.0.0/13 dev tun0 table 1088 proto static scope link
192.168.0.0/18 dev tun0 table 1088 proto static scope link
192.168.64.0/22 dev tun0 table 1088 proto static scope link
192.168.68.0/23 dev tun0 table 1088 proto static scope link
192.168.71.0/24 dev tun0 table 1088 proto static scope link
192.168.72.0/21 dev tun0 table 1088 proto static scope link
192.168.80.0/20 dev tun0 table 1088 proto static scope link
192.168.96.0/19 dev tun0 table 1088 proto static scope link
192.168.101.0/24 dev tun0 table 1088 proto static scope link
192.168.128.0/17 dev tun0 table 1088 proto static scope link
192.169.0.0/16 dev tun0 table 1088 proto static scope link
192.170.0.0/15 dev tun0 table 1088 proto static scope link
192.172.0.0/14 dev tun0 table 1088 proto static scope link
192.176.0.0/12 dev tun0 table 1088 proto static scope link
192.192.0.0/10 dev tun0 table 1088 proto static scope link
193.0.0.0/8 dev tun0 table 1088 proto static scope link
194.0.0.0/7 dev tun0 table 1088 proto static scope link
196.0.0.0/6 dev tun0 table 1088 proto static scope link
200.0.0.0/5 dev tun0 table 1088 proto static scope link
208.0.0.0/4 dev tun0 table 1088 proto static scope link
…
2000::/4 dev tun0 table 1088 proto static metric 1024 pref medium
3000::/4 dev tun0 table 1088 proto static metric 1024 pref medium
fc00::/7 dev tun0 table 1088 proto static metric 1024 pref medium
fe80::/64 dev tun0 table 1088 proto kernel metric 256 pref medium
…

Notice that the last rule is 208.0.0.0/4, which is 208.0.0.1 - 223.255.255.254, does not include 255.255.255.255)

While with OpenVPN v3 uses just the default route

# ip route show table all

default via 192.168.70.1 dev wlan0 table 1036 proto static
192.168.70.0/24 dev wlan0 table 1036 proto static scope link
default dev tun0 table 1087 proto static scope link
192.168.101.0/24 dev tun0 table 1087 proto static scope link
…
(ipv6) default dev tun0 table 1087 proto static metric 1024 pref medium
…

My phone is quite old and running on 4.14 kernel, thus doesn't allow to use SO_BINDTODEVICE for the applications (it is allowed for non-root users since 5.7).

** Log (if applicable)

** Configuration file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions