Nanostation Loco M2 as a AP thru wan

I installed the latest OpenWRT supported by the NanoStation Loco M2 XM, which is v22.03.0.

I need to use it as a simple access point, with Internet coming in thru it's lan port. So I basically need to turn the lan to a wan. And I managed to do it using this config on my /etc/config/network:

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option device 'wlan0'
	option auto '1'
config interface 'wan'
	option proto 'dhcp'
	option device 'eth0'
	option auto '1'

and have added this line to /etc/config/dhcp:

config dnsmasq
   list server '4.2.2.2'

The problem is I need to disconnect and re-connect the ethernet cable everytime the device reboots, or that /etc/init.d/network restart runs to be more precise. Else the device doesn't respond even on it's default ip 192.168.1.1. I am able to connect to the AP, so dhcp seems to be working, but I get no meaningful logs with tcpdump, or any clues to what's happening.

Are there any tricks that need to be done to devices that have a single ethernet port to use wan?

Tips appreciated, thanks in advance!

Your use case is a dumb AP, and you have the configuration quite wrong
This guide is somewhat helpful but it could be better:

Points to keep in mind:

  • A dumb AP has only one network, the lan, which is a layer 2 bridge from wired to wireless.
  • A dumb AP does not route or firewall any traffic from the wifi users, nor offer any services such as DHCP or DNS to them.
  • The dumb AP holds an IP address only for administrative purposes. This IP address should be in your LAN but different from the main router or any other LAN device.
  • For administrative purposes (e.g. NTP time) the dumb AP should be configured to use the network's main router as default gateway and DNS.

Also this model has only 32 MB of RAM. Crashing due to lack of RAM is likely. You need to shut down as many services as possible, especially those that are wrapped in ujail.

  • uhhtpd (GUI web server)
  • dnsmasq
  • since you have only a wifi AP, no STA interfaces, wpa-supplicant. It is not a separate service in init.d but it can be disabled by removing/renaming /bin/wpa-supplicant, which is a link to wpad.

Thank you for the very thorough answer @mk24, but what if what I want is not a Dumb AP, but a "smart" one, which does give dhcp and dns? I don't have a "main router", I have a wireless link using Ubiquiti's airmax, and would like the Nanostation Loco to be the main access point router.

I feel the configuration I got is pretty close to what I need, just missing some detail which makes the whole setup only work when the eth cable is disconnected and reconnected. Any clues?

There is no guarantee that this will solve your problem, but try making the following changes.

You don't need a bridge on the wan side (especially named br-lan). Delete the entire section.

Remove option device 'wlan0', but make sure that the wireless network is attached to the lan interface.

The wired port is set as wan. If something goes wrong and you lose wireless access, you'll need to reset the configuration, so run the following commands without commiting the changes. Restarting the network service should show if there are any improvements

uci delete network.@device[0]
uci delete network.lan.device
/etc/init.d/network restart

That isn't clear at all.
In this network, what is the link to the Internet? Is there any wired infrastructure that you own? Or do you want to connect to an existing wireless network and create your own wired extensions?

Thank you very much for the input @pavelgl, unfortunately didn't make a difference, still need to disconnect and reconnect the cable. Any other ideas?

@mk24 I might be missing the technical vocabulary to explain the setup (as english isn't my first language). So here's a schematic of the network setup:

Is the fiber modem also a router or is it a bridge to the Internet? If it is routing, then you'd use the Loco as a dumb AP. If it is a bridge, you'd configure the Loco as the main router for the network, because there is no other router.

In either case the wireless link bridge is functionally the same as having an Ethernet cable there.

The fiber modem is a router which the provider gives no access too, so I'd rather the Loco be a main router with it's own dhcp and dnsmasq, as with OpenWRT I can add local dns domains and have better overral control.

So to have it as a main router, any clues what's causing having to reconnect the cable?

Have you changed the configuration any from what you initially posted? It's definitely wrong to have eth0 in more than one network. It should only be in wan in order to route lan->wan.

The IP range assigned by the fiber modem may be 192.168.1.X, in which case you have to change the lan IP to a different range (e.g. 192.168.2.1) to prevent conflict.

A default install of 22.03 on this 32M box is almost certain to crash from lack of RAM if you don't shut down or remove some services. It is going to be difficult to run it as a lan->wan router.

1 Like

Thank you @mk24, ends up that the problem was the conflict on the 192.168.1.X lan. Changing it to 192.168.2.1 solved the problem.

So for future reference, this is the final config I'm using on /etc/config/network:

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fdb5:14a3:1e25::/48'
config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option auto '1'
config interface 'wan'
	option proto 'dhcp'
	option device 'eth0'
	option auto '1'

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