Differences

This shows you the differences between two versions of the page.

doc:recipes:relayclient [2013/03/18 22:41]
por corrected link to doc:uci:network
doc:recipes:relayclient [2014/01/12 00:57] (current)
dllud Reformulated the configuration steps in order to add: relayd install instructions, gateway and dns in the lan interface and wireless network for repeating.
Line 9: Line 9:
The steps outlined below cover the process of putting the radio into client mode and linking it with the LAN interface with the help of //relayd//. The steps outlined below cover the process of putting the radio into client mode and linking it with the LAN interface with the help of //relayd//.
- 
-:!: In order to use this setup, you first must install the ''relayd'' package, if it is not present on the system yet. In trunk versions it is also required to enable the relayd init script to function properly: ''/etc/init.d/relayd enable''. 
[[http://trac.gateworks.com/wiki/relayd|Configuration with Luci]] :!: When using Luci you also need to install the ''luci-proto-relay'' package.\\ [[http://trac.gateworks.com/wiki/relayd|Configuration with Luci]] :!: When using Luci you also need to install the ''luci-proto-relay'' package.\\
-[[https://forum.openwrt.org/viewtopic.php?pid=173467#p173467|OpenWrt PseudoBridge HowTo]] for TL-WR703n or any other device based on package ''relayd'' and ''luci-proto-relay''. +[[https://forum.openwrt.org/viewtopic.php?pid=173467#p173467|OpenWrt PseudoBridge HowTo]] for TL-WR703n or any other device based on package ''relayd'' and ''luci-proto-relay''.\\ 
 +[[https://forum.openwrt.org/viewtopic.php?id=39077|Repeater configurations here! Both ways, bridged and simple repeater]].
===== Configuration ===== ===== Configuration =====
Line 35: Line 34:
-Now we can issue the ''iwlist scan'' command to list networks in range, the required information is highlighted:+Now we can list networks in range using: 
 +  * ''iwlist scan'' in OpenWrt 10.03 and previous, 
 +  * ''iw dev wlan0 scan'' in 12.09, substituting //wlan0// for your wireless interface (''ifconfig'' lists the available interfaces).
| ''root@OpenWrt:~# iwlist scan | ''root@OpenWrt:~# iwlist scan
Line 137: Line 138:
</code> </code>
-==== Step 2: Declare a relay interface ==== 
-Add another new interface to the network configuration, this time with the special protocol ''relay'': +==== Step 2: Change the existing wireless network ====
- +
-| ''config 'interface' 'stabridge' +
-        option 'proto'      'relay' +
-        option 'network'    'lan **wwan**' '' | +
- +
-The existing ''lan'' network and the newly created ''wwan'' network are grouped together here. +
- +
-UCI CLI commands: +
-<code> +
-uci set network.stabridge=interface +
-uci set network.stabridge.proto=relay +
-uci set network.stabridge.network="lan wwan" +
-uci commit network +
-</code> +
- +
-==== Step 3: Change the existing wireless network ====+
Supposed we want to connect to the network called "xmff-relay", the previous scan result revealed the following information: Supposed we want to connect to the network called "xmff-relay", the previous scan result revealed the following information:
Line 190: Line 174:
</code> </code>
 +Finally restart wifi using:
 +<code>
 +wifi down; wifi
 +</code>
 +You should now be connected to the internet (you will need such connection for step 3).
 +==== Step 3: Install relayd ====
 +If the ''relayd'' package is not present on the system yet, install it using:
 +<code>
 +opkg update
 +opkg install relayd
 +</code>
 +In 12.09 and trunk versions it is also required to enable the relayd init script to function properly:
 +<code>
 +/etc/init.d/relayd enable
 +</code>
 +==== Step 4: Declare a relay interface ====
 +Back to ''/etc/config/network'' add another new interface, this time with the special protocol ''relay'':
 +| ''config 'interface' 'stabridge'
 +        option 'proto'      'relay'
 +        option 'network'    'lan **wwan**' '' |
 +The existing ''lan'' network and the newly created ''wwan'' network are grouped together here.
 +UCI CLI commands:
 +<code>
 +uci set network.stabridge=interface
 +uci set network.stabridge.proto=relay
 +uci set network.stabridge.network="lan wwan"
 +uci commit network
 +</code>
 +
 +==== Step 5: Add gateway and dns to the lan interface ====
 +
 +Find the IP address of default gateway for the network you will be repeating. You should be connected to it since step 3, thus you can use the route command:
 +<code>
 +route -n | grep UG
 +</code>
 +
 +Then, still in the network configuration, add the following options under your lan interface, substituting gateway with the IP you just found:
 +
 +| ''config 'interface' 'lan'
 +        ...
 +        option gateway '192.168.10.1'
 +        option dns    '8.8.8.8' '' |
 +
 +UCI CLI commands:
 +<code>
 +uci set network.lan.gateway=192.168.10.1
 +uci set network.lan.dns=8.8.8.8
 +uci commit network
 +</code>
-==== Step 4: Disable the local DHCP server ====+==== Step 6: Disable the local DHCP server ====
Since DHCP requests from LAN will be answered by the wireless AP the router is connecting to, Since DHCP requests from LAN will be answered by the wireless AP the router is connecting to,
Line 218: Line 251:
uci commit dhcp</code> uci commit dhcp</code>
-==== Step 5: Adjust the firewall ====+==== Step 7: Adjust the firewall ====
In contrast to true bridging, packets forwarded by //relayd// are handled by the normal routing In contrast to true bridging, packets forwarded by //relayd// are handled by the normal routing
Line 243: Line 276:
uci set firewall.@zone[0].network="lan wwan" uci set firewall.@zone[0].network="lan wwan"
uci commit firewall</code> uci commit firewall</code>
 +
 +==== Step 8: Create a wireless network for repeating (optional) ====
 +
 +If your equipment is multi-SSID capable, besides the wired interface, you can also bridge the network into a new wireless network. Just create a new network in access point (AP) mode under ''/etc/config/wireless'':
 +
 +|''config wifi-iface
 +    option device 'radio0'
 +    option mode 'ap'
 +    option ssid 'RepeaterWirelessNetwork'
 +    option encryption 'psk2'
 +    option key 'RepeaterWirelessPassword'
 +    option network 'lan' ''|
 +
 +UCI CLI commands:
 +<code>
 +uci set wireless.@wifi-iface[1].device=radio0
 +uci set wireless.@wifi-iface[1].network=lan
 +uci set wireless.@wifi-iface[1].mode=ap
 +uci set wireless.@wifi-iface[1].ssid=RepeaterWirelessNetwork
 +uci set wireless.@wifi-iface[1].encryption=psk2
 +uci set wireless.@wifi-iface[1].key=RepeaterWirelessPassword
 +uci commit wireless
 +</code>
===== Apply changes ===== ===== Apply changes =====
Line 258: Line 314:
<code>wifi down; wifi</code> <code>wifi down; wifi</code>
-| {{:meta:48px-dialog-warning.svg.png?nolink}} | If the target network uses the 192.168.1.0/24 subnet, you **must** change the default LAN IP address to a different subnet, e.g. 192.168.**2**.1 .\\ You can determine the assigned wifi address with the following command: <code>uci -P/var/state get network.wwan.ipaddr +| {{:meta:48px-dialog-warning.svg.png?nolink}} | If the target network uses the 192.168.1.0/24 subnet, you **must** change the default LAN IP address to a different subnet, e.g. 192.168.**2**.1 .\\ You can determine the assigned wifi address with the following command: <code>uci -P/var/state get network.wwan.ipaddr 10.11.12.35</code> <code bash>. /lib/functions/network.sh; network_get_ipaddr ip_wwan wwan; echo $ip_wwan</code> UCI CLI commands to change the default LAN IP address to a different subnet is: <code>uci set network.lan.ipaddr=192.168.2.1
-10.11.12.35</code> UCI CLI commands to change the default LAN IP address to a different subnet is: <code> +
-uci set network.lan.ipaddr=192.168.2.1+
uci commit network uci commit network
reboot</code> | reboot</code> |

Back to top

doc/recipes/relayclient.1363642907.txt.bz2 · Last modified: 2013/03/18 22:41 by por