| 1 | [[PageOutline]] |
| 2 | |
| 3 | |
| 4 | = Gateworks Single Board Computers = |
| 5 | Gateworks offers powerful, flexible, low power ARM single board computers for transmitting data, audio, and video. |
| 6 | |
| 7 | Please see more information at [http://www.gateworks.com] |
| 8 | |
| 9 | |
| 10 | [[Image(gw5100realsmall.png,200px)]] |
| 11 | |
| 12 | = Gateworks Wireless Client Bridge using Relayd = |
| 13 | Gateworks manufactures single board computers (SBCs) that are used in many networking applications. One such application is a wireless bridge. This is where a Gateworks SBC is connected as a client to an existing wireless access point (AP) and the Ethernet port is used as a bridge to provide access to other devices over the wireless. Unfortunately, this scenario isn't supported by traditional wireless networks. The 802.11 standard only uses 3 MAC Addresses per frame and the source MAC gets replaced by the transmitting wireless AP. This then prevents any returned packets from being delivered to the actual host because the host is now believed to be the wireless client. |
| 14 | |
| 15 | One method to address this issue is to use the Wireless Distribution System (WDS) which implements 4 MAC addresses in the header thus allowing the returned packet to be delivered to the correct end point. For WDS to be used both the AP and the client must support WDS. In many cases, an existing AP (ie. Linksys, Netgear) may be used which does not support WDS. For these situations, a special piece of solftware called relayd can be used. Relayd is able to relay packets and achieve the same results. |
| 16 | |
| 17 | Below is a tutorial explaining how to configure a Gateworks SBC to create a wireless bridge without using WDS. |
| 18 | |
| 19 | |
| 20 | = How To - Relayd = |
| 21 | It is possible to acheive a bridge-like client mode configuration with the help of relayd for Gateworks Single Board Computers. With this method you can bridge a standard Wireless AP to a wired LAN or a wireless WLAN. This is useful in the following configurations: |
| 22 | * extend the range of a wireless Access Point (by relaying between a local virtual AP and client attached to an upstream AP) |
| 23 | * provide a bridge between a wired LAN and a wireless Access Point (by relaying between local LAN port and client attached to an upstream AP) |
| 24 | |
| 25 | '''Note, if WDS is available on the Access Point and Client(for example if you were using Gateworks SBCs for both the AP and client), then WDS is recommended and the preferred method. Relayd is only recommended when WDS is not available. The WDS Tutorial is located here: [wiki:wireless_bridge WDS Bridge]''' |
| 26 | |
| 27 | [[Image(relayddiagramwan.png,800px)]] |
| 28 | |
| 29 | |
| 30 | |
| 31 | The following steps need to be done for OpenWRT: |
| 32 | 1. Configure a managed network interface to connect (with encryption if needed) to your 'upstream' Access Point |
| 33 | 2. (Optional) Add a new wireless interface configured in AP mode with desired encryption |
| 34 | 3. Add a new network interface using the protocol of 'relayd' bridging the upstream and downstream networks |
| 35 | 4. Change firewall settings so that Input/Output packets are accepted for both upstream and downstream networks |
| 36 | |
| 37 | |
| 38 | == Requirements == |
| 39 | 1. relayd package |
| 40 | 2. luci-proto-relay package |
| 41 | |
| 42 | Find these by doing an opkg list on the target and seeing if they are there. If they are not, they will need to be added. Instructions for compiling and adding packages can be located here: [wiki:ipkupload Package Installation] |
| 43 | |
| 44 | Luci package management is shown belown with relay packages: |
| 45 | |
| 46 | |
| 47 | [[Image(relaypackages.png,800px)]] |
| 48 | |
| 49 | |
| 50 | |
| 51 | == Configuration via Web-Admin on OpenWrt:Barrier Breaker == |
| 52 | |
| 53 | The GUI has been updated and thus the instructions have slightly changed. |
| 54 | |
| 55 | 1. Click on the Network tab, then the Wifi tab. |
| 56 | |
| 57 | 2. Click on the icon with alt text "Edit this network" next to the Wireless Controller you wish to use. |
| 58 | |
| 59 | 3. Check the box next to Enable device to enable the Wifi. Click on Save & Apply at the bottom of the page. |
| 60 | |
| 61 | [[Image(relayd1.jpg,800px)]] |
| 62 | |
| 63 | 4. Go back to the wifi page by clicking on the Wifi tab again. |
| 64 | |
| 65 | 5. Click on the icon with alt text "Find and join network" that is above the "Edit this network icon" |
| 66 | |
| 67 | 6. Click on "Join Network" next to the network you wish to join. |
| 68 | |
| 69 | 7. Enter the Passphrass for the network and select "lan" under the Create/Assign firewall-zone field. Click on submit at the bottom of the page. |
| 70 | |
| 71 | [[Image(relayd2.jpg,800px)]] |
| 72 | |
| 73 | 8. Click on the Interfaces tab under the Network tab. |
| 74 | |
| 75 | 9. Click on Add new interface. |
| 76 | |
| 77 | [[Image(relayd3.jpg,800px)]] |
| 78 | |
| 79 | 10. Name the interface. (Here it is named "stabridge") |
| 80 | |
| 81 | 11. Leave "Create a bridge over multiple interfaces" unchecked. |
| 82 | |
| 83 | 12. Click on submit. |
| 84 | |
| 85 | [[Image(newrelayinterface.png,800px)]] |
| 86 | |
| 87 | 13. Select "Relay" from the drop down menu for the Protocol. |
| 88 | |
| 89 | 14. Under "Relay between networks" check both lan and wwan. You can leave IP address blank or adjust if desired. |
| 90 | |
| 91 | 15. Click on Save & Apply at the bottom of the screen. |
| 92 | |
| 93 | [[Image(relayd5.jpg,800px)]] |
| 94 | |
| 95 | 16. Under the Network tab, click on the Firewall tab. |
| 96 | |
| 97 | 17. Under Zones, change the forwarding for lan and wwan to "accept" |
| 98 | |
| 99 | [[Image(relayd6.jpg,800px)]] |
| 100 | |
| 101 | 18. Click on Save & Apply at the bottom of the screen. |
| 102 | |
| 103 | 19. This step seems optional. Please adjust to your liking. Make sure the IP address of the lan interface is in a different subnet as the wwan network. |
| 104 | |
| 105 | 20. Additionally, be sure that a bridge does not exist (which may be turned on by default) |
| 106 | [[Image(turnoffbridgelan.png,800px)]] |
| 107 | |
| 108 | |
| 109 | == Configuration Files Barrier Breaker == |
| 110 | 1. Note the new stabridge interface of type relay in /etc/config/network |
| 111 | 2. Note the wireless is a station (aka client) to a regular access point Netgear101 |
| 112 | |
| 113 | Below are '''sample''' files. Items may change depending on different network configurations such as IP addresses, etc |
| 114 | |
| 115 | {{{ |
| 116 | root@OpenWrt:/# cat /etc/config/network |
| 117 | |
| 118 | config interface 'loopback' |
| 119 | option ifname 'lo' |
| 120 | option proto 'static' |
| 121 | option ipaddr '127.0.0.1' |
| 122 | option netmask '255.0.0.0' |
| 123 | |
| 124 | config globals 'globals' |
| 125 | option ula_prefix 'fde7:c973:4a6d::/48' |
| 126 | |
| 127 | config interface 'lan' |
| 128 | option ifname 'eth0' |
| 129 | option proto 'static' |
| 130 | option ipaddr '192.168.43.55' |
| 131 | option netmask '255.255.255.0' |
| 132 | option ip6assign '60' |
| 133 | |
| 134 | config interface 'wwan' |
| 135 | option proto 'dhcp' |
| 136 | |
| 137 | config interface 'stabridge' |
| 138 | option proto 'relay' |
| 139 | list network 'lan' |
| 140 | list network 'wwan' |
| 141 | }}} |
| 142 | |
| 143 | {{{ |
| 144 | root@OpenWrt:/# cat /etc/config/wireless |
| 145 | |
| 146 | config wifi-device 'radio0' |
| 147 | option type 'mac80211' |
| 148 | option hwmode '11ng' |
| 149 | option phy 'phy0' |
| 150 | list ht_capab 'LDPC' |
| 151 | list ht_capab 'SHORT-GI-20' |
| 152 | list ht_capab 'SHORT-GI-40' |
| 153 | list ht_capab 'TX-STBC' |
| 154 | list ht_capab 'RX-STBC1' |
| 155 | list ht_capab 'DSSS_CCK-40' |
| 156 | option htmode 'HT20' |
| 157 | option disabled '0' |
| 158 | option txpower '27' |
| 159 | option country 'US' |
| 160 | option channel '6' |
| 161 | |
| 162 | config wifi-iface |
| 163 | option network 'wwan' |
| 164 | option ssid 'Netgear101' |
| 165 | option encryption 'psk2' |
| 166 | option device 'radio0' |
| 167 | option mode 'sta' |
| 168 | option bssid '5C:0A:5B:C5:AF:23' |
| 169 | option key 'abc123' |
| 170 | }}} |
| 171 | |
| 172 | |
| 173 | == Configuration via Web-Admin on OpenWrt:Attitude Adjustment == |
| 174 | |
| 175 | 1. Click on the Network tab, then the Wifi tab. |
| 176 | |
| 177 | 2. Click on the icon with alt text "Edit this network" next to the Wireless Controller you wish to use. |
| 178 | |
| 179 | 3. Check the box next to Enable device to enable the Wifi. Click on Save & Apply at the bottom of the page. |
| 180 | |
| 181 | [[Image(relayd1.jpg,800px)]] |
| 182 | |
| 183 | 4. Go back to the wifi page by clicking on the Wifi tab again. |
| 184 | |
| 185 | 5. Click on the icon with alt text "Find and join network" that is above the "Edit this network icon" |
| 186 | |
| 187 | 6. Click on "Join Network" next to the network you wish to join. |
| 188 | |
| 189 | 7. Enter the Passphrass for the network and select "lan" under the Create/Assign firewall-zone field. Click on submit at the bottom of the page. |
| 190 | |
| 191 | [[Image(relayd2.jpg,800px)]] |
| 192 | |
| 193 | 8. Click on the Interfaces tab under the Network tab. |
| 194 | |
| 195 | 9. Click on Add new interface. |
| 196 | |
| 197 | [[Image(relayd3.jpg,800px)]] |
| 198 | |
| 199 | 10. Name the interface. (Here it is named "stabridge") |
| 200 | |
| 201 | 11. Leave "Create a bridge over multiple interfaces" unchecked. |
| 202 | |
| 203 | 12. Check "Custom Interface" for the interface to cover and click on submit. |
| 204 | |
| 205 | [[Image(relayd4.jpg,800px)]] |
| 206 | |
| 207 | 13. Select "Relay" from the drop down menu for the Protocol. |
| 208 | |
| 209 | 14. Under "Relay between networks" check both lan and wwan. |
| 210 | |
| 211 | 15. Click on Save & Apply at the bottom of the screen. |
| 212 | |
| 213 | [[Image(relayd5.jpg,800px)]] |
| 214 | |
| 215 | 16. Under the Network tab, click on the Firewall tab. |
| 216 | |
| 217 | 17. Under Zones, change the forwarding for lan and wwan to "accept" |
| 218 | |
| 219 | [[Image(relayd6.jpg,800px)]] |
| 220 | |
| 221 | 18. Click on Save & Apply at the bottom of the screen. |
| 222 | |
| 223 | 19. Make sure the IP address of the lan interface is in a different subnet as the wwan network. |
| 224 | |
| 225 | |
| 226 | == References == |
| 227 | For additional configuration information see: |
| 228 | * [http://wiki.openwrt.org/doc/recipes/relayclient] |
| 229 | * [http://wiki.openwrt.org/doc/howto/clientmode] |