see Host name ; device nameThis is a slight digression, but is what appears as "Client Name" the same as the hostname supplied by the DHCP client?
Probably from the Organizational Unique Identifier, OUI Database lookup aka Vendor ID i.e. first 24-bits of MAC address?Thanks, not exactly my question. If I haven't entered it as an alias, what populates the field? For example, all three of my computers with ASRock motherboards have this field populated as "ASRock Corporation". One of my Tivo's has "TIVOandtheserialnumber" and the other says "Dish Technologies". Just curious where these come from, since none of them are from me.
I think perhaps for the "Device" field and what you get for "Manufacturer" when clicking on a mac address, but not the client name field.Probably from the Organizational Unique Identifier, OUI Database lookup aka Vendor ID i.e. first 24-bits of MAC address?
I verified that one can create an dhcp static lease reservation without entering the hostname.
Run these commands and let me know if you get different word count values for staticlist and hostnames:Xentrk,
I used your script to backup dhcplist on my RT-AX88U ... I observed that some of the items do not have IP addresses as shown below. May I know what have I done wrong? Thanks
View attachment 19605
awk '{print $0}' /jffs/nvram/dhcp_staticlist | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/staticlist.txt
awk '{print $0}' /jffs/nvram/dhcp_hostnames | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/hostnames.txt
word_count_staticlist=$(head -1 /tmp/staticlist.$$ | wc -w)
echo "Value of staticlist wc is $word_count_staticlist"
word_count_hostnames=$(head -1 /tmp/hostnames.$$ | wc -w)
echo "Value of hostnames wc is $word_count_hostnames"
rm /tmp/staticlist.txt
rm /tmp/hostnames.txt
Xentrk,Run these commands and let me know if you get different word count values for staticlist and hostnames:
awk '{print $0}' /jffs/nvram/dhcp_staticlist | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/staticlist.txt
awk '{print $0}' /jffs/nvram/dhcp_hostnames | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/hostnames.txt
word_count_staticlist=$(head -1 /tmp/staticlist.txt | wc -w)
echo "Value of staticlist wc is $word_count_staticlist"
Value of staticlist wc is 78
word_count_hostnames=$(head -1 /tmp/hostnames.txt | wc -w)
echo "Value of hostnames wc is $word_count_hostnames"
Value of hostnames wc is 78
rm /tmp/staticlist.txt
rm /tmp/hostnames.txt
Hello @LimJKXentrk,
Thank you for your reply, the word count values are the same, 78:
Code:awk '{print $0}' /jffs/nvram/dhcp_staticlist | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/staticlist.txt awk '{print $0}' /jffs/nvram/dhcp_hostnames | sed 's/<//;s/>undefined//;s/>/ /g;s/</ /g' >/tmp/hostnames.txt word_count_staticlist=$(head -1 /tmp/staticlist.txt | wc -w) echo "Value of staticlist wc is $word_count_staticlist" Value of staticlist wc is 78 word_count_hostnames=$(head -1 /tmp/hostnames.txt | wc -w) echo "Value of hostnames wc is $word_count_hostnames" Value of hostnames wc is 78 rm /tmp/staticlist.txt rm /tmp/hostnames.txt
####################################################################################################
# Script: dhcpstaticlist.sh
# Original Author: Xentrk
# Last Updated Date: 18-Sept-2019
# Compatible with 384.13
# Version 2.0.2
Xentrk or others,Can you send me a PM containing the contents of /jffs/nvram/dhcp_staticlist and /jffs/nvram/dhcp_hostnames so I can do some debugging?
Click on the Inbox option and select "Start a new conversation"Xentrk or others,
Can someone tell me how to PM and send the 2 files to Xentrk? Sorry, thanks.
Warning: dhcp_staticlist and dhcp_hostnames word count do not match
This indicates you have not entered hostnames for some static IP reservations
Best practice is to enter descriptive hostnames
Press enter to continue
dhcp-host=34:97:E8:25:D4:7A,192.168.22.100
dhcp-host=01:61:57:EC:AF:8E,192.168.22.149,AmazonFireTV-2
dhcp-host=39:05:95:29:E2:7D,192.168.22.150,SamsungTV
dhcp-host=B6:BF:F9:9B:EB:66,192.168.22.151,Samsung-Phone
<snip>
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/Xentrk/Asuswrt-Merlin-Linux-Shell-Scripts/master/dhcpstaticlist.sh" -o "/jffs/scripts/dhcpstaticlist.sh" && chmod 755 /jffs/scripts/dhcpstaticlist.sh && sh /jffs/scripts/dhcpstaticlist.sh
Xentrk,Another patch has been applied to account for an issue reported by @LimJK on an AX88U where dhcp_staticlist contains a new field separator format.
##################################################################################
# Script: dhcpstaticlist.sh
# Original Author: Xentrk
# Last Updated Date: 19-October-2019
# Compatible with 384.13
# Version 2.0.5
nvram get dhcp_staticlist > /tmp/mnt/ASUS/dhcplist.txt
nvram get custom_clientlist > /tmp/mnt/ASUS/custom_clientlist.txt
nvram get dhcp_hostnames > /tmp/mnt/ASUS/dhcp_hostnames.txt
I can add that feature. I am curious as to how custom_clientlist gets populated though. Do you know? I have one entry in my AC88U development router and a subset of entries that I have listed for static lease reservations on an AC86U.Xentrk,
May I suggest that you consider to include another NVRAM item "custom_clientlist" in your utility, I observed that "ASUS Router" ios App uses this information for devices that are listed in the OFFLINE list.
In the past I have been using John's Script (save-mynvram.sh) or the following to save and restore NVRAM items:
Code:nvram get dhcp_staticlist > /tmp/mnt/ASUS/dhcplist.txt nvram get custom_clientlist > /tmp/mnt/ASUS/custom_clientlist.txt nvram get dhcp_hostnames > /tmp/mnt/ASUS/dhcp_hostnames.txt
However, I found out that dhcp_hostnames has been moved to "/jffs/nvram/dhcp_hostnames" for my RT-AX88U, that was why I started to look for an alternative and found this thread
dhcp1_dns1_x
dhcp1_enable_x
dhcp1_end
dhcp1_gateway_x
dhcp1_lease
dhcp1_start
dhcp1_static_x
dhcp1_staticlist
dhcp1_wins_x
dhcp_dns1_x
dhcp_dns2_x
dhcp_enable_x
dhcp_end
dhcp_gateway_x
dhcp_hostnames
<snip>
Xentrk,I can add that feature. I am curious as to how custom_clientlist gets populated though. Do you know? I have one entry in my AC88U development router and a subset of entries that I have listed for static lease reservations on an AC86U.
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!