ColinTaylor
Part of the Furniture
Check the MAC address against your devices. Maybe it was your PC/phone when you setup the router?Mmmmm... so It seems someone not authorized connect to my samba shared disk...
Check the MAC address against your devices. Maybe it was your PC/phone when you setup the router?Mmmmm... so It seems someone not authorized connect to my samba shared disk...
Yes it's true. This utility was developed for the 380.x and earlier firmware. It has never been updated for the subsequent firmware versions, which contained significant changes to the nvram usage.It will take me a while to even work out how to run this utility (I'm a Windows person), before I do can someone confirm whether the claim is true, I have a RT-AX92U on 384. Thanks.
for i in $(grep "nvram_" /www/*.asp | grep -v hidden | sed 's/^.*nvram_//;s/\;.*$//g' | sed 's/^.*(//g' | sed 's/).*$//g' | sed 's/,.*//g' | sort -u | sed 's/"//g' | grep -v "^$" | sort -fu)
do
if [ ! -z "$(nvram get $i 2>/dev/null | grep -v ^$)" ]; then
echo nvram set $i=\""$(nvram get $i 2>/dev/null)"\"
fi
done
IMHO, scanning the local '/www/*.asp' files is not a reliable method.I don’t offer this as a finished product in any way, but since most of my ideas are only half-baked, I figured I’d share what I was playing with after reading John’s explanation here.
This will blindly fetch any nvram setting in one of the ASP pages that isn’t hidden and write a corresponding nvram set command to stdout. This list would need to be trimmed considerably to avoid transferring things that aren’t meant to be transferred. And ideally remove values that are at the default value. But I figure it’s a start to determining what’s in the current firmware.
My sed commands were kludged together and can surely be combined by someone with real skills.
Code:for i in $(grep "nvram_" /www/*.asp | grep -v hidden | sed 's/^.*nvram_//;s/\;.*$//g' | sed 's/^.*(//g' | sed 's/).*$//g' | sed 's/,.*//g' | sort -u | sed 's/"//g' | grep -v "^$" | sort -fu) do if [ ! -z "$(nvram get $i 2>/dev/null | grep -v ^$)" ]; then echo nvram set $i=\""$(nvram get $i 2>/dev/null)"\" fi done
grep "nvram_" /www/*.asp | grep -v hidden | sed 's/^.*nvram_//;s/\;.*$//g' | sed 's/^.*(//g' | sed 's/).*$//g' | sed 's/,.*//g' | sort -u | sed 's/"//g' | grep -v "^$" | sort -fu | grep vpn_client1
vpn_client1_addr
vpn_client1_desc
vpn_client1_port
vpn_client1_proto
vpn_client1_rip
curl https://raw.githubusercontent.com/RMerl/asuswrt-merlin.ng/master/release/src/router/shared/defaults.c -o /tmp/defaults.c
awk ' BEGIN { FS = ","} /CKN_/ {print $1}' /tmp/defaults.c | grep -v "^\/\/"| sed 's/[[:space:]]//g' | sort | uniq | tr -d '"{}' | grep vpn_client1
vpn_client1_addr
vpn_client1_adns
vpn_client1_bridge
vpn_client1_cipher
vpn_client1_clientlist
vpn_client1_clientlist1
vpn_client1_clientlist2
vpn_client1_clientlist3
vpn_client1_clientlist4
vpn_client1_clientlist5
vpn_client1_cn
vpn_client1_comp
vpn_client1_connretry
vpn_client1_crypt
vpn_client1_cust2
vpn_client1_cust21
vpn_client1_cust22
vpn_client1_desc
vpn_client1_digest
vpn_client1_enforce
vpn_client1_errno
vpn_client1_fw
vpn_client1_gw
vpn_client1_hmac
vpn_client1_if
vpn_client1_local
vpn_client1_nat
vpn_client1_ncp_ciphers
vpn_client1_ncp_enable
vpn_client1_nm
vpn_client1_password
vpn_client1_port
vpn_client1_proto
vpn_client1_remote
vpn_client1_reneg
vpn_client1_rg
vpn_client1_rgw
vpn_client1_state
vpn_client1_tlsremote
vpn_client1_userauth
vpn_client1_username
vpn_client1_useronly
vpn_client1_verb
You are missing the NVRAM VPN variables vpn_clientX_cust2,vpn_clientX_cust21, vpn_clientX_cust22 etc.I do recall having to reenter the commands in the Custom Config section of the OpenVPN Client Screen and the DDNS information. Other than that, no issues.
I had considered the defaults.c file, but with all the ifdef lines, I couldn't be confident that a variable would exist in any particular configuration. I've also been playing around trying to limit the extract to editable, unhidden radio boxes, checkboxes, dropdowns, password fields and text boxes. To me, this would get 95% of the nvram variables that are intended to be editable by the end-user.IMHO, scanning the local '/www/*.asp' files is not a reliable method.
Given the v384.xx NVRAM variables are now restricted in size, in my scripts, I use a crude hack to determine the maximum permitted size of a variable (before possibly updating it).
So, although not infallible, using the source file, you can potentially retrieve a more comprehensive list of NVRAM variables.
Whilst the NVRAM variables are not router-model specific (i.e. the HND variables would never phyiscally exist on non-HND models), they can be used to create a compatible v384.xx custom '.ini' file for @john9527's script.
grep "<input.*type.*\(checkbox\|radio\|text\|password\).*nvram.*" /www/*.asp | grep -v readonly
grep "<option.*nvram_match.*" /www/*.asp
grep "iphoneSwitch.*nvram_" /www/*.asp
grep "textarea.*nvram.*" /www/*.asp | grep -v readonly
grep "nvram_match_x(" /www/*.asp | sed 's/^.*nvram_.*(/(/;s/\;.*$//g' | awk -F, ' { print $2 }
Agree, I think the risks/misses outweigh the possible positives of using it on the 384 series firmware. But that's just my opinion, others see it differently.AppleBag - I am still trying to understand. But one thing I got from skipping through this and other threads is that there is no current version to save the files in the router. And odd things can occur if you try the old version on a current version.
Not sure I understand this, if you just upgrade the firmware, all your settings should remain. They only get reset if you reset to factory defaults, which shouldn't be necessary between point releases, and probably not even if you skip one or two point releases. My solution has been to screenshot my settings periodically so if I find I need to wipe and start over I have a record of what they are.The people helping on the thread are generally very proficient and helpful. But too many things I don't know. I chose this router just so I can easily update with new Merlin release's that are way better than stock. I fumble around a lot because I do not really understand many of the settings. So having them persist through an update would be good.
Unless you're compiling from source, there should be no reason to download from github. The compiled firmware should be downloaded from https://www.asuswrt-merlin.net/download not github. Merlin's firmware is installed using exactly the same method as for installing firmware from ASUS.I cause way more problems for myself than come with the firmware. It is kind of like rebuilding a slipping transmission in my car. Once upon a time I actually knew things. I was in the bunch that wrote the standards. But no more. I have deteriorated to muggle status. It took me weeks to figure out where Merlin's downloads went. Essentially all downloads go where I want them in Win 10. The system is set to ask. Not github. But the download files from the new system just disappeared. I finally looked through all the files in my computer. Way into the C drive I found I had numerous copies of the release on a folder and a whole bunch of stuff I had never seen and don't particularly want. Did not know to got there.
If you don't know why you're doing it, why are you doing it? Things like Diversion and Skynet you'd know you want to block ads and domains associated with malware. Those have very detailed instructions on installation in the first messages of their respective threads. There's also a pretty good range of how-to's on the Wiki (https://github.com/RMerl/asuswrt-merlin/wiki) for different things you might want to do.The whole thing is getting too complicated for muggles. Particularly for geriatric muggles.
It would be great if there could be a maintained muggle room (wiki?) that really works for simplistic and organized instructions for muggles. Just how to articles describing how to do things without really knowing why.
It's already there on the Restore/Save/Upload Setting page ... the NVRAM utility just expanded on that, adding features such as aiding migration from one router model to another, saving jffs at the same time instead of as a separate operation, etc. For simple backup of your settings, the built-in utility is fine. Why do you think you need the extra granularity of John's NVRAM utility? Even with John's utility, if you ran into a problem with the router and wiped everything, if you reloaded from a recent backup, you'd probably just reload whatever caused the issue in the first place.Being completely undereducated in the subject, but still curious from a creative perspective, would it be difficult to add the abilities of this utility right into the Merlin firmware so you can do the backup/restore (of the utility) right from the backup/restore page of the UI?
Yes, but using John's NVRAM utility you can schedule the backup. And the output is kept, not overwriting, so you can restore to any point.It's already there on the Restore/Save/Upload Setting page ... the NVRAM utility just expanded on that, adding features such as aiding migration from one router model to another, saving jffs at the same time instead of as a separate operation, etc. For simple backup of your settings, the built-in utility is fine. Why do you think you need the extra granularity of John's NVRAM utility? Even with John's utility, if you ran into a problem with the router and wiped everything, if you reloaded from a recent backup, you'd probably just reload whatever caused the issue in the first place.
Two years ago I proposed some changes to @john9527's script - basically to provide more feedback/stats and easier management of the backups.For simple backup of your settings, the built-in utility is fine. Why do you think you need the extra granularity of John's NVRAM utility? Even with John's utility, if you ran into a problem with the router and wiped everything, if you reloaded from a recent backup, you'd probably just reload whatever caused the issue in the first place.
My script proposal post #648 was acknowledged post #666 but never published by @john9527.Is it publicly available?
(the linked post only seems to show the usage?)
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!