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:
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:
list server '220.127.116.11'
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?
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
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?
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?