I asked ChatGPT (version 2023-03-14) some questions. Here the conversation:
Me:
"Is it possible to make a "main router > wifi > repeater > wifi > client" configuration work with the OpenWrt software without having to use relayd or wds? If yes, how?"
ChatGPT:
Yes, it is possible to configure a "main router > wifi > repeater > wifi > client" network topology without using relayd or WDS in OpenWrt.
You can achieve this configuration using the following steps:
1. Configure the main router as a regular wireless access point, and configure a separate subnet for the wireless clients.
2. Configure the repeater to connect to the main router's wireless network, and bridge its wireless and Ethernet interfaces.
3. On the repeater, create a new VLAN interface for the client network and assign it to the bridge.
4. Configure the client device to connect to the new VLAN interface.
Here's an example configuration using the LuCI web interface:
1. Configure the main router:
- Set up the wireless network with WPA2-PSK encryption and a separate subnet (e.g. 192.168.2.0/24).
- Configure the LAN interface with an IP address in the main router's subnet (e.g. 192.168.1.1/24).
- Enable DHCP server on the LAN interface.
2. Configure the repeater:
- Set up the wireless network to connect to the main router's network.
- Create a new bridge interface (e.g. br-lan) and add both the wireless and Ethernet interfaces to it.
- Create a new VLAN interface (e.g. vlan2) and assign it to the bridge interface.
- Configure the VLAN interface with an IP address in the client network's subnet (e.g. 192.168.2.1/24).
- Enable DHCP server on the VLAN interface.
3. Configure the client device:
- Connect to the repeater's wireless network.
- Configure the network settings to obtain an IP address automatically (DHCP client).
With this configuration, the client device should be able to connect to the Internet through the main router and the repeater, without using relayd or WDS.
(ā Comment: Is this plausible? I personally have no experience with VLANs!)
Me:
How can I do "Create a new VLAN interface (e.g. vlan2) and assign it to the bridge interface."?
ChatGPT:
You can create a new VLAN interface and assign it to a bridge interface in OpenWrt using the following steps:
Log in to your OpenWrt router's web interface (LuCI) or SSH into the router.
Navigate to the "Network" section and click on "Interfaces".
Click the "Add new interface" button.
Enter a name for the new VLAN interface (e.g. vlan2) and select "VLAN" as the protocol. Click "Create interface".
In the "VLAN ID" field, enter a VLAN ID number that is not currently in use on your network. You can use any value between 1 and 4094, but it's a good practice to use a number above 1000 to avoid conflicts with standard VLANs.
Select the physical interface that the VLAN will be associated with (e.g. the LAN or WAN port on the router).
Click "Save & Apply".
Now that the VLAN interface has been created, you can add it to a bridge interface. Go to the "Network" section and click on "Switch".
Under "Existing VLANs", select the VLAN interface that you just created (e.g. vlan2) and click "Edit".
In the "Ports" section, select the bridge interface that you want to add the VLAN to (e.g. br-lan) and click "Add".
Click "Save & Apply" to confirm the changes.
After completing these steps, the VLAN interface should be associated with the bridge interface and any devices connected to that VLAN should be able to communicate with the rest of the network.
Me: For "Enter a name for the new VLAN interface (e.g. vlan2) and select "VLAN" as the protocol. Click "Create interface".", I cannot find "VLAN" as protocol. Do I have to install a plugin for this?
ChatGPT:
If you cannot find the "VLAN" option under the protocol selection menu when adding a new interface, it's possible that the VLAN package is not installed on your OpenWrt router.
To install the VLAN package, you can SSH into your router and run the following command:
sql
opkg update
opkg install kmod-8021q
This will install the necessary kernel module and tools for VLAN tagging on your router.
Once the package is installed, you should be able to create a new VLAN interface by following the steps I outlined earlier:
Log in to your OpenWrt router's web interface (LuCI) or SSH into the router.
Navigate to the "Network" section and click on "Interfaces".
Click the "Add new interface" button.
Enter a name for the new VLAN interface (e.g. vlan2) and select "VLAN" as the protocol.
Enter a VLAN ID number that is not currently in use on your network.
Select the physical interface that the VLAN will be associated with (e.g. the LAN or WAN port on the router).
Click "Save & Apply".
After completing these steps, you should be able to assign the VLAN interface to a bridge interface as needed.
Me: What other plugins are needed to make this configuration work apart from the default packages?
To make the "main router > wifi > repeater > wifi > client" configuration work with OpenWrt, you will need to install some additional packages in addition to the default packages that come with OpenWrt.
Here are some of the packages that you may need to install:
wpad-basic or wpad-full: These packages provide support for wireless access points and clients, and are necessary for setting up the wireless interfaces on the main router and the repeater.
relayd: This package provides support for relaying network traffic between two wireless interfaces, and is necessary for setting up the repeater interface.
kmod-bridge: This package provides support for creating and managing network bridges, which are necessary for connecting the VLAN interfaces to the wireless interfaces.
kmod-8021q: This package provides support for VLAN tagging, which is necessary for creating VLAN interfaces.
luci-app-firewall: This package provides a web interface for configuring the firewall on your OpenWrt router, which you may need to modify to allow traffic to flow between the VLAN interfaces and the wireless interfaces.
You can install these packages using the following command:
opkg update
opkg install wpad-basic relayd kmod-bridge kmod-8021q luci-app-firewall
Note that the specific packages you need may vary depending on your hardware and configuration. You may also need to install additional packages depending on your network setup and requirements.
Me: Why do we need relayd?
ChatGPT:
Relayd is a package that provides support for relaying network traffic between two wireless interfaces. In the "main router > wifi > repeater > wifi > client" configuration, relayd is necessary for setting up the repeater interface.
The repeater interface works by connecting to the main router's wireless network, and then relaying traffic between the wireless clients connected to the repeater and the main router. Without relayd, the repeater interface would not be able to relay traffic between the wireless interfaces.
Relayd is also useful because it allows the repeater interface to use the same IP subnet as the main router's wireless network. This means that devices connected to the repeater interface will appear to be on the same network as devices connected to the main router's wireless network, and will be able to communicate with each other without any special routing or firewall rules.
Overall, relayd is an important package for setting up wireless repeater interfaces in OpenWrt, and is necessary for the "main router > wifi > repeater > wifi > client" configuration to work.
I was thinking of at least trying it, but i am running a snapshot build right now and cannot install another package without having to sysupgrade i think
So might take me a few days, if ever. I personally am curently using a relayd configuration.
PS: Here the OpenWrt docs about VLAN: https://openwrt.org/docs/guide-user/network/vlan/switch_configuration#vlan