PDA

Bekijk de volledige versie : How to best navigate in Oleg's firmware and all it's possibilities



wakatana
07-04-2015, 01:16
Hello,

some time ago I've installed Oleg FW. I did not use it extensively (only features that are available also via original firmware) and now I want to give it a chance and being able to configure my whole router using only command line. I do not know if firmware and community is still active. I have older piece of hardware, Wl500g Deluxe (with Oleg FW release 1.9.2.7-9) and Wl500g Premium (with Oleg FW release 1.9.2.7-d-r2624). I would like to ask if there is some general info about how to do particular operation via command line instead of web interface. I've been searching for some sort of refference book for commands that are available via command line but did not find anything. Then I found that there is someting called nvram which is used for storing configuration. Now I can show all nvram options with their corresponding values via following command:


[admin@wl500g root]$ nvram show

the number of options that my nvram command understand is 550



[admin@wl500g root]$ nvram show | wc -l
size: 10051 bytes (22717 left)
550


Then I start asking myself if all 550 options are activelly used, and what is their purpose? I've also found that there are options with simmilar names, but one has set value the another hasn't:


wan_hwaddr vs wan0_hwaddr


When I've saved the current config via web interface and try to read it I've realized that it is just the options with specified values for nvram command (number of options are the same as when I access router from command line):



└──> cat WL500g.CFG | tr '\0' '\n' | grep -v '^$' | sort | grep -i '[a-z]' | wc -l
550



Now when I want to know which web setting are corresponding to which nvram option the only one possibility that comes to my mind is:
1. Backup old config
2. Change setting via web interface
3. Backup new config
4. Compare configs
5. Differences will be the nvram options that are responsible for changed settings

This process seems very tedious, is there any better way of how to know which nvram option corresponds to which web interface option? I was thinking about running Oleg inside virtual machine and write some scripts that can help with that. Another drawback is that this will only work for settings that are stored in nvram. As a Linux user I am familiar with /etc directory where the most settings are stored. Does Oleg's FW use (I bet I will) some other locations for storing settings. For example I have found that information about DNS is stored on two places:



[admin2@wl500gP root]$ cat /etc/resolv.conf
nameserver 192.168.3.3


and



admin2@wl500gP root]$ nvram show | grep lan_dns
size: 11925 bytes (20843 left)
lan_dns=192.168.3.3


Why both? Is the primary info stored in nvram and
/etc/resolv.conf is just generated for some compatibility issues? Or is ther any rule of thumb that says: "... types of settings ar stored in nvram and .... are stored in ..."? I have seen this (http://www.dd-wrt.com/phpBB2/viewtopic.php?t=44448) tutorial where whole system was booted from USB (of course it was OpenWRT not Oleg but you get the point) if this is possible this mean that there is another place except nvram where setings are stored. What to backup if I want all Oleg settings? I have also noticed that many (I thing cruccial) commands are simmilar with WRT. Can I use tutorials which are for WRT and apply them for Oleg and vice versa. I am not sure about this because I've found this (http://trivius.wz.cz/Asus_refguide.html#6) page (czech) where there are separate tutorials for Oleg and WRT. Are those two systems such different, are there any simmilarities? I mean if there is any logic which will help me understand Oleg when I know WRT or vice versa? I have found this (http://www.amazon.com/Linksys-WRT54G-Ultimate-Hacking-Asadoorian/dp/1597491667) book which particulary deals with OpenWRT. It seems to be interesting reading, but I am wondering if it will help me also with Oleg. I would like to use command line instead of web interface but one thing that sticks me to web interface is fear that I will brick my router using command line, is there some recommendation for settings that are better to not touch from command line, or bricking router from command line is not possible (I do not thing so)? I have read (slovak) this (https://web.archive.org/web/20101120085526/http://blackhole.sk/topicopenwrt-asus-wl-500gp) tutorial where one repaired bricked router (again tutoprial for WRT) only with external USB disk and approporiate scripts. So to summarize my questions: How to best navigate and understand Oleg's firmware and all it's possibilities for somebody who have experiences with Linux?

epsauod
07-04-2015, 21:24
Hello,

some time ago I've installed Oleg FW. I did not use it extensively (only features that are available also via original firmware) and now I want to give it a chance and being able to configure my whole router using only command line. I do not know if firmware and community is still active. I have older piece of hardware, Wl500g Deluxe (with Oleg FW release 1.9.2.7-9) and Wl500g Premium (with Oleg FW release 1.9.2.7-d-r2624). I would like to ask if there is some general info about how to do particular operation via command line instead of web interface. I've been searching for some sort of refference book for commands that are available via command line but did not find anything. Then I found that there is someting called nvram which is used for storing configuration. Now I can show all nvram options with their corresponding values via following command:


[admin@wl500g root]$ nvram show

the number of options that my nvram command understand is 550



[admin@wl500g root]$ nvram show | wc -l
size: 10051 bytes (22717 left)
550


Then I start asking myself if all 550 options are activelly used, and what is their purpose? I've also found that there are options with simmilar names, but one has set value the another hasn't:


wan_hwaddr vs wan0_hwaddr


When I've saved the current config via web interface and try to read it I've realized that it is just the options with specified values for nvram command (number of options are the same as when I access router from command line):



└──> cat WL500g.CFG | tr '\0' '\n' | grep -v '^$' | sort | grep -i '[a-z]' | wc -l
550



Now when I want to know which web setting are corresponding to which nvram option the only one possibility that comes to my mind is:
1. Backup old config
2. Change setting via web interface
3. Backup new config
4. Compare configs
5. Differences will be the nvram options that are responsible for changed settings

This process seems very tedious, is there any better way of how to know which nvram option corresponds to which web interface option? I was thinking about running Oleg inside virtual machine and write some scripts that can help with that. Another drawback is that this will only work for settings that are stored in nvram. As a Linux user I am familiar with /etc directory where the most settings are stored. Does Oleg's FW use (I bet I will) some other locations for storing settings. For example I have found that information about DNS is stored on two places:



[admin2@wl500gP root]$ cat /etc/resolv.conf
nameserver 192.168.3.3


and



admin2@wl500gP root]$ nvram show | grep lan_dns
size: 11925 bytes (20843 left)
lan_dns=192.168.3.3


Why both? Is the primary info stored in nvram and
/etc/resolv.conf is just generated for some compatibility issues? Or is ther any rule of thumb that says: "... types of settings ar stored in nvram and .... are stored in ..."? I have seen this (http://www.dd-wrt.com/phpBB2/viewtopic.php?t=44448) tutorial where whole system was booted from USB (of course it was OpenWRT not Oleg but you get the point) if this is possible this mean that there is another place except nvram where setings are stored. What to backup if I want all Oleg settings? I have also noticed that many (I thing cruccial) commands are simmilar with WRT. Can I use tutorials which are for WRT and apply them for Oleg and vice versa. I am not sure about this because I've found this (http://trivius.wz.cz/Asus_refguide.html#6) page (czech) where there are separate tutorials for Oleg and WRT. Are those two systems such different, are there any simmilarities? I mean if there is any logic which will help me understand Oleg when I know WRT or vice versa? I have found this (http://www.amazon.com/Linksys-WRT54G-Ultimate-Hacking-Asadoorian/dp/1597491667) book which particulary deals with OpenWRT. It seems to be interesting reading, but I am wondering if it will help me also with Oleg. I would like to use command line instead of web interface but one thing that sticks me to web interface is fear that I will brick my router using command line, is there some recommendation for settings that are better to not touch from command line, or bricking router from command line is not possible (I do not thing so)? I have read (slovak) this (https://web.archive.org/web/20101120085526/http://blackhole.sk/topicopenwrt-asus-wl-500gp) tutorial where one repaired bricked router (again tutoprial for WRT) only with external USB disk and approporiate scripts. So to summarize my questions: How to best navigate and understand Oleg's firmware and all it's possibilities for somebody who have experiences with Linux?

Hi,
well, just like you, I resurrected an old asus wl500gp, primarily for using it with a webcam (logitech c270, that is uvcvideo driver compatible and works fine with mjpg-streamer that runs with oleg).

I think that if you want to save your modifications you should use:

nvram commit

Also, I think that -many- parameters you find with "nvram show" are translated into configuration files and commands during boot phase.
If you want to have some infos, even if outdated, you could take a look at http://oleg.wl500g.info

Also, there are other commands to commit changes you do in flashfs (flash file system). You could see some examples here:

https://github.com/Entware/entware/wiki/USB-Storage-setup

Let me know results of your experiments, I may be interested too, but do not brick your old router...

Epsau0d