Relayd/OpenWrt as a DHCP server

Hi - I have an Home Hub 5A running 19.07 and have Relayd installed.

I tether to my phone hotspot and repeat the signal using the routers wifi radio.

It works pretty well, but the phone is the DHCP server so has a limited number of IP addresses available.

Can the config be changed to have the Openwrt router act as the DHCP server? I have tried tinkering with the configuration but setting the router as the DHCP server and tinkering with the relay and wireless network results in 'no internet' being reported by the windows wifi client. I have googled this extensively but have not found a solution.

Is what I am seeking to acheive possible with a degree of ease?

I have tried Travelmate but this does not work, again 'no internet' is reported.

that will likely depend on the phone... best to consult their support channels...

Can you put the wifi you use to connect to the phone on a new interface you create and set as WAN?

This way the Home Hub will be using the phone like a modem connected to the WAN ethernet port. The phone will only see one device on its DHCP, the Home Hub. All your devices connected to the Home Hub will be in its LAN network and use its DHCP server.

you can follow this part of the tethering tutorial https://openwrt.org/docs/guide-user/network/wan/smartphone.usb.tethering#b_web_interface

just select the wifi interface you use to connect to the phone instead than the usb0 interface you see in the tutorial.

2 Likes

The whole point of relayd is to relay DHCP requests upstream to the next router.

So don't use relayd. Instead set up a routed client and treat the phone only as a source of Internet. OpenWrt will take one IP address from the phone and route/NAT all of your users to it. This is the same whether you tether by wifi or by USB.

The routed client configuration starts with the basic lan->wan routing of the default configuration, including the default DHCP server on lan. Change the physical wan to the smartphone via wifi (or USB) instead of the inbuilt DSL modem.

2 Likes

Thanks - that was the start I needed. It is now working.

I did have to add a line to the wireless config for the station (iphone) to reference the network interfaces WWAN, wan and wan6

As an aside, I created an inteface WWAN and this also named it wlan0. I find this counter-intuitive as there seems no pointers on the LUCI iinterface as to why two names are required and the context when each should be used? I am safe to assume there is a simple explanation, but it doesn't jump out. An educated guess suggets it is because in practice there can be many references to a physical device with alternative configs? If so would handy if the name was qualified in some was with clear labelling, e.g.

Logical instance: WWAN
Physical device: wlan0

Thanks again

Thanks. I had incorrectly inferred that "Relay" was referring to the passing of network traffic and not necessarily deferring DHCP management to the router connected to the WAN

wlan0 is the name of the phyisical interface. The wifi radio.

In most devices you can create more than one wifi network using the same physical interface, and assign each wifi network to a different Luci Interface so each wifi network can go to different Luci interfaces. And network traffic on this wifi network will be isolated from the traffic on other wifi networks (or ethernet ports or whatever)

For example the Guest Network function relies on that.

If so would handy if the name was qualified in some was with clear labelling, e.g.

the physical name you see in the main Interface page on Luci is not really an important thing to pay attention to.

In many setups you will have multiple physical interfaces joined together under a single interface, and in that case you will see a bridge name there.
This does not tell you what physical interfaces are actually used.

For example the LAN interface you see in the screenshot of the tutorial https://openwrt.org/_media/docs/guide-user/advanced/image_create_new_interface_end_result.png
is using an interface called br-lan, which is a "bridge", a virtual interface that joins multiple different physical interfaces and is more or less an equivalent to what Luci calls Interfaces.

To see a list of the phyisical interfaces actually used you must open the interface properties by clicking on the Edit button and look at the Bridge Ports field/menu in the Physical settings tab.

I'm not sure where wwan got started, but it's not necessary. You can simply detach the existing wan from its default hardware (in the case of the HomeHub, the DSL modem, in routers without a modem it's an Ethernet port), and connect it to the smartphone instead. It isn't necessary to create an additional network.

Also don't assign names to wifi interfaces, it is better to let the automatic naming occur. If you do explicitly name them don't use names like 'wlan0' which could collide with automatic names.

WWAN was due to my assumption that as dsl and usb were shown as interfaces and that I was following the usb tethering instructions, replacing usb with the wireless device, I would thus require a wireless device to be present on the list of interfaces. I have now removed the WWAN inteface and it's reference in the wireless client configuration.

As to why the physical wireless interface doesn't appear in the list of physical interfaces (as would dsl, usb et al) I remain a little perplexed as it would seem entirely logical to see it listed there.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.