FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)

Wi-Fi Расширитель/Репитер с relayd

Эта статья описывает как превратить OpenWrt роутер в Wi-Fi Расширитель/Репитер. Расширитель устанавливает “входящее” Wi-Fi соединение к главному роутеру с одним из своих радио-модулей, и действует как AP (access point) для локальных устройств с другим его радио-модулем. Затем Extender использует пакет “relayd” для создания моста между двумя соединениями.

Для простоты в этой статье отныне будет использоваться термин “Wi-Fi extender” или “удлинитель”.

Используйте эту конфигурацию в ситуациях когда вы не можете контролировать главный роутер, или когда на главном роутере нету OpenWRT, или когда главный роутер не поддерживает предпочтительный

Wireless Repeater/Extender with WDS or 802.11s Mesh Networking.

Фото ниже показывает нормальную конфигурацию.Главный роутер находится справа: Это LAN порт (192.168.1.1/24) обслуживает локальных клиентов когда этот WAN порт (не показан) подключается к интернету. Wi-Fi расширитель находиться слева. Это создаёт беспроводное входящее соединение (называется “W-LAN (Client)”) до главного роутера. Wi-Fi расширители других радио-модулей выступает в качестве точки доступа для локальных устройств.

Есть видео на Youtube, которое в основном показывает эту процедуру: https://www.youtube.com/watch?v=Bfmx5NjIWLQ Который был тестирован на: OpenWrt 23.05.3 (June 2024).



В этой статье предполагается, что основным адресом маршрутизатора является 192.168.1.1 (подсеть 192.168.1.0/24) И «подсеть расширителя Wi-Fi» - 192.168.2.1 (192.168.2.0/24).

Эти подсети ДОЛЖНЫ быть разными.

  • Удаляем все проводные соединения между расширителем Wi-Fi и основным маршрутизатором.
  • Подключите компьютер с Ethernet к порту LAN на удлинителе Wi-Fi и войдите в веб-интерфейс LuCI по адресу 192.168.1.1 (адрес по умолчанию)
  • (Опционально) Обновите прошивку Wi-Fi расширителя до текущего релиза.
  • На System → Backup/Flash Firmware нажмите Выполнить сброс, чтобы вернуться к настройкам OpenWrt по умолчанию.
  • Заходите в Network → Interfaces, нажмите edit для LAN интерфейса
  • Поставте LAN protocol в static address, нажмите Change protocol (изображение снизу)
  • Назначьте IP-адрес с помощью «подсети расширителя Wi-Fi» (например, 192.168.2.1).
  • Нажмите Save
  • Нажмите Save and Apply




  • Переподключитесь к расширителю на его новый АЙПИ адрес(например 192.168.2.1)
  • С Network → Interfaces, нажмите Edit для LAN интерфейса
  • Нажмите на DHCP Server tab и выключите DHCP, IPv6 RA-Service, и DHCP-v6 Service. Сделайте это:
    • На General Setup tab (изображение снизу), поставьте галочку в “Ignore interface” окно что бы отключить DHCP для интерфейса.
    • На IPv6 Settings tab (изображение снизу), выберите “disabled” для RA-Service и DHCP-v6 Service
  • Нажмите Save.
  • Нажмите Save and Apply.
  • Наконец, настройте ваш PC's Ethernet порт что бы использовать статический IP в Wi-Fi расширителе подсети (например, 192.168.2.10) и обычный выход (например, 192.168.2.1), затем используйте Ethernet что-бы подключиться заново к расширителю.






Расширитель, как правило, имеет несколько радиостанций, которые могут служить в качестве восходящей линии связи. Выберите один который работает лучше для вашего использования. 5GHz (n/ac/ax) радио-модуль имеет высокую скорость передачи, но 2.4GHz (b/g/n) радио-модуль имеет большее покрытие.

  • Остовляйте ваш PC подключенным к Wi-Fi расширителю с помощью Ethernet. Удалите любые другие физические подключения.
  • Идите в Network → Wireless страницу
  • Выберите радио-модуль для входящего до главного роутера.
  • Нажмите на Scan кнопку для этого радио-модуля.



  • С листа SSIDs найденных в процессе сканирования, выберите главного роутера Wi-Fi SSID и нажмите Join Network.




  • Вы будете видеть “Joining Network” кнопку (изображение ниже).
    • Настройте “Название для новой сети” для wwan
    • Введите любые Wi-Fi настройки например, пароль WPA
    • Выберите lan firewall zone.
  • Нажмите Save.
  • Нажмите Save & Apply.




Вы будете видеть страницу настройки клиентского Wi-Fi (изображение снизу). Редактирование требуется. Самая важная настройка здесь это Operating Frequency линия.

  • Поставте Mode на Legacy если вы подключены к Wi-Fi g сеть, или N если вы подключены к Wi-Fi n (и так далее).
  • Поставте Width на тот же самый ширина канала как у основного маршрутизатора
  • Сохраните тот же номер канала Wi-Fi, который был обнаружен во время сканирования. Это будет соответствовать основному маршрутизатору.
  • Нажмите Save когда закончится.
  • Нажмите Save & Apply.



Хотя это необязательно, рекомендуется удалить избыточные интерфейсы WAN и зоны брандмауэра.

  • Идите в Network → Interfaces (изображение снизу)
  • Удалите оба WAN и WAN6 интерфейсы.
  • Идите в Network > Firewall (изображение ниже)
  • Удалите wan правило.
  • Нажмите Save & Apply

Заметка: Эти действия также автоматически удалят любой избыточный трафик брандмауэра и правила пересылки портов.





Назначьте статический IP-адрес недавно созданному интерфейсу wwan

Это в той же подсети, что и локальная сеть основного маршрутизатора (например, 192.168.1.30). Затем вы можете управлять маршрутизатором, используя этот адрес

Которые также будут использоваться позже при создании интерфейса Relay.

  • Идите в Network → Interfaces (изображение ниже)
  • Нажмите Edit для wwan интерфейса



  • В General Settings вкладке, измените протокол на 'Static Address' (изображение ниже)
  • Введите IP-адрес из подсети локальной сети основного маршрутизатора (например, 192.168.1.30); маску подсети (например, 255.255.255.0); и IP-адрес шлюза (например, 192.168.1.1)



  • Во Advanced Settingsвкладке (изображение ниже)
  • Поставте Use custom DNS Servers для IP адреса главного роутера (например, 192.168.1.1).
  • Нажмите Save
  • Нажмите Save & Apply



На этом этапе расширитель Wi-Fi должен быть беспроводно подключен к основному маршрутизатору. Для подтверждения соединения:

  • Идите в Network → Diagnostics (изображение ниже)
  • Выполните тест на пинг, нажав кнопку «IPv4 Ping».

* Через несколько мгновений вы должны увидеть результаты пинга, если основной маршрутизатор подключен к Интернету.



  • Идите в System → Software (Изображение снизу)
  • Нажмите Update List кнопку. Если расширитель Wi-Fi подключен к основному маршрутизатору, и он подключен к Интернету, через несколько минут появятся результаты обновления.
  • Введите luci-proto-relay в блок фильтр (изображение снизу), и нажмите Install.
  • Когда тот закончит, перезагрузите роутер с System → Reboot (изображение ниже).





Добавьте relayd интерфейс Который будет между мостом и расширителем lan и wwan интерфейс. Сделайте это:

  • Перейдите в Network → Interfaces
  • Нажмите на Add New Interface (Изображение ниже)



  • В Add new interface окне (изображение ниже)
    • Введите имя (“repeater_bridge” это хороший выбор)
    • Выберите Relay bridge протокол который показан ниже. (Перезагрузите ваше устройство если Relay bridge инструкция не появляется.)
  • Нажмите Create Interface



  • В Network → Interfaces, нажмите Edit для нового “repeater_bridge” интерфейса (изображение ниже)
    • Убедитесь что Protocol является “Relay bridge”
    • Введите IP адрес назначенный для wwan интерфейса. (Например 192.168.1.30)
    • Выберите оба lan и wwan в Relay between networks выборочном блоке.
  • Нажмите Save.
  • Нажмите Save & Apply.
  • После того как вы выполнили эти шаги, reboot роутер.



Включите и настройте Wi-Fi расширитель быть точкой доступа для локальных устройств.

Вы можете использовать одно и то же имя сети Wi-Fi (SSID) и шифрование, пароль и т. д. Настройки как у вашего основного маршрутизатора.

Это позволяет беспроводным устройствам переходить в лучшую сеть Wi-Fi. В качестве альтернативы, вы также можете выбрать другой расширитель Wi-Fi Учетные данные SSID/шифрования/пароля от основного маршрутизатора.

  • Идите в Network → Wireless
  • Нажмите Edit кнопку для любых SSID с “Mode: Master”. (Не изменяйте “Mode: Client” входящее подключение до главного роутера.)
    • В Interface Configuration секции, настройте SSID, защита и другие параметры как Wi-Fi расширитель может быть как access point.
    • Если вы настраиваете радио-модуль Который также служит в качестве соединения по восходящей линии связи, убедитесь, что RAM остается прежней.
    • Нажмите Save
  • Enable тот беспроводной интерфейс.
  • Вы можете изменить/включить другие радио-модули (для примера, включите оба b/g/n и n/ac/ax/и другие радио модули)
  • Надмите Save & Apply.

You're done! The Wi-Fi extender should be extending the network from your main router. Change your computer back to DHCP client mode and connect to the newly-configured Wi-Fi. Your computer should be fully on the internet, having acquired a DHCP IP address from your main router.

The Status → Overview window (image below) shows the final result. radio1 is a DHCP client to the main router. The client Wi-Fi has a ? in the Host column instead of a IP address because its wwan IP address is only visible in the Network Interfaces page. In the image below,radio0 (the access point) had not been configured/enabled yet. But it would show the SSID that you configured for the extender.



Before doing any actual configuration, the Wi-Fi interface must be enabled in order to scan for networks in the vicinity:

uci set wireless.@wifi-device[0].disabled="0"
uci commit wireless
wifi
  • Set the disabled option to 0 (to enable wireless)
  • Save changed configuration file
  • Start wireless using the wifi command

Now we can list networks in range using iw dev wlan0 scan, substituting your actual wireless interface for wlan0 if different (ifconfig lists all available interfaces to find how your wlan is called)

iw dev wlan0 scan output example:

# iw dev wlan0 scan
BSS c8:d5:fe:c8:61:b0(on wlan0) -- associated
        TSF: 24324848870 usec (0d, 06:45:24)
        freq: 2412
        beacon interval: 100 TUs
        capability: ESS (0x0411)
        signal: -72.00 dBm
        last seen: 140 ms ago
        Information elements from Probe Response frame:
        SSID: Violetta
        RSN:     * Version: 1
                 * Group cipher: CCMP
                 * Pairwise ciphers: CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)
BSS f8:35:dd:eb:20:f8(on wlan0)
        TSF: 24225790925 usec (0d, 06:43:45)
        freq: 2457
        beacon interval: 100 TUs
        capability: ESS (0x0431)
        signal: -90.00 dBm
        last seen: 1450 ms ago
        Information elements from Probe Response frame:
        SSID: GOinternet_EB20FB
        HT capabilities:
                Capabilities: 0x11ee
                        HT20/HT40
                        SM Power Save disabled
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT RX MCS rate indexes supported: 0-15, 32
                HT TX MCS rate indexes are undefined
        HT operation:
                 * primary channel: 10
                 * secondary channel offset: below
                 * STA channel width: any
        RSN:     * Version: 1
                 * Group cipher: TKIP
                 * Pairwise ciphers: TKIP CCMP
                 * Authentication suites: PSK
                 * Capabilities: 1-PTKSA-RC 1-GTKSA-RC (0x0000)

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.

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 Wi-Fi scan above.
For an explanation of why these values were changed, please read the luci tutorial above.

network.lan.ipaddr='192.168.2.1'
network.repeater_bridge=interface
network.repeater_bridge.proto='relay'
network.repeater_bridge.network='lan wwan'
network.wwan=interface
network.wwan.proto='dhcp'
firewall.@zone[0].network='lan repeater_bridge wwan'
dhcp.lan.ignore='1'
wireless.radio0.hwmode='11g'
wireless.radio0.country='00'
wireless.radio0.channel='1'
wireless.radio0.disabled='0'
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device='radio0'
wireless.@wifi-iface[0].mode='ap'
wireless.@wifi-iface[0].encryption='none'
wireless.@wifi-iface[0].ssid='OpenWrt'
wireless.@wifi-iface[0].network='lan'
wireless.@wifi-iface[1]=wifi-iface
wireless.@wifi-iface[1].network='wwan'
wireless.@wifi-iface[1].ssid='Violetta'
wireless.@wifi-iface[1].encryption='psk2'
wireless.@wifi-iface[1].device='radio0'
wireless.@wifi-iface[1].mode='sta'
wireless.@wifi-iface[1].bssid='C8:D5:FE:C8:61:B0'
wireless.@wifi-iface[1].key='myWifiPasswordHere'

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.
You will likely want to set up your device's Wi-Fi network in a more secure way, as explained in the Wi-Fi setup page here.

As an alternative to using relayd, you might consider using simple wireless client if a bridged network is not required. The Wi-Fi extender can be managed through its static wwan IP address (eg. 192.168.1.30)

Even though all end devices on the Wi-Fi extender will get a DHCP address from the main router's LAN subnet, the LAN interface of the Wi-Fi extender MUST be on a different subnet for relayd to work (since it is routing traffic, it expects 2 different subnets).

Since both ethernet ports and Access Point Wi-Fi network are on the same LAN interface, all clients connecting to the Ethernet ports and to the Access Point Wi-Fi network of the Wi-Fi extender device will be routed by relayd and will be connected to your main network.

The LAN interface subnet will be used only as a “management” interface, as devices connecting to the Wi-Fi repeater will be on the main network's subnet instead. If the relayd device becomes unreachable, you will have to configure a PC with a static address in the same subnet as the LAN interface (eg. 192.168.2.10 for our example) to connect and be able to use LuCI GUI or SSH.

If you find the Wi-Fi extender itself is only accessible from 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 Local IPv4 address setting in the Relay bridge interface matches the ip address of the wireless uplink. (The alternative is tedious: It is possible to access the OpenWrt box via its 192.168.2.1 address if you manually configure your computer to that subnet.)

:!: The following part of the configuration should not be necessary. The default operations should have changed them automatically. In case something isn't working, check this too.




----

FIXME Below “IPv6 support” method seems not working. The wan interface has been removed per previous steps. Most probably we will fail on uci commands below. :-?

Activate IPv6 support on your main router to get you a public IPv6 prefix. Activate IPv6 on our Wi-Fi extender to allow for Stateless Address Autoconfiguration (SLAAC) of your public IPv6 addresses and IPv6 traffic.

1. Go to Network / Interfaces and create a new interface. Name it WWAN6, using protocol DHCPv6, cover the WWAN interface. In the Common Configuration of the new interface, configure: Request IPv6 address: disabled. In the Firewall settings: check that the “lan / repeater bridge…” line is selected. Leave the other settings by default, especially, leave the “Custom delegated IPv6-prefix” field empty. On the Interfaces / overwiew page check that the WWAN interface gets a public IPv6 address.

2. Edit the LAN interface settings, DHCP server / IPv6 settings: check/modify the following settings: Router Advertisement Service: relay mode, DHCPv6 service: disabled, NDP-Proxy: relay mode.

3. Open a SSH session on your OpenWrt device. Issue the following commands:

uci set dhcp.wan.interface=wwan
uci set dhcp.wan.ra=relay
uci set dhcp.wan.ndp=relay
uci set dhcp.wan.master=1
uci commit

We assume that you chose the wwan name when you joined to the other Wi-Fi network as suggested earlier in this guide. If not, change the dhcp.wan.interface=… line accordingly.

That's it. Restart ophcpd (System → Startup or service odhcpd restart) and your IPv6-network should begin to configure itself. Connected IPv6-enabled devices should get their public IPv6 addresses, derived from your public IPv6 prefix, and IPv6 traffic should go through your Wi-Fi extender.

Here are a list of some recently reported issues:

  1. DHCP issue caused by Access Point. OWrt forum
  2. Extremely poor upstream transfer speeds with some MT762x devices. Owrt forum Bug Report FS#2816
  3. Additional instruction for backdoor to router since once dhcp is disabled on LAN, the router become unreachable. This may occur if there are changes to the wireless access point. eg. wifi SSID, channel number or security passphrase has changed.
    1. Connect a computer using ethernet cable to LAN port of the Wifi bridge.
    2. Configure a static IP address on the computer. eg. if the Wifi bridge uses LAN IP address of 192.168.2.1 in above example, use static IP address: 192.168.2.10.
    3. Access LuCI at 192.168.2.1 for above example.
  4. Alternative detailed Relayd setup instructions can also be found in section 9.10 of the 1-OpenWrt-LEDE Installation Guide for HH5A
  5. IPv6 on macOS 10.15+ does not work with a ULA prefix set on LAN https://github.com/openwrt/openwrt/issues/7561

Comment: This looks like the basic instructions for configuring a simple wireless client

This method basically puts a second Wi-Fi router in cascade on the first one; i.e. usually this means that the extender's clients will be behind double NAT.

It's like connecting with a cable the WAN port on the Wi-Fi extender to the LAN ports of the main router, the Wi-Fi 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.

prerequisites: - router with two initial interfaces (LAN, WAN)

Setup with WebUI:

  • Go in the Network → Interfaces page, click on edit lan interface,
  • Set LAN as static IPv4 address as 192.168.x.1 (with x different from the network to which you will connect via Wi-Fi),
  • Go in the Network → Wi-Fi, click on scan and choose the “network” link and click “Join Network”.
  • Enter the Wi-Fi password, leave the “name of new network” as “WWAN” and select WWAN (or WAN) firewall zone. Click Save,
  • Go in the Network → Interfaces page, click on edit wwan interface,
  • Move to the Firewall tab. Click on Save and Apply.
  • Go in the Network → Firewall, click edit in wan zone and check WAN and WWAN in “covered networks”, click save and apply,

Now you've correctly bounded WWAN with WAN, and consequently WWAN with LAN.

This section collects all the uncertain statements and provisos from earlier in this document. Any that are still valid should be moved to the relevant section.

Using relayd as instructed in this article isn't guaranteed to work with all Openwrt compatible devices or wifi networks - use only as a last resort.

If supported by both devices, consider using preferred Wireless Repeater/Extender with WDS or 802.11s Mesh Networking.

If vlan support is required you can use Layer 2 GRE tunnels (“gretap”).

The most common problem is that the client router cannot pass the DHCP message between the main router and the client connected to the client router. Currently it seems to be the hardware/SOC limitation (related to MAC cloning?)

Instead of relayd it should be possible to use kmod-trelay, the only information about using it can be seen in its source code, if you used it successfully please add a section for it in this article.

In this article you will see how to configure your device to become a Wi-Fi extender/repeater/bridge.

In some cases, the wireless drivers used in OpenWrt do not support “Layer 2” bridging in client mode with a specific “upstream” wireless system. When this occurs, one approach is to route the traffic between LAN and the upstream wireless system. Broadcast traffic, such as DHCP and link-local discovery like mDNS are generally not routable.

When other options don't work, the relayd package implements a bridge-like behavior for IPv4 (only), complete with DHCP and broadcast relaying. This configuration can be done through SSH (remote terminal) or through Luci GUI.

This image shows an example setup. LAN interface of the relayd device MUST be on a different subnet for relayd to work (since it is routing traffic, it expects 2 different subnets).

Since both ethernet ports and Access Point Wi-Fi network are on the same LAN interface, all clients connecting to the Ethernet ports and to the Access Point Wi-Fi network of the Wi-Fi extender device will be routed by relayd and will be connected to your main network.

The LAN interface subnet will be used only as a “management” interface, as devices connecting to the Wi-Fi repeater will be on the main network's subnet instead. If the relayd device becomes unreachable, you will have to configure a PC with a static address in the same subnet as the LAN interface (eg. 192.168.2.10 for our example) to connect and be able to use LuCI GUI or SSH.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2024/12/24 11:43
  • by arsrus721