Setting a Static IPv4 Upstream address from within the OpenWRT router

Hello all. First time poster here, and have started using OpenWRT since May 2024.
Apologies in advance for any erroneous or obvious points and terms I may discuss here.

I have a standard Technicolor router with my ISP, which I am now using as a public-facing(?) modem that the DSL connection goes into. Wireless broadcasting has been disabled, DHCP and NAT are still enabled. The only device connecting to this router (now referred to as a modem) will be another router.
I have a Linksys WRT1900ACS with OpenWRT installed on one of the partitions. It also has DHCP enabled for providing IP addresses, to which all other devices will connect to.
On the modem, I have created a static IPv4 lease for the OpenWRT router (e.g. 192.168.123.100). This is done by associating the MAC address of the OpenWRT router to the lease. However, I have noticed sometimes, that, when either the router or modem are restarted, the static IPv4 address used for the router is not the one I have specified. Sometimes, the OpenWRT router has been assigned a different IPv4 address (e.g. 192.168.123.106). I've confirmed this on both the UIs of the modem and the OpenWRT router (known as the IPv4 Upstream). This can sometimes be resolved by a combination of restarting the modem and router in a particular order, to ensure the router receives the specified IP address.

When I have previously configured static leases for other devices, such as laptops, PCs or tablets, the IP address they are provided is the same as the one I have specified within the static lease on the modem.

So, my question is, is there an issue with either the Technicolor router/modem (i.e not following the static lease rules), or the Linksys OpenWRT router (e.g. using its combination of interfaces to receive a different IP), or do I have to additionally configure the OpenWRT router to further ensure it receives the same IPv4 address that I specified within the static lease on the modem?

It's not been necessary for years, but I used to set the static address from the device side by adding the static IP, netmask and gateway details in /etc/network/interfaces on Linux devices such as Raspberry Pis. However, that has not been necessary for some time, and I felt it was more appropriate to set the static lease from the router instead. Would I need to do such a thing on the OpenWRT router?

EDIT: I have not changed the function of neither router. None are working as an AP or in Bridged mode.

If you have configured it properly on the Technicolor router, and the Linksys is also configured properly as a DHCP client, then you should not need to do anything else.

However, if it fails, you can try to diagnose the issue, or you can just configure a static address on the Linksys.

Thank you for your response, @eduperez

I am confident your first two suggestions are already applied correctly.

Although I have done my best to ensure the Linksys/OpenWRT router is assigned a static IP lease from the Technicolor router(modem), please can you advise on how to configure the Linksys/OpenWRT router to have a static IPv4 upstream address on the Linksys?

I assumed that this may be similar to how its done on other linux devices, setting this in /etc/network/interfaces. However, there appears to be no such file or directory in the OpenWRT directory structure.

If you're using LuCI, you'll navigate to Network > Interfaces > Edit wan interface and then change the protocol to static -- this will give you the ability to specify the IP address manually. Make sure that you do not overlap the upstream's DHCP address range and that the static IP you use does not conflict with any other devices on the upstream network.

You must set all fields based on the upstream network's parameters:

  • IP address
  • Subnet mask
  • Gateway
  • DNS (this can optionally be a public DNS server instead of the upstream router's address).
1 Like

You can use the GUI, as suggested by @psherman, or you can edit the file '/etc/config/network'.

1 Like

Thank you @psherman and @eduperez for both the UI and CLI approaches.

I tried the solution provided by @psherman. The static IP was applied successfully. I was able to connect to the router thereafter, and so were other several devices. No further changes were made.
Unfortunately, the router stopped working several hours later and I was no longer able to connect to it. I'm working with the router remotely but need assistance on-site and haven't been able to solve the problem yet. Once I've been able to resolve/diagnose the issue, I'll be able to mark it as an answer.

When you get access to the device again (i.e. via the assistant, I guess), get a complete config dump and we'll see if we can help from there.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall