openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
160 stars 96 forks source link

Odhcpd relayed RA causing wifi drops for LineageOS 17.1 Phones #166

Open dwardor opened 3 years ago

dwardor commented 3 years ago

My LineageOS17.1 phones have no issues when connected directly to my router (dnsmasq SLAAC + statefull DHCPV6). However they can't keep the wifi connection (wlan0 goes down) when connecting through my re450v1 wifi repeater running openwrt 19.07.5. The repeater is using odhcpd to relay ra, dhcpdv6 and ndp. The culprit is ra relaying... as if I replace ra relay by ra server on the wifi repeater to advertize the same information (prefix, dns, and search domain) then it works.

More details can be found at https://forum.openwrt.org/t/odhcpd-relayed-ra-causing-wifi-drops-for-lineageos-17-1-phones/84879

Regards

nicman23 commented 3 years ago

i am also affected by this. disabling ra makes the wifi stable, where on lineageos 18.1 (specifically) it would disconnect every 10 seconds.

DocSniper commented 2 years ago

Same problem here. I relay an IPv6 /64 subnet from the external to the internal interface and everything works fine, except my devices with LineageOS 17.1 and 18.1. The devices connect, but a few moments after they are assigned an IPv6 address, they disconnect from WiFi. I have searched and read a lot, but the only solution I have found so far is to either disable IPv6 completely or change the RA entry of the ODHCP internal interface from Relay to Server. Then of course only internal IPv6 addresses are assigned.

nicman23 commented 2 years ago

i do have a workaround but it is cancer. basically you need a static prefix from your isp

https://transfer.sh/sOxzzo/odhcpd.tar.xz

obviously that is a fake ipv6

dwardor commented 2 years ago

Same problem here. I relay an IPv6 /64 subnet from the external to the internal interface and everything works fine, except my devices with LineageOS 17.1 and 18.1. The devices connect, but a few moments after they are assigned an IPv6 address, they disconnect from WiFi. I have searched and read a lot, but the only solution I have found so far is to either disable IPv6 completely or change the RA entry of the ODHCP internal interface from Relay to Server. Then of course only internal IPv6 addresses are assigned.

In server mode just have it annouce the same networkprefix/prefixlength and dns as on external side...

Have you done a radvdump when in relay mode using a laptop to see what RA te phone is receiving (in my case my nest thermostats were sending ra that lead to lossing default route and internet connectivity (which I think was the root cause of lineage disconnecting (as soon as I solved that relay mode was fine)

DocSniper commented 2 years ago

Hello you two and thank you for your quick responses.

@nicman23: Would be a great idea with the static prefix, but unfortunately my DSL provider (O2) doesn't assign one for private customers. I'll save your configuration though in case that changes. Thanks in any case.

@dwardor: Just ran radvdump on 2 machines and noticed that there is no broadcast during the disconnect, there is only one at the time of the connect. I have also already disconnected all devices from the network, except the router and one phone each. Likewise, I used another phone with LineageOS 18.1 (after I did a factory reset) to test, but again, same problem. It seems all my phones with LOS 18.1 disconnect shortly after assigning the IPv6 address although no second (wrong) RA packet is sent.

Very strange, I'm attaching the output from radvdump:

#
# radvd configuration generated by radvdump 2.19
# based on Router Advertisement from fe80::1111:2222:3333:4444
# received by interface eth0
#

interface eth0
{
        AdvSendAdvert on;
        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump
        AdvManagedFlag off;
        AdvOtherConfigFlag on;
        AdvReachableTime 0;
        AdvRetransTimer 0;
        AdvCurHopLimit 64;
        AdvDefaultLifetime 1800;
        AdvHomeAgentFlag off;
        AdvDefaultPreference low;
        AdvLinkMTU 1492;
        AdvSourceLLAddress on;
        AdvIntervalOpt on;

        prefix aaaa:bbbb:cccc:dddd::/64
        {
                AdvValidLifetime 259200;
                AdvPreferredLifetime 172800;
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        }; # End of prefix definition

        route aaaa:bbbb:cccc:dddd::/64
        {
                AdvRoutePreference high;
                AdvRouteLifetime 259200;
        }; # End of route definition

        RDNSS fe80::1
        {
                AdvRDNSSLifetime infinity; # (0xffffffff)
        }; # End of RDNSS definition

}; # End of interface definition