Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision Next revisionBoth sides next revision | ||
| zh:docs:guide-user:network:wifi:relay_configuration [2019/08/22 01:15] – created biaji | zh:docs:guide-user:network:wifi:relay_configuration [2021/07/01 09:13] – keep up to the last version biaji | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| <WRAP center round important 80%> | <WRAP center round important 80%> | ||
| - | 本文中以relayd为基础的实现不保证一定能用。\\ | + | If supported by both devices, consider using [[docs: |
| + | |||
| + | 本文中以relayd为基础的实现不保证一定能用且只适用于IPv4。\\ | ||
| 最常见的问题是,作为客户端的路由无法在主路由和连接至客户端路由的客户端(设备)之间正常传递DHCP消息。目前看来,问题在于硬件/ | 最常见的问题是,作为客户端的路由无法在主路由和连接至客户端路由的客户端(设备)之间正常传递DHCP消息。目前看来,问题在于硬件/ | ||
| 您可以考虑使用[[docs: | 您可以考虑使用[[docs: | ||
| Line 13: | Line 15: | ||
| 在本文中,您将看到如何将您的设备配置为WiFi扩展器/ | 在本文中,您将看到如何将您的设备配置为WiFi扩展器/ | ||
| - | 因为OpenWrt所用的开源无线驱动不支持客户端模式下的桥接,所以LAN和无线客户端之间的流量只能用路由来合并到一起。\\ **relayd**包借由DHCP和广播中继实现了类似桥接的行为。此配置可以通过SSH(远程终端)和Luci图形界面完成。\\ 简单起见,我们将把配置的设备称为“wifi扩展器”。 | + | 在某些情况下, |
| + | |||
| + | **relayd**包借由DHCP和广播中继在仅IPv4的环境下实现了类似桥接的行为。此配置可以通过SSH(远程终端)和Luci图形界面完成。 | ||
| + | |||
| + | \\ 简单起见,我们将把配置的设备称为“wifi扩展器”。 | ||
| \\ {{ docs: | \\ {{ docs: | ||
| - | 上图展示了一个示例配置。wifi扩展器的**LAN**接口**必须**配置为不同的子网,否则realyd无法正常工作(因为它需要两个不同的子网来进行路由)。 | + | 上图展示了一个示例配置。Wi-Fi扩展器的**LAN**接口**必须**配置为不同的子网,否则realyd无法正常工作(因为它需要两个不同的子网来进行路由)。 |
| + | |||
| + | 因为有线端口和无线网络均属于同一个**LAN**接口,所有连接至Wi-Fi扩展器有线端口和无线网络的客户端将由**relayd**进行路由,进而连接到您的主网。 | ||
| - | 因为有线端口和无线网络均属于同一个**LAN**接口,所有连接至WiFi扩展器有线端口和无线网络的客户端将由**relayd**路由至您的主网。 | + | **LAN**接口所配置的子网将只被用作“管理”网段,而连接到Wi-Fi扩展器的设备则会被分配到主网段。您必须给您的PC设置一个和**LAN**接口同网段的静态IP地址(比如192.168.2.10)以便再次连接到Wi-Fi扩展器的管理界面或SSH。\\ |
| - | The **LAN** interface subnet will be used only as a " | + | ===== 使用relayd ===== |
| + | ==== 需要安装的包 ==== | ||
| + | **relayd**包当然是必装的。如果您想使用Luci图形界面来配置您的wifi扩展器,还需要安装**luci-proto-relay**包。 | ||
| - | ===== 必须安装的包 ===== | ||
| - | You must install **relayd** package if you want to do what is discussed in this article. | ||
| - | If you want to use Luci GUI to set up your wifi extender, install **luci-proto-relay** package too. | ||
| - | ===== 使用Luci图形界面进行设置 ===== | + | ==== 使用Luci |
| - | As shown in the image above, the **LAN** interface must be set in a different subnet than the wifi network you are connecting to. | + | === LAN接口 |
| + | As shown in the image above, the **LAN** interface must be set in a different subnet than the Wi-Fi network you are connecting to. | ||
| - | Begin by configuring and enabling the normal | + | Begin by configuring and enabling the normal |
| - | If you are making a simple | + | If you are making a simple |
| But you can also choose to have a different name/ | But you can also choose to have a different name/ | ||
| - | Setting up a WiFi network at this stage is not necessary if you want a "WiFi bridge", | + | Setting up a Wi-Fi network at this stage is not necessary if you want a "Wi-Fi bridge", |
| \\ {{ : | \\ {{ : | ||
| - | Set LAN as static address 192.168.2.1 | + | * Set **LAN protocol** |
| + | * Assign an IP address in a different subnet (e.g. 192.168.2.1) | ||
| + | * Disable | ||
| + | * (May be required in certain case) set **Gateway address** and **Use custom DNS servers** using IP address of the primary router (e.g. 192.168.1.1) | ||
| + | * Save and Apply. | ||
| ---- | ---- | ||
| + | Set your PC's ethernet or Wi-Fi settings at static IP 192.168.2.10 and default gateway 192.168.2.1, | ||
| - | Set your PC's ethernet or wifi settings at static IP 192.168.2.10 and default gateway 192.168.2.1, | + | === Wi-Fi === |
| - | + | We will now set up the client | |
| - | We will now set up the client | + | |
| \\ {{ : | \\ {{ : | ||
| - | Choose the wifi network you want to connect to from the page and click "Join Network" | + | Choose the Wi-Fi network you want to connect to from the page and click "Join Network" |
| ---- | ---- | ||
| - | |||
| \\ {{ : | \\ {{ : | ||
| - | Enter the wifi password, leave the "name of new network" | + | Enter the Wi-Fi password, leave the "name of new network" |
| ---- | ---- | ||
| - | |||
| - | ---- | ||
| - | |||
| \\ {{ : | \\ {{ : | ||
| - | You will land in the client | + | You will land in the client |
| - | + | ||
| - | ---- | + | |
| - | + | ||
| - | ---- | + | |
| + | === 扩展器接口 === | ||
| Go in the **Interfaces** page, we will now add the relayd interface that will join the **lan** and **wwan** interfaces.\\ | Go in the **Interfaces** page, we will now add the relayd interface that will join the **lan** and **wwan** interfaces.\\ | ||
| Click on **Add New Interface**.\\ | Click on **Add New Interface**.\\ | ||
| Line 72: | Line 77: | ||
| \\ {{ : | \\ {{ : | ||
| - | Write a name for it (**repeater_bridge** is the name I used in the example), and then choose **Relay bridge** in the **Protocol of the new interface** field. Click **Submit**. | + | Write a name for it (**repeater_bridge** is the name I used in the example), and then choose **Relay bridge** in the **Protocol of the new interface** field. Click **Submit**. |
| + | |||
| + | You may need to reboot your device before the **Relay bridge** option appears. | ||
| ---- | ---- | ||
| - | |||
| \\ {{ : | \\ {{ : | ||
| In this new interface' | In this new interface' | ||
| - | This interface | + | This "Local IPv4 address" |
| ---- | ---- | ||
| Line 92: | Line 98: | ||
| ---- | ---- | ||
| - | After you have done this, it might be necessary to reboot the wifi extender. | + | After you have done this, it might be necessary to reboot the Wi-Fi extender. |
| \\ {{ : | \\ {{ : | ||
| Line 98: | Line 104: | ||
| This is the final result. Note how the client network has a ? instead of a IP address. | This is the final result. Note how the client network has a ? instead of a IP address. | ||
| - | ---- | + | === 防火墙 === |
| - | + | ||
| - | ---- | + | |
| :!: The following part of the configuration should not be necessary (already default options or changed automatically), | :!: The following part of the configuration should not be necessary (already default options or changed automatically), | ||
| Line 108: | Line 112: | ||
| ---- | ---- | ||
| + | :!: if you are doing this with a device that has a single radio, both Wi-Fi networks will stay on the same channel, and total bandwidth will be halved as the same radio is used for 2 different Wi-Fi networks. | ||
| - | ---- | + | ==== 用命令行进行设置 ==== |
| - | :!: if you are doing this with a device that has a single radio, both wifi networks will stay on the same channel, and total bandwith will be halved as the same radio is used for 2 different wifi networks. | + | Before |
| - | + | < | |
| - | + | uci set wireless.@wifi-device[0].disabled="0" | |
| - | ===== 用命令行进行设置 ===== | + | |
| - | + | ||
| - | Before doing any actual configuration, | + | |
| - | + | ||
| - | < | + | |
| uci commit wireless | uci commit wireless | ||
| - | wifi</ | + | wifi |
| + | </ | ||
| * Set the disabled option to 0 (to enable wireless) | * Set the disabled option to 0 (to enable wireless) | ||
| Line 131: | Line 132: | ||
| '' | '' | ||
| - | < | + | < |
| + | # iw dev wlan0 scan | ||
| BSS c8: | BSS c8: | ||
| TSF: 24324848870 usec (0d, 06:45:24) | TSF: 24324848870 usec (0d, 06:45:24) | ||
| Line 177: | Line 179: | ||
| * Pairwise ciphers: TKIP CCMP | * Pairwise ciphers: TKIP CCMP | ||
| * Authentication suites: PSK | * Authentication suites: PSK | ||
| - | * Capabilities: | + | * Capabilities: |
| + | </ | ||
| - | In the example, there are two networks, a Wifi g one called Violetta and a Wifi n one called GOinternet_EB20FB. | + | In the example, there are two networks, a Wi-Fi g one called Violetta and a Wi-Fi n one called GOinternet_EB20FB. |
| The device was configured to connect to the one called Violetta. | The device was configured to connect to the one called Violetta. | ||
| These are the uci values that were added or changed by the configuration procedure.\\ | These are the uci values that were added or changed by the configuration procedure.\\ | ||
| - | For SSID, BSSID, and encryption you must use the info you got from the wifi scan above.\\ | + | For SSID, BSSID, and encryption you must use the info you got from the Wi-Fi scan above.\\ |
| For an explanation of why these values were changed, please read the luci tutorial above.\\ | For an explanation of why these values were changed, please read the luci tutorial above.\\ | ||
| - | < | + | < |
| + | network.lan.ipaddr=' | ||
| network.repeater_bridge=interface | network.repeater_bridge=interface | ||
| network.repeater_bridge.proto=' | network.repeater_bridge.proto=' | ||
| Line 214: | Line 218: | ||
| </ | </ | ||
| - | Please note that the wifi network generated by the device in this example (the one called OpenWrt) has no password nor encryption.\\ | + | Please note that the Wi-Fi network generated by the device in this example (the one called OpenWrt) has no password nor encryption.\\ |
| This was done because the focus of this article was getting the relay bridge up and running.\\ | This was done because the focus of this article was getting the relay bridge up and running.\\ | ||
| - | You will likely want to set up your device' | + | You will likely want to set up your device' |
| - | ===== 访问OpenWrt设备 ===== | + | ==== 访问OpenWrt设备 ==== |
| + | If you find the OpenWrt device itself is only accessible from those computers directly connected to the W-LAN AP, not from the ones connected to the OpenWrt W-LAN client, when in the 192.168.1.0 subnet, Make sure the '' | ||
| + | (The alternative is tedious: It is possible to access the OpenWrt box via its '' | ||
| - | With this setup your OpenWrt device itself may only be accessible from those computers directly connected to the W-LAN AP, not from the ones connected to the OpenWrt W-LAN client only, when in the 192.168.1.0 subnet. It is however still possible to access the OpenWrt box via its '' | + | ==== Adding IPv6 support ==== |
| - | + | Activate IPv6 support on your Internet box, this will get you a public IPv6 prefix. We will now activate IPv6 on our Wi-Fi extender | |
| - | < | + | |
| - | iface eth0 inet dhcp | + | |
| - | gateway 192.168.1.1 | + | |
| - | + | ||
| - | auto eth0:1 | + | |
| - | iface eth0:1 inet static | + | |
| - | address 192.168.2.102 | + | |
| - | netmask 255.255.255.0 | + | |
| - | broadcast 192.168.2.255 | + | |
| - | </ | + | |
| - | + | ||
| - | //[If someone can describe a solution without modifications to the client network configuration that would be appreciated!]// | + | |
| - | + | ||
| - | ===== Adding IPv6 support ===== | + | |
| - | + | ||
| - | Activate IPv6 support on your Internet box, this will get you a public IPv6 prefix. We will now activate IPv6 on our WiFi Extender | + | |
| 1. Go to Network / Interfaces and create a new interface. Name it '' | 1. Go to Network / Interfaces and create a new interface. Name it '' | ||
| Line 244: | Line 234: | ||
| 3. Open a SSH session on your OpenWrt device. Issue the following commands:\\ | 3. Open a SSH session on your OpenWrt device. Issue the following commands:\\ | ||
| - | < | + | < |
| uci set dhcp.wan.interface=wwan | uci set dhcp.wan.interface=wwan | ||
| uci set dhcp.wan.ra=relay | uci set dhcp.wan.ra=relay | ||
| Line 251: | Line 241: | ||
| uci commit | uci commit | ||
| </ | </ | ||
| - | We suppose that you created a '' | + | We suppose that you created a '' |
| + | |||
| + | That's it. Restart '' | ||
| + | |||
| + | ==== Known Issues ==== | ||
| + | |||
| + | Here are a list of some recently reported issues: | ||
| + | |||
| + | - DHCP issue caused by Access Point. [[https:// | ||
| + | - Extremely poor upstream transfer speeds with some MT762x devices. [[https:// | ||
| + | - Need additional instruction for backdoor to router since once dhcp is disabled on LAN, the router become unreachable | ||
| - | That's it. Restart '' | ||
| - | ===== 支持NAT的Wifi扩展器(如果别的方法都不行)===== | + | ===== 使用NAT ===== |
| - | This method basically puts a second wifi router in cascade on the first.\\ | + | 这个方法就是单纯的将第二个无线路由配置在第一个的层级之下。\\ |
| - | It's like connecting with a cable the WAN port on the Wifi Extender to the LAN ports of the main router, the Wifi Extender creates a new network for itself and the devices connected to it, that can go on the Internet and reach devices in the LAN network of the main router. But in this case we are doing it with wireless networks instead. | + | 就好像用一根网线把Wifi扩展器的WAN接口连到主路由的LAN接口。Wifi扩展器在自身和连接至它的客户端之间创建了新的网络。此网络可以访问互联网以及主路由所在的子网。只不过我们是用无线网络来达成这个目的。 |
| - | prerequisites: | + | 先决条件: |
| - | - router with two initial interfaces (lan, wan) | + | - 路由必须由两个初始接口(lan,wan) |
| - | Setup with luci-GUI: | + | 使用luci图形界面进行设置: |
| - | * Go in the Network | + | * 至网络 |
| - | * Set LAN as static | + | * 设置LAN的静态IPv4地址为192.168.x.1。(x取决于您通过wifi连入的网络的配置) |
| - | * Go in the Network | + | * 至网络 |
| - | * Enter the wifi password, leave the "name of new network" | + | * 输入wifi密码,保留“新网络名称”为" |
| - | * Go in the Network | + | * 至网络 |
| - | * Move to the Firewall tab. Click on Save and Apply. | + | * 至防火墙标签页,点击保存并应用。 |
| - | * Go in the Network | + | * 至网络 |
| - | now you've correctly bounded | + | 至此,您已经正确的将wwan绑定至wan,也就是建立了wwan至lan的通路 |