Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:network:openwrt_as_clientdevice [2021/03/10 21:27] – links vgaeteradocs:guide-user:network:openwrt_as_clientdevice [2021/10/17 17:38] – [Command-line instructions] vgaetera
Line 1: Line 1:
 ====== OpenWrt as client device ====== ====== OpenWrt as client device ======
 See also: See also:
-[[docs:guide-user:network:switch_router_gateway_and_nat|Router vs switch vs gateway and NAT]], 
 [[docs:guide-user:network:openwrt_as_routerdevice|OpenWrt as router device]], [[docs:guide-user:network:openwrt_as_routerdevice|OpenWrt as router device]],
 +[[docs:guide-user:network:switch_router_gateway_and_nat|Router vs switch vs gateway and NAT]],
 [[docs:guide-user:security:recovering_from_clientmode|Regaining access to an OpenWrt device in client mode]] [[docs:guide-user:security:recovering_from_clientmode|Regaining access to an OpenWrt device in client mode]]
  
Line 11: Line 11:
   * The device's network firewall will be off, such that e.g. wired devices connected to the other router can contact e.g. wireless devices connected to the OpenWrt router.   * The device's network firewall will be off, such that e.g. wired devices connected to the other router can contact e.g. wireless devices connected to the OpenWrt router.
  
-===== Web interface =====+===== Web interface instructions =====
   - Click on **Network** -> **Interfaces**, then click on the **Edit** button of the LAN Network.   - Click on **Network** -> **Interfaces**, then click on the **Edit** button of the LAN Network.
   - In **General Setup** tab, in **Protocol**, select **Static Address**   - In **General Setup** tab, in **Protocol**, select **Static Address**
Line 22: Line 22:
   - When you are done, click on **Save & Apply** button at the end of the page. This will change the network configuration of the device, and will now be accessible at the IP you set above (or at an unknown dynamic IP if you used "**DHCP client option**"), so the current page you used for configuring it will fail to connect to the device. Disconnect the cable from the PC and connect it to the current network router's LAN Ethernet ports, write the IP address in your browser's address bar and you should be able to connect to it again as normal.   - When you are done, click on **Save & Apply** button at the end of the page. This will change the network configuration of the device, and will now be accessible at the IP you set above (or at an unknown dynamic IP if you used "**DHCP client option**"), so the current page you used for configuring it will fail to connect to the device. Disconnect the cable from the PC and connect it to the current network router's LAN Ethernet ports, write the IP address in your browser's address bar and you should be able to connect to it again as normal.
  
-===== Command-line interface ===== +===== Command-line instructions ===== 
-To make the same we just did with Luci webinterface above, see above for more detailed explanation of the steps: +Configure the LAN interface statically with the new IP address ''192.168.1.2'', netmask ''255.255.255.0'', gateway ''192.168.1.1'', and DNS ''192.168.1.1''
-  - Type ''uci set network.lan.ipaddr='new-ip-address''' and press Return. + 
-  - Type ''uci set network.lan.gateway='your-gateway-address''' and press Return+<code bash> 
-  - Type ''uci set network.lan.dns='dns-address-here''' and press Return+uci set network.lan.proto="static" 
-  - Type ''uci commit && service network restart'' to save the changes and restart network interfaces+uci set network.lan.ipaddr="192.168.1.2" 
-  - The ssh session will not work anymore because the device has changed address, this is normal+uci set network.lan.netmask="255.255.255.0" 
-  Now you can connect the network cable from the device's LAN port to your existing network, the other router's LAN ports usually+uci set network.lan.gateway="192.168.1.1" 
-  - Connect again to the device at its new address as defined above.+uci set network.lan.dns="192.168.1.1" 
 +uci commit network 
 +/etc/init.d/network restart 
 +</code> 
 + 
 +Note that changing the IP address causes the SSH session to hang/disconnect
 +Now you can connect the network cable from the device's LAN port to your existing network, the other router's LAN ports usually.
  
  • Last modified: 2023/10/14 05:58
  • by vgaetera