How to configure router mode

Hello, good afternoon, I'm browsing the forum again and I apologize for the inconvenience.

I already have a nanostation ac loco, it has a gigabit cable input and two wifi antennas, one is 2.4ghz and the other is 5ghz.

How can I place it through the cable entry to use it as a wan in the dhcp client and pass the connection through the wifi using the dhcp server.

I can't find the logic for the configuration. I know it's like configuring the mechanics of a mikrotik but using openwrt.

Generally it is very simple - you’ll remove the Ethernet port from be-lan, create a new wan interface, and assign the port to that wan interface.

We can give specifics based on the network config:

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
root@OpenWrt:~# ubus call system board
{
        "kernel": "5.10.201",
        "hostname": "OpenWrt",
        "system": "Atheros AR9342 rev 3",
        "model": "Ubiquiti Nanostation AC loco (WA)",
        "board_name": "ubnt,nanostation-ac-loco",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.6",
                "revision": "r20265-f85a79bcb4",
                "target": "ath79/generic",
                "description": "OpenWrt 22.03.6 r20265-f85a79bcb4"
        }
}


root@OpenWrt:~# cat /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 'fdf6:aed7:541b::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.10.1'

config device
        option name 'eth0'
        option ipv6 '1'

Great. This is easy....

First and most critically -- make sure wifi is enabled and that you are making these changes while connected via wifi. You will be disabling the ethernet port from a lan perspective (and making it a wan), so you must have a way to connect -- wifi is how this will be done.

Remove the port from below and add a line for bridge empty

it'll look like this:

config device
        option name 'br-lan'
        option type 'bridge'
	option bridge_empty '1'

Now, add the wan (note that it is lowercase -- this will make it so it 'just works'):

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'

Reboot the device and connect the ethernet port to the upstream network -- it should get an IP via DHCP and start working as a normal router.

1 Like

Thank you but excuse the ignorance but how did you do it :sweat_smile:

Not sure what you're asking "how did you do it?"

I just literally created this by quoting/editing the config you provided.

If you're asking how you can achieve the same thing -- it can be done via direct editing of the config file itself or via the UCI command-line, or using the LuCI web interface. Personally, I prefer direct editing of the text file for many of these things.

Thank you very much, I was able to do it, I didn't understand how to edit it, I downloaded the network file and uploaded it again and it started working, thank you.

1 Like

That is a valid way to do it as well, however you can use a terminal and the ssh root@ip address command to access the device, then modify the network file live with the built in editor

“vi /etc/config/network”

To enter edit mode press the letter “i”
To navigate use the arrow keys
To leave edit mode press the “escape” key
To save your edit press “:w”
To leave the editor press “:q”

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