[solved] Clients connect to wifi only if a PC is connected via ethernet

I have installed LEDE on a D-Link DSL-2740B F1 to use it as a wifi repeater, partially following this guide. To be specific, I have not assign 192.168.2.1 as LAN static address, keeping 192.168.1.1 and I have not set my PC's ethernet or wifi settings at static IP 192.168.2.10 and default gateway 192.168.2.1 while setting up the router. I didn't change the LAN static address because for whatever reason changing it to 192.168.2.1 made me unable to access the router interface.

I'm pretty sure I have not performed a single action not included in that guide, so everything not covered by it should still be on default (I have set a WPA2 for the wifi network, that's the only thing).

Now, the connection works pefectly fine on my PC connected via ethernet cable to the D-Link, and works on any device connected via wifi while the PC is turned on. The problem is that when the PC is turned off or in stand by, other devices won't be able to connect. As an example, my phone sees the wifi network, tries to connect but gets stuck when it needs to obtain an IP, staying virtually forever in that state.

I hope I have explained the problem in an understandable manner. Honestly I have no idea what the cause could be, so I'm sure I've omitted important informations.

Does anyone know what could be causing this?

You need to follow the instructions correctly. Don't leave our steps.

Specifically you need to setup the static IP on your PC in order to access the router .

You can undo the static settings on PC once you have finished setting up.

So once I complete all the steps in the guide, every time I want to access the router interface I have to change the PC static address?

Yes, you will

Ok, thanks. I feel very stupid now.

It turns out that was not the problem. I have resetted everything to default and followed each and every step of the guide. The problem persists. Some 5/10/20 minutes after I turn off the PC the phone (as other devices) is not able to connect via wifi to the repeater.

Either I'm missing something or it has to be something else.

Try running traceroute to some public IP like 8.8.8.8 from a device connected to your main router and again from a device connected AP while PC is still connected and compare.

The result is unexpected. When connected to the extender of course it shows one more hop at the very beginning, but it says that re request expired instead of showing IP. The other hops work fine.

  1     *        *        *     Request timed out.
  2    16 ms    35 ms     2 ms  FASTGATE [192.168.1.254]

These are the first hops. While connected to the main router it's identical except of course for the first one which is absent. 192.168.1.254 is the default address of the main router.

Changin the static IP back to 192.168.1.1 prosuced this result

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2     2 ms     2 ms     2 ms  FASTGATE [192.168.1.254]

The remaining hops do not change.

Recheck all your settings.

By chance is your PC connected to multiple networks/AP, are you bridging any networks on the PC

Also

What IP address is your device getting from DHCP when connected to the AP/extender.

Have you rebooted the AP/extender since changing/applying all the settings.

By chance is your PC connected to multiple networks/AP, are you bridging any networks on the PC

The PC does not wifi access and it's only connecter via ethernet to the extender, so if I understood the question correctly no, it is not.

What IP address is your device getting from DHCP when connected to the AP/extender.

The PC got 192.168.1.17, the phone 192.168.1.205 (edit: 192.168.1.24 after reconnecting it) and a laptop I have 192.168.1.174. The phone does not appear in the DHCP and DNS page. The two PCs only appear in the Active DHCPv6 Leases, while the Active DHCP Leases is empty. I don't know if this is expected, but none of these appears on the main router list of connected devices. (Edit: both the phone and the lapton appear in the Associated Stations list)

Have you rebooted the AP/extender since changing/applying all the settings.

Yup, multiple times.

Something more I found out: when the main router is turned off, the phone can't see the extender when scanning for access points.
Some 10 minutes after putting the PC in standby, the phone got disconnected as usual, but the laptop did not and its internet connection kept working. After manually disconnecting it from the AP, i cuold not connect it again until I turned the PC back on.
On the main router, the AP is the only connected device with 192.168.1.103 as IP.

Ok, that is interesting.

Some more troubleshooting steps.

Make the SSID on the AP/extender different for now to make testing easier.

Sometimes in situations like these I find it useful to shut everything down and power up one device at a time starting with the modem the main router then extender then devices. Make sure each devices is ready before moving to next device.

Maybe leave your PC disconnected until you workout why can't connect without it. Connecting mightvbe masking the problem

Make the SSID on the AP/extender different for now to make testing easier.

Extender and main router already have 2 different names.

Sometimes in situations like these I find it useful to shut everything down and power up one device at a time starting with the modem the main router then extender then devices. Make sure each devices is ready before moving to next device.

I turned on the main router, waited some 5 minutes, turned on the rpeater, waited another 3/4 minutes, turned on the phone and it connected. It all worked as intended for almost 20 minutes, and then it disconnected again. During this process the Ethernet was plugged off the PC (plugged in in the repeater, but that should not be a problem, right?).

  1. I was browsing Reddit on the app to keep track of the connection status. I opened a thread and it loaded all the comments (so it was connected to the Internet) and between 10 and 30 seconds later I opened a link and it did not load.
  2. I opened Telegram to check the connection status. Telegram said "Connecting", which is what it says when it's connected to a network but not to Telegram servers.
  3. Telegram connected for 1 second top, then the message changed to "Waiting for network", which is the message it gives when, you guessed it, it's not connected to a wifi network.
  4. Checked the access point list, and the extender was, as always, "Obtaining IP address".
  5. It went "connecting" for a minute tops, and then back to "Obtaining IP Address"
  6. Turned on the laptop, it took a while to connect, but now it believes it is connected to the extender (says connected without internet access). When trying to connect to 192.168.1.1 it doesn't even try to load the page.
  7. Plugged the ethernet cable back in the PC and it all went back working as intended.

Maybe leave your PC disconnected until you workout why can't connect without it. Connecting mightvbe masking the problem

I don't understand what you mean. How can I understand what's wrong without turning on the only device that allows me to connect to the extender?

Now that I hink about it, the LAN interface has DHCP disabled because the giude said so. I'll try doing this again enabling it and see what happens.

From your description it looks like your wifi connection between the extender/AP (client) and router may not very good, check your signal strength.

I am also a little confused. Are you running DHCP on the router only, The extender/AP should NOT have DHCP enabled.

I don't understand why the PC is even necessary, unless your running a DHCP server on the PC with a 20 minute lease time.

From your description it looks like your wifi connection between the extender/AP (client) and router may not very good, check your signal strength.

The connection is not perfect, but it's good. From the PC I have almost no problem.

I am also a little confused. Are you running DHCP on the router only, The extender/AP should NOT have DHCP enabled.

As the guide said, I disabled DHCP from the LAN interface. I reactivated it only now to se what would have happened. While the PC was plugged off, the phone and the laptop were connected to the Internet but the connection was slow and unreliable. As always, plugging the PC back in solved every issue. I now disabled DHCP from that interface again.

I don't understand why the PC is even necessary, unless your running a DHCP server on the PC with a 20 minute lease time.

Yeah, that's what I would like to understand. I'm not an expert, but I don't think someone can accidentaly be running a DHCP server on his computer without knowing.

Some more weird shit.

I was playing Heartstone on the laptop when the phone got disconnected from the Internet. Menaged to play without problem for at least a minute, after which I closed the game. I could connect without problem to 192.168.1.1 from the laptop, but no actual website. Turning off an on wifi on the laptop and connecting again to the extender (for whatever reason the laptop can) gives me enough Internet time to load a webpage, but it gets disconnected from the Internet (but not from the extended) in no time.

While the phone tries to connect, I can see it in the Associated Stations list, with an associated IP (192.168.1.105). It disappears once it stops trying to connect. Apparently, according to the extender it gets assigned an IP, but it seems not to communicate it to the device.

I would focus on the WIFI connection between your router and extender.

Somethings to try:

  • Re-position the extender or router to get a better signal
  • Used fixed wifi channel instead of dynamic
  • Use 20Mhz Channel width instead of 40Mhz
  • Use a Wifi Analyser app on your phone and try to understand your environment, do measurements in different parts of your home.
  • check your antenna are firmly attached.

Finally, if you suspect your hardware is faulty open up the extender and check for any swollen capacitors. I have had a couple of older routers drive me crazy and when I opened them up I found a couple of capacitors that had the top bulging up. They where out of warranty, so I got a new router but kept them for possible later repair.

Maybe this log can be useful.

Sat Jun 23 13:09:39 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: authenticated
Sat Jun 23 13:09:39 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: associated (aid 1)
Sat Jun 23 13:09:39 2018 daemon.notice hostapd: wlan0-1: AP-STA-CONNECTED 78:02:f8:fe:2a:fd
Sat Jun 23 13:09:39 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd WPA: pairwise key handshake completed (RSN)
Sat Jun 23 13:09:40 2018 daemon.info odhcpd[630]: Using a RA lifetime of 0 seconds on br-lan
Sat Jun 23 13:10:14 2018 daemon.info odhcpd[630]: Using a RA lifetime of 0 seconds on br-lan
Sat Jun 23 13:10:15 2018 daemon.notice hostapd: wlan0-1: AP-STA-DISCONNECTED 78:02:f8:fe:2a:fd
Sat Jun 23 13:10:18 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: authenticated
Sat Jun 23 13:10:18 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: associated (aid 1)
Sat Jun 23 13:10:18 2018 daemon.notice hostapd: wlan0-1: AP-STA-CONNECTED 78:02:f8:fe:2a:fd
Sat Jun 23 13:10:18 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd WPA: pairwise key handshake completed (RSN)
Sat Jun 23 13:10:19 2018 daemon.info odhcpd[630]: Using a RA lifetime of 0 seconds on br-lan
Sat Jun 23 13:10:54 2018 daemon.notice hostapd: wlan0-1: AP-STA-DISCONNECTED 78:02:f8:fe:2a:fd

That is the MAC address of my phone. All this happens while the phone says "Obtaining IP Address". The PC is turned off. It just repeats those entries for a while, then the phone doesn't try anymore to connect.

This, on the other hand, is the log of a successful connection, right after rebooting both the main router and the extender.

Sat Jun 23 13:22:27 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: authenticated
Sat Jun 23 13:22:27 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd IEEE 802.11: associated (aid 1)
Sat Jun 23 13:22:27 2018 daemon.notice hostapd: wlan0-1: AP-STA-CONNECTED 78:02:f8:fe:2a:fd
Sat Jun 23 13:22:27 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd WPA: pairwise key handshake completed (RSN)
Sat Jun 23 13:22:28 2018 daemon.info odhcpd[630]: Using a RA lifetime of 0 seconds on br-lan
Sat Jun 23 13:22:45 2018 daemon.info dnsmasq[969]: read /etc/hosts - 4 addresses
Sat Jun 23 13:22:45 2018 daemon.info dnsmasq[969]: read /tmp/hosts/odhcpd - 0 addresses
Sat Jun 23 13:22:45 2018 daemon.info dnsmasq[969]: read /tmp/hosts/dhcp.cfg02411c - 2 addresses

In a few minutes probably this connection too will fail.
Edit: as anticipated, the connection wnet down after about 20 minutes. The laptop is still connected to th eInternet, but with a slow and unreliable connection. Some 10 minutes after connecting the phone, this happened.

Sat Jun 23 13:32:03 2018 daemon.info hostapd: wlan0-1: STA 78:02:f8:fe:2a:fd WPA: group key handshake completed (RSN)

At the same time the laptop, which I connected about 6 minutes before, handshaked too.
When the disconnection happens, the log says nothing, except that the device has been disconnected.

Your extender is timing out while trying to connect to the router.

You probably need to focus your troubleshooting on the WiFi connection between the two

Check the logs on the router also