Professional Documents
Culture Documents
Nerd Quickies
A growing knowledge database
Home
Recently I had to connect a device to my network that could be only connected via network wire.
Unfortunately there was no access to a switch or something similar nearby. But my network (of
course) has a wifi access point that my device could connect to if it would have a wifi adapter.
So how could I connect my device to the network as if it was connected by wire? It should behave
just like a normal network client and for example get an ip address via DHCP, have the ability to
connect to other LAN clients etc.
Read on to see how you could setup such a bridge easily even using a GUI (LuCI) most of the times.
Notes
What we setup here is basically a routed client as described here:
https://wiki.openwrt.org/doc/recipes/relayclient. It is called a pseudobridge in the article because
technically it is a router pimped by some software to act like a bridge.
Whenever I refer to the ‘router’ I mean the TP-Link TL-WR841N device we are working on and not
some router that may exist in your network.
Hardware
For my solution I use the very cheap and simple router TP-Link TL-WR841N. On this device you
can easily install the custom firmware that we will need.
Prerequisites
In order to be able to do the setup you need a few things:
2. Reset (optional)
If you just installed the custom firmware you may ommit this step. But if you already twiddled with it
or need to reset because you messed something up, just do this:
Now your device is reset to OpenWrt defaults and we can start to configure our LAN/WLAN bridge.
3. First steps
Connect your desktop/laptop via network cable to the router using port 1
Ensure, that your computer isn’t connected to any other network, e.g. via WLAN
On your computer enable DHCP for your ethernet device
On your computer open a browser window and visit http://192.168.1.1 which is the
GUI/frontend of your OpenWrt router
Initially there is no password set, so be sure there is no password in the password field and
click Login
From now on your router is reachable with its new address 192.168.15.1. Because we disabled the
DHCP server your computer will not get a new ip address automatically. You have to set it manually
now:
Give your computer a new ip address that belongs to the new subnet. I gave the ethernet
adapter of my notebook the ip address 192.168.15.2
In your web browser go to http://192.168.15.1 which is the new URL of the router frontend
Login in with username root and your password
Go to Network/Diagnostics
Click on Ping
# ssh root@192.168.15.1
# opkg update
Install the LuCI package for the relay protocol so we can use it in the web frontend.
Important: Please note that the URL has to use http:// instead of https://
Activate relayd:
# /etc/init.d/relayd enable
# exit
8. Configure
bridge via web
GUI
Open your browser and
visit http://192.168.15.1
again.
Login in with username
root and your password
In the menu go to
Network/Interfaces
Click Add new device
In the Name of the new interface field enter stabridge
In the Protocol of the new interface dropdown choose Relay bridge
Click Submit
In the Relay between networks section check lan: and wwan:
Click Save & Apply
The result is that my central DHCP server gave me a new ip address and I have full access to the
internet and all devices in my local network.
Exactly what I wanted. This way I can extend my network to wire-only devices even when there is no
network socket available.
Mission complete
Closing remarks
Remember that the configured router has the static ip address 192.168.15.1 which is very likely not
reachable in the local network, e.g. because it has subnet 192.168.1.0/24. If you want to access the
router itself, e.g. to make changes to the configuration like connecting to a different wifi network you
would have to set the ip of your computer to 192.168.15.2 so it would be able to connect to
192.168.15.1. Additionally the router is configured to ask for an own ip address via DHCP. So you
may lookup the address and connect to that ip. This works from any device in the network but the
ones that are connected directly to the ports of the router.
Posted in Hardware, Networking Tagged with: bridge, LuCI, network, OpenWrt, WLAN
Philipp says:
November 4, 2017 at 8:45 pm
I’d like to have a wired instead of wireless bridge. I have network jacks upstairs and would like
stronger wifi there. The wifi there should be the same SSID as downstairs.
So the main wifi cable modem downstairs is the DHCP server and the access point upstairs is
transparent. Kind of like being in a company or hotel with the same wireless network everywhere.
Reply
Nerd Admin says:
November 6, 2017 at 3:27 pm
This should be basically just a plain setup of an access point like described in the openwrt
wiki: https://wiki.openwrt.org/doc/recipes/dumbap
I use this configuration at my home, too. Depending on the devices that use the wifi
handover may not be perfectly seamless but for me it is a good and cheap solution to cover
my whole house with good wifi.
Reply
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name *
E-mail *
Website
Post Comment
Legal Disclosure / Impressum Privacy Policy