wiki:OpenWrt/wireless/wireless_bridge

This information has been tested and created for use on the Gateworks Single Board Computers (SBCs), specifically the Ventana family that utilizes the Freescale i.MX6 processors.

Gateworks SBCs can be viewed at the following link: http://www.gateworks.com

http://trac.gateworks.com/raw-attachment/wiki/OpenWrt/wireless/relayd/gw5100realsmall.png

Wireless Bridge using OpenWrt

One of the most common applications of our products is to create a robust Wireless layer2 bridge to wirelessly bridge two LAN segments together.

In order to bridge at layer2 you must use WDS (Wireless Distribution System). Note that if you wish to bridge a LAN segment wirelessly to an existing AP that does not have WDS (or uses an incompatible form of WDS) you can use the relayd (relay daemon) configuration described here. Quite simply all you need to do is configure one end to be an Access Point with WDS support, and the other end to be a Client with WDS support. You can use encryption if you desire just make sure that all nodes are configured with the same SSID and encryption settings. Note that you can have one or more Client nodes using this configuration.

OpenWrt Default Configuration Notes:

  • by default eth0 and eth1 are in a bridge by the name of 'br-lan' (OpenWrt network interface 'lan')
  • by default wireless interfaces are disabled
  • by default br-lan is configured as static ip: 192.168.1.1/255.255.255.0
  • by default 1st radio is configured as an ap with SSID=OpenWrt no encyrption an part of the 'br-lan' interface
  • some of the UCI commands below set the same thing as the default but I've put them there for clarity

Wireless Bridge Configuration

Via Luci Web-admin

You can use the Webadmin to make changes and 'Apply' them with the 'Apply' button, yet those changes are not saved to UCI until you hit the 'Save & Apply' button which will do a 'uci commit'. Up until that point you can 'Revert' them with the 'Revert' button. At any time you can view usaved uci changes by clicking on 'Unsaved Changes' at the top left of the admin GUI (admin/uci/changes)

Access Point Node:

  • Set the Interface Configuration 'Mode' Under admin/network/wireless/radio0.network1/ Interface Configuration General Setup tab to 'Acces Point (WDS)'
  • Configure channel/SSID/encryption as desired

Cient Node(s):

  • Set the Interface Configuration 'Mode' Under admin/network/wireless/radio0.network1/ Interface Configuration General Setup tab to 'Client (WDS)' for the Client
  • Configure channel/SSID/encryption as desired

Via UCI command-line

UCI commands via commandline require serial console or telnet/ssh access but make it simple to describe and cut-n-paste.

The following example uses:

  • static IP 192.168.1.1 for AP
  • static IP 192.168.1.2 for Client
  • SSID=OpenWrt
  • No Encryption

Access Point Node:

uci set system.@system[0].hostname=test_ap
uci set network.lan.ipaddr=192.168.1.1
uci set wireless.@wifi-iface[0].mode=ap
uci set wireless.@wifi-iface[0].ssid=OpenWrt
uci set wireless.@wifi-iface[0].encryption=none
uci set wireless.@wifi-iface[0].wds=1
uci set wireless.radio0.disabled=0
uci set wireless.radio0.macaddr=
uci set wireless.radio0.phy=phy0
uci commit

Client Node(s):

uci set system.@system[0].hostname=test_sta
uci set network.lan.ipaddr=192.168.1.2
uci set wireless.@wifi-iface[0].mode=sta
uci set wireless.@wifi-iface[0].ssid=OpenWrt
uci set wireless.@wifi-iface[0].encryption=none
uci set wireless.@wifi-iface[0].wds=1
uci set wireless.radio0.disabled=0
uci set wireless.radio0.macaddr=
uci set wireless.radio0.phy=phy0
uci commit

Notes:

  • the point of setting the macaddr= and phy=phy0 above is to allow the firmware to not be dependent on what radio you load on it. By default OpenWrt tracks radio configuration by the macaddr of the radio which causes configuration differences if you swap radios later. This is completely optional.

Files

This is the same as the UCI, but just in file form:

  • The AP (access point)
    root@OpenWrt:/# cat /etc/config/wireless 
    config wifi-device  radio0
            option type     mac80211
            option channel  11
            option hwmode   11g
            option path     'soc0/soc.0/1ffc000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:05.0/0000:05:00.0'
            option htmode   HT20
    
    
    config wifi-iface
            option device   radio0
            option network  lan
            option mode     ap
            option wds      1
            option ssid     OpenWrt
            option encryption none
    
    
  • The client, AKA Station
    root@OpenWrt:/# cat /etc/config/wireless 
    config wifi-device  radio0
            option type     mac80211
            option channel  11
            option hwmode   11g
            option path     'soc0/soc.0/1ffc000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/0000:02:05.0/0000:05:00.0'
            option htmode   HT20
    
    
    config wifi-iface
            option device   radio0
            option network  lan
            option mode     sta
            option wds      1
            option ssid     OpenWrt
            option encryption none
    
Last modified 7 years ago Last modified on 10/22/2017 05:28:45 AM

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.