OpenWrt dhcp, wireless, network, firewall config for wifi extender, repeater

Hi everyone -

just can't get this right. it's similar to other posts on the subject, just reversed and a little bit different, so I'm getting confused easily. Could really use a guru to lift the darkness.

I would like to extend the main router's wifi to the yun (easily accomplished) and then use the yun's ethernet port to wire a third device on an IP address handed out by the main router ipv4 dhcp (proving to be painstakingly difficult).

a.)What exactly would you call this setup? Not sure if it is indeed an "extender" or a "repeater", or "bridge", or "relay" or, some combination of any of those, etc. - good golly the water is getting mucky.

Main Router <<<----- Wifi ----->>> YUN {=wired=} dhcp client on main router.
192.168.0.1 192.168.0.x 192.168.0.x
<<--easy enough-->> {= not so easy=}

It seems very much like what you see in the graphic here:

except the "Client Host 1" will be WIRED, not wireless, as shown in the graphic in the above link.

b.) After completing the steps in the above link with relayd, the yun gives dhcp addresses on the subnet. I would like it to give addresses on the primary net so the wired device on the yun is reached from my wireless laptop on the primary net on the main router.

which makes the situation same same, but different as this topic here:
https://forum.arduino.cc/index.php?topic=367481.0

any help sorting me out and squaring me up?

a.)What exactly would you call this setup? Not sure if it is indeed an "extender" or a "repeater", or "bridge", or "relay" or, some combination of any of those, etc. - good golly the water is getting mucky.

This is bridge mode.

b.) After completing the steps in the above link with relayd, the yun gives dhcp addresses on the subnet. I would like it to give addresses on the primary net so the wired device on the yun is reached from my wireless laptop on the primary net on the main router.

If the Yun gives addresses on the subnet, you should disable it's dhcp server.

1 Like

On the lan or the wan? or both?

Dhcp is disabled on the bridged lan as per the instructions in the OpenWRT link above.

Wwan is a dhcp client issued from the main net.

Bridge-Relay interface is given an ip on the main net outside the dhcp issue range of main router.

lan wwan bridge-relay and wan are in firewall zone "lan"

Not sure what to do with the "wan" setup on eth0 - this is the port the wired device is plugged into (another yun waiting for an address). I started with the wan(eth0) on a static address in the same subnet the lan is set to.

When dhcp is disabled on the wan, the wired device connects but doesn't have an address and doesn't show up in any of the gui's.

When dhcp is enabled, the device is issued an address in the subnet - but can only be reached via the subnet.

Also, when the wan is set to a static address on the main net (192.168.0.x) and outside the dhcp range issued by the main router, the wired device is issued a dhcp lease by the yun in the main router net, as is the original intention of all this. But it still can't be accessed at that address - except on the wired yun's default subnet(192.168.240.x). In which case, the address issued in the dhcp lease is accessed via the default subnet o the wired device(pretty useless for the intended purpose).

Seems like it's getting close. Can you elaborate? Any other suggestions

How can I access this wired yun on the main router net with a dhcp lease from the main router net, relayed through the wireless yun on the main router net?

On the lan or the wan? or both?

I'm not sure, I'd say both. I'm used to the command line, I don't know what the web interface is exactly doing if you choose these options.

Bridge-Relay interface is given an ip on the main net outside the dhcp issue range of main router.

"is given" means you set that manually?

Also, when the wan is set to a static address on the main net (192.168.0.x) and outside the dhcp range issued by the main router, the wired device is issued a dhcp lease by the yun in the main router net, as is the original intention of all this. But it still can't be accessed at that address - except on the wired yun's default subnet(192.168.240.x). In which case, the address issued in the dhcp lease is accessed via the default subnet o the wired device(pretty useless for the intended purpose).

Where do you set that subnet? There should be no subnet anymore in bridged mode.

pylon:
"is given" means you set that manually?

yes.

pylon:
Where do you set that subnet? There should be no subnet anymore in bridged mode.

  • in LuCI Network > Interfaces > Lan > edit : I give the lan a static address subnet of say 192.168.2.1 with net mask of 255.255.255.0.

  • in LuCI Network > Interfaces > add new interface: Protocol = Relay bridge (from relayd package), I give iPv4 "Address to access local relay bridge" an address on the main net, outside of the dhcp issue range, say 192.168.0.210, and it relays between "lan" and "wwan"

-wwan is issued dhcp client address on main net 192.168.0.x

my understanding was that relayd handles the calls to the 192.168.2.x subnet and relays them automagically to the bridged wwan through the "relay bridge" interface added with the relayd package.
admittedly, I do not see how or why or by what method that happens. also, I am confused on how this package differs, relates, or compares to the "bridge interfaces" option in the Physical Settings tab of each interface.

thanks for your time and brain power!

also, maybe this will paint a picture you can see better:
uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.lan=interface
network.lan.proto=static
network.lan.netmask=255.255.255.0
network.lan.hostname=greenhouse
network.lan.ipaddr=192.168.2.1
network.lan.gateway=192.168.0.1
network.lan.dns=192.168.0.1
network.wan=interface
network.wan.ifname=eth0
network.wan._orig_ifname=eth0
network.wan._orig_bridge=false
network.wan.proto=static
network.wan.ipaddr=192.168.0.222
network.wan.netmask=255.255.255.0
network.wwan=interface
network.wwan.proto=dhcp
network.wwan.hostname=greenhouse
network.bridge=interface
network.bridge.proto=relay
network.bridge.network=lan wwan
network.bridge.ipaddr=192.168.0.210
network.@route[0]=route

At least in my boxes "lan" interface is an alias for the internal wlan0 interface, while "wan" stands for eth0 and "wwan" stands for eth1 (which isn't connected to an actual physical interface).

So you shouldn't define a separate address in the 192.168.2.x network for the WiFi interface.

I see, said the blind man.

It seems I was overcomplicating things and getting some terminology mixed up. It's functioning as intended now - but I'm still not sure how to describe its interfaces or overall topology.

Here's a network config that uses a relay-bridge interface from the relayd package to relay a wired client on the ethernet port of a Yun(wan) through that Yun's wireless client issued by the main router (wwan) to other clients on that main router.

The wired client (wan) is issued an address by the main router DHCP on the primary subnet), as is the wireless client issued to the Yun by the main router (wwan) - which means both are accessible from any device on the primary subnet. Great!

The Yun Access Point is still available for wireless clients to connect to, though I would like to relay this wireless AP through the wwan (much like the wired client) to properly issue wireless clients by dhcp on the primary subnet - when I catch my breath.

NetCon23JAN.png

The Yun Access Point is still available for wireless clients to connect to, though I would like to relay this wireless AP through the wwan (much like the wired client) to properly issue wireless clients by dhcp on the primary subnet - when I catch my breath.

Have you tried to connect to that AP? I disabled the WiFi interface in my setup (I don't use it) but that AP is still visible but don't serve clients. Does your's?

It does now! :slight_smile:

Put the AP on the secondary subnet with a different address.

Add the lan network to the relay-bridge with the wan and wwan.

Wireless clients should now grab an address via dhcp from the main Router / primary subnet through the secondary AP. This effectively extends the main router's wireless network the radius of the main wireless plus the radius of the secondary AP.

NetCon25Jan.png

So I tried updating the firmware and relayd is not an available package in the Dragino v4. Which left me so perplexed I just reverted back to v2 - where the relayd setup explained above is available and functional.

I'm guessing that's because the work it does has been swallowed up into the new version.

Mentioned here is a migration to "IoT firmware":
http://wiki.dragino.com/index.php?title=Yun_Firmware_Change_Log

Anybody have any input on all that? Has anybody successfully migrated a relayd setup to the new IoT mesh firmware. What are the differences/similarities? I really was starting to like the relayd bridge setup - surely there's advantages to the new IoT migration.