PDA

View Full Version : VLAN config in system.cfg file?


dragonfly
10-31-2008, 08:39 AM
I have been able to successfully configure VLANs using the vconfig command, but those changes are lost upon reboot.

Is there a way to configure VLAN inside the system.cfg file? Or by other means of a persistent config file that is executed upon boot?

Thanks!

Oliver
10-31-2008, 07:28 PM
Hey dragonfly,

From what I can tell, there are several hooks in the standard-firmware to allow you to add your own init-scripts. First of all, you have the "/etc/persistent/"-directory, the contents of which get saved when you save the config in the web-interface and from then on, they get restored on boot.

Have a look at the scripts under "/etc/rc.d/" for the hooks you can use to run your own scripts. For example, "/etc/persistent/rc.poststart" gets executed after everything has started and can be used to run custom commands post-start.


Grtz,

Oliver

unwiredhokie
01-01-2009, 08:22 AM
I have a similar issue in that I need to have several static routes set but there doesn't seem to be anyplace in the UI to do so. I can run them manually after logging in but obviously need this to be captured in a file run at boot.

I created /etc/rc.d/rc.poststart

#!/bin/ash
route add -net 172.17.34.0 netmask 255.255.255.128 gw 172.17.34.129

This route command works fine from the CLI (it would be nice if the route command would accept CDIR notation) but the rc.poststart file is gone after either a UI or CLI reboot.

I also tried downloading the config after creating this file but there was no evidence of the route commands in the downloaded file. I'd be happy to edit the config file and upload but haven't found any documentation on the syntax to do so. It looks like the netconf.conf file may also be a candidate to issue the route commands but am sure that it would get clobbered if any changes were made in the UI as the file would (I assume) be over written on Apply.

This seems like such a straightforward deal - to store some CLI statements over reboot. Is there a "write" CLI command that stores in non-volatile memory?

Anyone solved this?

Thanks,

Edwin

UBNT-keba
01-02-2009, 04:01 AM
Read once again ;-)

/etc/persistent/rc.poststart

Check directory. It is not

/etc/rc.d/rc.poststart

Also do not forget execute
cfgmtd -w -p /etc/
to store all /etc/persistent/ content to flash. Do not put to much stuff on /etc/persistent/. All must fit in to 64kB.

Also use search in this forum. There was exactly the same samples about additional routes by using custom scripts.

CzechEnglishFrenchGermanItalianPolishPortugueseRussianSpanish
Translated to other languages supported by vBET Translator 3.5.4