| 1 | [[PageOutline]] |
| 2 | [[Image(WirelessBridge.png)]] |
| 3 | |
| 4 | 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. |
| 5 | |
| 6 | Gateworks SBCs can be viewed at the following link: [http://www.gateworks.com] |
| 7 | |
| 8 | [[Image(http://trac.gateworks.com/raw-attachment/wiki/OpenWrt/wireless/relayd/gw5100realsmall.png,200px)]] |
| 9 | |
| 10 | = Wireless Bridge using OpenWrt = |
| 11 | One of the most common applications of our products is to create a robust Wireless layer2 bridge to wirelessly bridge two LAN segments together. |
| 12 | |
| 13 | 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 [wiki:relayd 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. |
| 14 | |
| 15 | OpenWrt Default Configuration Notes: |
| 16 | - by default eth0 and eth1 are in a bridge by the name of 'br-lan' (OpenWrt network interface 'lan') |
| 17 | - by default wireless interfaces are disabled |
| 18 | - by default br-lan is configured as static ip: 192.168.1.1/255.255.255.0 |
| 19 | - by default 1st radio is configured as an ap with SSID=OpenWrt no encyrption an part of the 'br-lan' interface |
| 20 | - some of the UCI commands below set the same thing as the default but I've put them there for clarity |
| 21 | |
| 22 | == Wireless Bridge Configuration == |
| 23 | |
| 24 | === Via Luci Web-admin === |
| 25 | 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) |
| 26 | |
| 27 | Access Point Node: |
| 28 | * Set the Interface Configuration 'Mode' Under admin/network/wireless/radio0.network1/ Interface Configuration General Setup tab to ''''Acces Point (WDS)'''' |
| 29 | * Configure channel/SSID/encryption as desired |
| 30 | |
| 31 | Cient Node(s): |
| 32 | * Set the Interface Configuration 'Mode' Under admin/network/wireless/radio0.network1/ Interface Configuration General Setup tab to ''''Client (WDS)'''' for the Client |
| 33 | * Configure channel/SSID/encryption as desired |
| 34 | |
| 35 | === Via UCI command-line === |
| 36 | UCI commands via commandline require serial console or telnet/ssh access but make it simple to describe and cut-n-paste. |
| 37 | |
| 38 | The following example uses: |
| 39 | * static IP 192.168.1.1 for AP |
| 40 | * static IP 192.168.1.2 for Client |
| 41 | * SSID=OpenWrt |
| 42 | * No Encryption |
| 43 | |
| 44 | Access Point Node: |
| 45 | {{{ |
| 46 | uci set system.@system[0].hostname=test_ap |
| 47 | uci set network.lan.ipaddr=192.168.1.1 |
| 48 | uci set wireless.@wifi-iface[0].mode=ap |
| 49 | uci set wireless.@wifi-iface[0].ssid=OpenWrt |
| 50 | uci set wireless.@wifi-iface[0].encryption=none |
| 51 | uci set wireless.@wifi-iface[0].wds=1 |
| 52 | uci set wireless.radio0.disabled=0 |
| 53 | uci set wireless.radio0.macaddr= |
| 54 | uci set wireless.radio0.phy=phy0 |
| 55 | uci commit |
| 56 | }}} |
| 57 | |
| 58 | Client Node(s): |
| 59 | {{{ |
| 60 | uci set system.@system[0].hostname=test_sta |
| 61 | uci set network.lan.ipaddr=192.168.1.2 |
| 62 | uci set wireless.@wifi-iface[0].mode=sta |
| 63 | uci set wireless.@wifi-iface[0].ssid=OpenWrt |
| 64 | uci set wireless.@wifi-iface[0].encryption=none |
| 65 | uci set wireless.@wifi-iface[0].wds=1 |
| 66 | uci set wireless.radio0.disabled=0 |
| 67 | uci set wireless.radio0.macaddr= |
| 68 | uci set wireless.radio0.phy=phy0 |
| 69 | uci commit |
| 70 | }}} |
| 71 | |
| 72 | Notes: |
| 73 | - 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. |
| 74 | |
| 75 | === Files === |
| 76 | This is the same as the UCI, but just in file form: |
| 77 | |
| 78 | * The AP (access point) |
| 79 | {{{ |
| 80 | root@OpenWrt:/# cat /etc/config/wireless |
| 81 | config wifi-device radio0 |
| 82 | option type mac80211 |
| 83 | option channel 11 |
| 84 | option hwmode 11g |
| 85 | 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' |
| 86 | option htmode HT20 |
| 87 | |
| 88 | |
| 89 | config wifi-iface |
| 90 | option device radio0 |
| 91 | option network lan |
| 92 | option mode ap |
| 93 | option wds 1 |
| 94 | option ssid OpenWrt |
| 95 | option encryption none |
| 96 | |
| 97 | }}} |
| 98 | * The client, AKA Station |
| 99 | {{{ |
| 100 | root@OpenWrt:/# cat /etc/config/wireless |
| 101 | config wifi-device radio0 |
| 102 | option type mac80211 |
| 103 | option channel 11 |
| 104 | option hwmode 11g |
| 105 | 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' |
| 106 | option htmode HT20 |
| 107 | |
| 108 | |
| 109 | config wifi-iface |
| 110 | option device radio0 |
| 111 | option network lan |
| 112 | option mode sta |
| 113 | option wds 1 |
| 114 | option ssid OpenWrt |
| 115 | option encryption none |
| 116 | }}} |