See also: OpenWrt as router device, Router vs switch vs gateway and NAT, Regaining access to an OpenWrt device in client mode
OpenWrt will provide additional functions for the network (for example, you just want to use the Wi-Fi network it provides, or the device is a NAS serving files over the network, or a mini-server offering whatever other service).
This means:
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
.
uci set network.lan.proto="static" uci set network.lan.ipaddr="192.168.1.2" uci set network.lan.netmask="255.255.255.0" uci set network.lan.gateway="192.168.1.1" uci set network.lan.dns="192.168.1.1" uci commit network service network restart
Or configure the LAN interface dynamically with DHCP.
uci set network.lan.proto="dhcp" uci commit network service network restart
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.