I am playing around with wifi on a mini router and want to accomplish the following.
The main network interface is a wired LAN connection but I want one single wifi client to connect to the router.
I specifically do not want it to have Internet access through the router, I simply want it to be able to communicate interactively with the router.
At the moment, when I enable wifi, a wifi client can connect to the mini router but no IP is being handed over and I don't really know if in this situation, I have to enable the dhcp server.
While playing with this earlier, this happened automatically without my having to do anything, the client was given an IP.
Tue Aug 16 17:44:03 2022 daemon.notice netifd: Network device 'wlan0' link is up
Tue Aug 16 17:44:03 2022 daemon.notice netifd: Interface 'wwan' is enabled
Tue Aug 16 17:44:03 2022 daemon.notice netifd: Interface 'wwan' has link connectivity
Tue Aug 16 17:44:03 2022 daemon.notice netifd: Interface 'wwan' is setting up now
Tue Aug 16 17:44:03 2022 daemon.notice netifd: wwan (2929): udhcpc: started, v1.28.4
Tue Aug 16 17:44:03 2022 daemon.notice netifd: wwan (2929): udhcpc: sending discover
Tue Aug 16 17:44:06 2022 daemon.notice netifd: wwan (2929): udhcpc: sending discover
Tue Aug 16 17:44:09 2022 daemon.notice netifd: wwan (2929): udhcpc: sending discover
Since then, I did something that broke this as the udhcp service is no longer starting up.
Now when I connect a wifi client, I see the following;
Don't connect any of the ethernet ports of the router to the rest of your network, and you should be able to communicate with it, unless your config attempts really broke something.
I actually want the wired interface to have Internet access. I just don't want the wifi client to have Internet access and I don't need a full dhcp service if there is a way to give the single wifi client an IP.
The question really relates to dhcp and how I can give the wifi client an IP so it can communicate with the router only.
Yes, I know how to set up a dhcp server but that's not what I'm asking about :).
I should add that I'm trying to use as little of the resources as possible on the router too.
If I don't have to run a full dhcp server, that much better since I'm limited in memory sometimes.
Mainly, I'd like to understand what I might have changed that caused the udhcpc service to start when I first started playing with this and it's not run since. What could I have changed?
The only thing I did was to configure the wifi, nothing else. That's why I'm curious why the service no longer runs when I start the ap.
wwan being a dhcp client that isn't attached to any other network means it will never acquire an IP address to be usable. Set it as static IP with an IP subnet that none of your other networks have.
If you stop the firewall, all the networks are able to forward to each other by default. So you don't want that. The firewall process only runs once to set up rule tables in the kernel.
wwan being a dhcp client that isn't attached to any other network means it will never
acquire an IP address to be usable.
Ah, yes, it's set to dhcp in the network file.
Set it as static IP with an IP subnet that none of your other networks have.
Ok, I'll give that a try.
If you stop the firewall, all the networks are able to forward to each other by default.
So you don't want that. The firewall process only runs once to set up rule tables in the kernel.
There is actually no firewall installed on these devices as they are LAN clients only.
I think you gave me the lead I needed. I'll give that a try.
I'm doing everything from the command line as these also don't have any luci stuff installed on them.
Actually, I've kind of gotten past my question here.
The reason I said 'what did I change' is because the only things I changed was adding the hostapd package and using a handful of uci commands to change things like country, encryption and password.
After adding hostapd, the wifi client was able to get a dhcp IP from the router.
After changing the encryption and adding a password is when udhcp stopped.
Does adding the hostapd package change something related to udhcp?
I actually need the router to provide a small dhcp pool. The clients are esp32 devices. Those devices don't need access to the Internet, just the router which has LAN access.
Sorry but some of this is new to me so having a difficult time explaining myself perhaps.
your wifi is setup as AP -- this means it broadcasts an SSID and other devices will connect to it.
If you want that interface to get an address via DHCP, there must be an upstream wifi network with a DHCP server, and this device must be configured as a wifi client ('sta' mode). Your SSID and password on this unit must match the SSID and password of the upstream wifi network.
EDIT: If, on the other hand, this device is supposed to be a DHCP server for connected devices, you need to define an address in the network interface. Currently you have wan and wwan set to get their addresses via DHCP (i.e. from an upstream DHCP server), and there is no LAN at all. The device will not have an address unless it is connected to an upstream network.
It's not really clear what you are trying to do with this router -- it is certainly not configured in a way that would be expected to work.
your wifi is setup as AP -- this means it broadcasts an SSID and other devices will connect to it.
Correct.
If you want that interface to get an address via DHCP, there must be an upstream
I do not want an upstream DHCP IP. It was pointed out that I accidentally left the interface using DHCP but that's now static.
If, on the other hand, this device is supposed to be a DHCP server for connected devices, you
need to define an address in the network interface. Currently you have wan and wwan set to
get their addresses via DHCP (i.e. from an upstream DHCP server), and there is no LAN at all.
Yes, I fixed that. Now the wifi interface has a static IP in a network not being used.
I'm not sure why you say there is no LAN. There is a LAN, it's wired and both wired interfaces can get a DHCP IP. However, that's not what I'm after.
The device will not have an address unless it is connected to an upstream network.
It's not really clear what you are trying to do with this router -- it is certainly not configured in a
way that would be expected to work.
I'll explain it again then.
I have DHCP IP's being assigned to the wired interfaces so let's forget about those.
I had wifi configured wrong because I overlooked a couple of things but it's fine now.
The wifi now has its own static IP.
All I am wanting is to have DHCP IPs offered to wifi clients connecting to this router now.
My question was originally about udhcp showing up then no longer showing up after making very minor changes to wifi only.
Not sure why that is not clear? I'm also not sure how to explain it any other way but happy to try if you tell me which parts you do understand :).
I'm saying that because you've got your interface defined as br-wan.
It can work the same way, of course, but it is just bad form.
If you simply reset your router to defaults, that will get you what you want with no further configuration needs except to enable wifi (and provide an SSID and password).
But to explain the reason it's not working: you don't have a DHCP server configured, so it cannot provide any DHCP addresses to the client devices.
Is there a reason you don't want to reset to defaults? that is the fastest way to fix your issues.
The question is long lost.
At this point, I just need to configure a DHCP server for the wifi clients.
That's not an issue, I'll do that but the question was really about the udhcp service.