Wireless Tether - Solve IP conflicts

  • I have a couple of questions about wireless tethering in Libreelec.

    Apologies if some of these questions have been asked and answered already. I have searched but haven't found an exact solution yet.

    Worth saying that I am a bit of a novice with some of this - so I might be missing something obvious or doing something wrong.

    My situation is that I want to build a plug and play device that I can use when I'm away from home, in hotels etc.

    I had previously been carrying two devices - an OpenWrt router (that connects to wireguard) and Libreelec on a Raspberry Pi. What I'm aiming to do is to combine the functions of both of those - so that I only need to carry one device - Libreelec set up to connect to wireguard, hosting an access point that other devices can connect through. I'm using a Raspberry Pi 4.

    First question is just about solving ip conflicts.

    I've been testing at home. My home router has an address of 192.168.0.1. The Raspberry Pi is connected to the router using a wired connection.

    I've turned on wireless tethering in Libreelec but clients cannot connect - they cannot obtain an ip address. As far as I can tell, the reason for that is because Connman is using the same address and subnet as the router. So, the Connman DHCP server is 192.168.0.1 and it's serving addresses in that subnet (192.168.0.2, 192.168.0.3 etc.).

    From what I've read here, that cannot be changed. The Connman dhcp server settings - subnet and ip range - cannot be changed. There's no editable configuration for that. Is that correct? If that is correct, what can be done in this scenario? 192.168.0.X is the most commonly used subnet so I'm sure this problem is common and I'm just unaware of an obvious solution. Can anything be done? (Assume I don't have access to the router to make changes on that side as I won't when I'm travelling). Am I understanding the problem correctly?

    Second question. I also want to use wireguard in this setup. When I connect to wireguard, I cannot ping the wireguard server unless I use move-before or move-after to rearrange the services (that was recommended elsewhere in this forum). Is that just the way it is? No problem if so, but is there something I can change to get it working without doing that?

  • My understanding has always been that ConnMan has conflict avoidance logic and should enable the tether using an alternative subnet class, e.g. if Ethernet uses 192.168.x.x then it would pick 10.x.x.x or 172.16.x.x instead. Not something I ever needed to test though. Regardless, the logic is automagic and the wireless configuration is not something you can directly control. The functionality in ConnMan is for providing a hotspot on mobile phone or tablet device and so has on/off level controls; it is intentionally simple and not a router. And, if WireGuard works with the move-before logic, you need the move-before logic.

  • Thank you very much for the response. That does clarify a lot.

    I did some more testing using different networks - through my phone etc. The tether did work and assigned ips when the outer network used different subnets (192.168.2.x etc.). I also tried using the AddressConflictDetection option in the main.conf but it didn't seem to help.

    Anyway, don't give this any more time. I'll look into it more and if I find anything helpful, I'll post it here for others.

  • Just one correction to my original post.

    When I am connected to my router (192.168.0.1), the tether ip subnet is 192.168.1.x.

    I confirmed that with 'ip route list'. So, the conflict avoidance is working and I was misunderstanding the situation. However, I still cannot connect.

    I can connect if the router uses a different subnet (192.168.2.x). In that case the tether does use 192.168.0.x (which is why I assumed it was always using that).

    Anyway, just wanted to post that correction in case someone with the same problem finds this thread.