Router "stuck" after changing netmask option in lan interface

Router: GL-MT1300 running LuCI openwrt-19.07 branch (git-21.189.23240-7b931da) / OpenWrt 19.07.8 r11364-ef56c85848

Per the title. I pulled the network config file from the router via terminal and changed:

	option netmask '255.255.255.0'

to:

	option netmask '255.255.240.0'

for the lan interface because I need to the larger subnet for a few hundred static IPs (this is strictly for organizational purposes)

I then sent the file to the router and rebooted it and now it won't come back online fully. The light at the front of my GL-MT1300 just slowly pulses.

I am very new to networking and have no idea why this change would seemingly break the router. Is there a better way to perform this change? I didn't see anything in the Luci interface for changing it (I could have missed it though)

Thanks.

The change should be ok.

"pulled" ... "sent the file"? How did you edit the file on PC?
Are you sure that you didn't change line endings from LF (Linux) to CRLF (PC) ?

Use editor in the terminal. E.g. install 'nano' to get an easy to use editor.

Netmask is in LuCI in the LAN interface settings.

1 Like

I used the scp command in terminal to drop it on my desktop and then edited it using vsc2, saved it, and then used scp to send it back to the router. Working on a mac so I don't think it should have messed up the line endings but there's a lot I don't know admittedly. Clearly it didn't like something. I have successfully pulled and pushed (maybe better word) the dhcp config in the past (once I figured out what I was doing wrong) using the same method.

I guess I will need to reflash the router and next time I will try using the GUI, or look up how to do it using uci? Doesn't seem like it'll come back online anymore. :frowning:

Yes that messes up the line endings (been there done that).

I use WinSCP but then just edit the file in place that way it will work.

Edit: failsafe mode should work to get you in (at 192.168.1.1) and then edit the file or just delete it

1 Like

Look at the failsafe advice.
You should be able to enter the failsafe mode and reset your changes. Should be no need to flash.

Hmmm.

Do you actually have the proper OpenWrt?
Based on wiki https://openwrt.org/toh/gl.inet/gl-mt1300_v1 the router is only supported since 21.02
(and it is not in the 19.07.8 downloads repo https://downloads.openwrt.org/releases/19.07.8/targets/ramips/mt7621/ while it naturally is in the 21.02 repo https://downloads.openwrt.org/releases/21.02.7/targets/ramips/mt7621/ )

Are you running "normal" OpenWrt or the GL-inet OEM firmware?

If GL-inet firmware, then the router may have modifications rendering some advice invalid.

3 Likes

Oh boy, they have whatever they have out of the box, I go to advanced and install Luci on the GL-inet UI. I just copy and pasted what is shows at the bottom of the page when inside the Luci interface. So this isn't truly OpenWRT but a custom build of it? Should I be looking to update it then?

I just need this thing to be able to take and assign a large list of static IPs which I've been struggling to get it to do, mostly because of my own lack of knowledge.

That model has an official release build you should use it to get support here. Around version 21, it became possible to use CIDR notation in the IP assignment, i.e. option ipaddr '192.168.0.1/20'. When using that method, don't have an option netmask line in the file, or leave the box blank in the GUI. This network spans 192.168.0.0 to 192.168.15.255, so the first usable IP-- conventionally used for the router, though it doesn't have to be-- is 192.168.0.1 not 192.168.1.1.

"Static IPs" in the router I assume you mean static leases aka DHCP reservations. This is held in /etc/config/dhcp as config host blocks:

An interesting point is you can reserve by MAC or by name. MAC has precedence and if a name is also configured, it will override any name sent by the host. Using name without MAC is useful when multiple adapters may be used, e.g. a laptop with both wired and wireless.

You can prepare a file with a large list of config host blocks then append it to /etc/config/dhcp.

1 Like

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