Installing via a snapshot. How do I "switch" from OpenWrt being on my prior lan to behave as the new router?

I'm trying to install OpenWrt on a raspberry pi 4, so I'm having to go through the snapshot process. (i'm following the instructions at https://gateway-it.com/raspberry-pi-4-as-a-home-router-openwrt-adguard-home/)

I get the snapshot loaded, I access it via a direct connection to a computer in order to change the default settings to now sit on my existing LAN. This is the interface connection I specified (as per the instructions, slightly configured)

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.0.55'
        option netmask '255.255.255.0'
        option gateway '192.168.0.1'
        option dns '1.1.1.1'

that gets me put on my existing Router, I can then SSH into the IP address assigned by the router/specified above, install packages, install LuCi, install the driver for the USB NIC, etc etc.

I'm thoroughly stuck on how then to take this off my prior LAN and start it up as its own router. I try to modify the interface in LuCi (I'm not skilled enough to do this by editing the config files in SSH), but it just keeps reverting to sitting on my LAN with the .55 IP address.

help please.

Configure you USB NIC (or the other one) as a WAN interface.

i'm not there yet. i need to have the RPi act as a LAN router first so I can re-access it via LuCi or SSH.

If i add the WAN nic and then disconnect the Pi from my old router, I can't get back to it.

You need to configure your RPI LAN back to static IP and reenable the DHCP, or just reset it to its default configuration.

And you can always access the pi, just hook up a screen and a keyboard to it.

yes how do i do that. i try to re-configure it in luci and it doesn''t work

(and i don't have micro-HDMI connectors, so i actually can't.)

What "doesn't work"?

sorry, i'm not that experienced at this. i'll try to explain in lay terms.

my lan IP is 192.168.0.1

when i go into LuCi on the RPi4, i need to set the EDIT: LAN interface settings to act as a DHCP server accessible at 192.168.0.1, right, so that I can re-access LuCi with my networked client.

i try to edit the settings in LuCi, and I don't really know what settings to use. I delete the IP address assignment that I specified in the settings initially "192.168.0.155" , give it the gateway address 192.168.0.1, and try to save changes/apply/reset. and disconnect it from my old router.

i can't re-access luci by directly connecting the Pi to my computer and SSHing into 192.168.0.1....

when i re-hook the machine into my old router, the old settings have re-appeared.

Ok,

Install the packages needed for your USB NIC.

Then in ssh run

uci set dhcp.lan.ignore=0
uci commit dhcp
/etc/init.d/dnsmasq restart
uci set network.lan.ipaddr='192.168.1.1'
uci commit network
/etc/init.d/network restart

After that it'll respond at 192.168.1.1, and run host a DHCP, connect your client to the ethnet port, not going via the old router, and access it again using 192.168.1.1.

Create a new WAN interface using your USB NIC, and connect it to the existing router.

1 Like

ok thanks.

to be clear, i can change the network.lan.ipaddr to 192.168.0.1 though right? (i need to maintain the LAN ip addresses at 192.168.0.1, not 1.1 because i have hard wired devices that are looking for static IP assignments in the 192.168.0.x range)

No,

if you want to use the RPi as a router, it can't use the same subnet as your old router,

unless you're replacing it, then you can change it back, to 0.1 after you've made the swap.

yeah, sorry, i assumed disconnection of the old router.

i got it to work, finally. thanks for your help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.