PDA

View Full Version : Feature for AirOS: Configuration of static routes


FlemmingFrandsen
01-15-2009, 01:42 PM
I have been searching the forum trying to figure out how to configure static routes on my NS5 AP and as far as I can tell the solution is to write a shell script as hinted at here:
http://ubnt.com/forum/viewtopic.php?p=14668
http://ubnt.com/forum/viewtopic.php?t=6654

It would be very handy if static routes could be configured via the web interface and via cfg upload and it's really a must-have feature for me.

At the moment I need to do several things to provision a CPE:
1) Upload the cfg file to enable the cfg server.
2) Wait for reboot.
3) Log in via ssh with password
4) Configure public key auth for ssh.
5) Upload the shell script with the commands to set up the static routes.

Setting up ssh is only needed to set up the static routes, so if I could configure the routes via the cfg file I could reduce all of this to step 1.

UBNT-keba
01-15-2009, 02:01 PM
As I remember fw starting from v3.2.3 are supporting routes through cfg file.

Routes
====
route.status=[enabled|disabled]
route.<index>.status=[enabled|disabled]
route.<index>.devname=[ethX|athX|pppX|brX]
route.<index>.ip=[ip]
route.<index>.netmask=[netmask]
route.<index>.gateway=[ip]
route.ip_forward=[enabled|disabled]

FlemmingFrandsen
01-15-2009, 02:05 PM
Thanks that's very neat, that means that I just have to upgrade the firmware and I'm good to go.

For the record I just received my NS5s and they run XS5.ar2313.v3.2.2.4003.081114.1725.

UBNT-keba
01-15-2009, 02:07 PM
3.2.2 could have issue with dotted netmask, use bitmask so it should work on 3.2.2 as well.

FlemmingFrandsen
01-16-2009, 04:28 AM
3.2.2 could have issue with dotted netmask, use bitmask so it should work on 3.2.2 as well.

Ugh, sorry.

Do you mean that I should set the:
route.<index>.netmask=[netmask]

To the number of network bits, that is 24 in stead of 255.255.255.0?

Because I already tried that with 3.2.2 and it didn't work at all, the static routes weren't picked up at all.

I'll play more with it over the weekend and post a proper support request somewhere if I can't get it to work.

UBNT-keba
01-29-2009, 11:38 PM
Example:
....
route.1.devname=br0
route.1.gateway=192.168.1.1
route.1.ip=0.0.0.0
route.1.netmask=0
route.1.status=enabled
route.2.devname=br0
route.2.gateway=192.168.1.2
route.2.ip=195.14.162.0
route.2.netmask=24
route.2.status=enabled
route.status=enabled
....

Result:
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
195.14.162.0 192.168.1.2 255.255.255.0 UG 0 0 0 br0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 br0

As you can see I added all 195.14.162.0 network to be routed through 192.168.1.2 instead of default gateway 192.168.1.1.

This example is for Bridge mode. For router mode you have to use eth0 and ath0 devnames. All depends on which interface you are going to add route (wireless/WLAN/ath0 or ethernet/LAN/eth0)

CzechEnglishFrenchGermanItalianPolishPortugueseRussianSpanish
Languages translations delivered by vBET 3.5.4