What's new

YazFi Change Hostname for YazFi clients

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

N

nikr

Guest
Is it possible to change hostnames for Guest clients using YazFi?
 
Seems like I found the solution while reading about something else.

1618416151657.png
 
Seems like I found the solution while reading about something else.
<snip>
Just an FYI if following those directions (from the YazFi Github Wiki post). If one has a problem with the static/fixed IP address not being assigned to the YazFi client(s). Reverse the [DESIRED HOSTNAME],[DESIRED IP ADDRESS] so it's [DESIRED IP ADDRESS],[DESIRED HOSTNAME] and see if that fixes the issue.

Example:
pc_append "dhcp-host=XX:XX:XX:XX:XX:XX,192.168.3.2,devicename" $CONFIG

Edit to add: If anyone's interested in the setting of a static IP for YazFi clients, and one method of getting a Pi-Hole to use client names, see the following two posts in the older YazFi thread where this was previously discussed.
https://www.snbforums.com/threads/y...inc-ssid-vpn-client.45924/page-32#post-473403
https://www.snbforums.com/threads/y...inc-ssid-vpn-client.45924/page-57#post-564713
 
Last edited:
I am also currently trying to set this up.

My setup is RT-AC5300 with Merlin 386.2_6 and YazFi v4.2.1

What works is the Set IP Reservation.
What doesnt work is the Set Hostname.

Set IP reservation works for me like this:
Bash:
#!/bin/sh
source /usr/sbin/helper.sh
CONFIG=$1
#Set IP reservation
pc_append "dhcp-host=AB:CD:EF:12:34:56,set:AB:CD:EF:12:34:56,192.168.5.101,devive1" $CONFIG
If I reverse/switch any of the above around it wont work anymore.


I have set the #Set Hostname as follows.
Bash:
#Set Hostname
pc_append "dhcp-host=AB:CD:EF:12:34:56,device1" $CONFIG
It will just not work.

Any advice how I can get the hostnames to work?
 
Not sure if there is something specific to the RT-AC5300, but different Asus router running Merlin 386.2_6 and YazFi, no issues with assigning guest client names and IP addresses using the following (as detailed in my prior post). Example:
Code:
pc_append "dhcp-host=AC:63:BE:5A:B5:28,192.168.6.10,AmazonEcho" $CONFIG

Example dnsmasq.postconf file:
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_append "dhcp-host=AC:63:BE:5A:B5:28,192.168.6.10,AmazonEcho" $CONFIG
cat /jffs/addons/YazFi.d/.dnsmasq >> /etc/dnsmasq.conf # YazFi
Edit to add: Couple of screen shots showing the guest name. Bit hard to see in the Putty cat /var/lib/misc/dnsmasq.leases capture (first image) but the guest name is there. The second image shows the guest name via the Merlin GUI > System Log > Wireless Log page. The third image shows the guest wifi name in the YazFi GUI option #2 listing.

cat_dnsmasq_leases.jpg


GUI_Wireless_Log.jpg


YazFiOption2.jpg
 
Last edited:
Well IPs are correctly reserverd/assigned... only issue is that hostname isnt working :(

Bash:
#Set IP reservation
pc_append "dhcp-host=AB:CD:EF:12:34:56,set:AB:CD:EF:12:34:56,192.168.5.101,device1" $CONFIG
#Set Hostname
pc_append "dhcp-host=AB:CD:EF:12:34:56,device1" $CONFIG

Isnt that the same command for both IP Reseveration / Hostname setting?
Only thing missing is the ip address in Set Hostname command... so kind of double and also into the same file.

I am not an expert, but have a feeling that the error must be in there...

Also I see you have
Bash:
cat /jffs/addons/YazFi.d/.dnsmasq >> /etc/dnsmasq.conf # YazFi
at the end of your script... if I add this at the end of the script, then my Wifi-Clients wont even get an IP.
 
Couple of comments. First stupid question time, did you change the permissions on the dnsmasq.postconf? Failure to do so can cause the assignments not to be made, particularly at router reboot.

Code:
chmod +xxx /jffs/scripts/dnsmasq.postconf

Second, you may need to check the /etc/dnsmasq.conf file to see how things are being listed in there for each of the assigned guests. If there are multiple entries for each guest, because you are using two pc_append entries to assign name and IP address, perhaps that is causing an issue or a conflict you are seeing.

Third, and if the guest was previously assigned a static IP using the Merlin GUI DHCP page, make sure to remove that static IP entry for the device from that page to avoid any potential conflicts when assigning the names/ip address for the YazFi guest.

Edit to add: Also not sure what the value you are using: "set:AB:CD:EF:12:34:56" does. I had thought (with my limited knowledge of these things) that the dhcp-host= value had to be structured either <ipaddress>,<hostname> or <macaddress>,<ipaddress> or <macaddress>,<ipaddress>,<hostname>.

Example use:
pc_append "dhcp-host=192.168.5.101,device1" $CONFIG

Or use:
pc_append "dhcp-host=AB:CD:EF:12:34:56,192.168.5.101,device1" $CONFIG

Don't use both.
 
Last edited:
First of all: Thank you for your support - I really appreciated it.

It works now. Your screenshots actually were very helpful and hinted to the solution for me.

This is the issue:

Bash:
interface=wl0.3
dhcp-range=wl0.3,10.20.31.2,10.20.31.254,255.255.255.0,86400s
dhcp-option=wl0.3,3,10.20.31.1
dhcp-option=wl0.3,6,10.20.30.11,10.20.30.22

Als DNS servers are basically on the main network which is 10.20.30.0/24 , so if I ping anything in 10.20.31.0/24 it wont be able to resolve.

I manually added now local DNS entries to the piholes (10.20.30.11 & .22) and now all works like a charm.
 
I have Yazfi installed and I am not sure where it is getting the Hostnames from.

I looked at jffs/addons/YazFi.d/.dnsmasq, /jffs/scripts/dnsmasq.postconf and also /etc/dnsmasq.conf but I do not have any entries with hostnames showing. I don't care what the IP is but would like to change the names that YazFi is pulling.

If I disable the guest wi-fi and have the devices show up in network map I see different names than what is showing in YazFi. The names in YazFi are ones I used in my old house so I must have changed them somehow but not sure where I saved the info.

Was hoping someone could assist. If anymore info is needed please let me know and I will reply.
 
Last edited:
I found entries in

/var/lib/misc/dnsmasq.leases

with the same names showing in Console GUI under Yazfi. I changed the names and it did change also in YazFi but then I rebooted and they went back to what they were before.
 
I have Yazfi installed and I am not sure where it is getting the Hostnames from.
YazFi generally doesn't define or assign a client's hostname. It simply pulls that information from the underlying system (dnsmasq). One can change those hostnames so the system uses the user defined name. One way to do so with YazFi is to assign YazFi clients manual IP addresses using the /jffs/scripts/dnsmasq.postconf file. See the following for more information on how to set manual reservations for YazFi clients:
https://github.com/jackyaz/YazFi/wi...verse-DNS-records#a-note-on-dhcp-reservations
https://www.snbforums.com/threads/y...inc-ssid-vpn-client.45924/page-32#post-473403
 
YazFi generally doesn't define or assign a client's hostname. It simply pulls that information from the underlying system (dnsmasq). One can change those hostnames so the system uses the user defined name. One way to do so with YazFi is to assign YazFi clients manual IP addresses using the /jffs/scripts/dnsmasq.postconf file. See the following for more information on how to set manual reservations for YazFi clients:
https://github.com/jackyaz/YazFi/wi...verse-DNS-records#a-note-on-dhcp-reservations
https://www.snbforums.com/threads/y...inc-ssid-vpn-client.45924/page-32#post-473403

Thanks for the info I am just confused as to where it is getting the names from. They are Unique names that I used in my old house.

"WeMo - Living Room Light 1" for example. I know I did set up that name in the past just can't figure out where or what file I put it in.

Unless I am really missing the point the instructions say they should be stored in /jffs/scripts/dnsmasq.postconf but this is all my file has.


#!/bin/sh
. /opt/share/diversion/file/post-conf.div # Added by Diversion
/jffs/scripts/uiDivStats dnsmasq & # uiDivStats
cat /jffs/addons/YazFi.d/.dnsmasq >> /etc/dnsmasq.conf # YazFi
 
Last edited:
Thanks for the info I am just confused as to where it is getting the names from. They are Unique names that I used in my old house.

WeMo - Living Room Light 1 for example. I know I did set up that name in the past just can't figure out where or what file I put it in.
Have you checked the device themselves (if IoT devices check via their app)? Its possible the device itself is assigning the name your seeing. Its also possible there is some left over bits being picked up by the router if you moved houses and didn't reset the router when setting it up at the new house and configuring new names.
 
Have you checked the device themselves (if IoT devices check via their app)? Its possible the device itself is assigning the name your seeing. Its also possible there is some left over bits being picked up by the router if you moved houses and didn't reset the router when setting it up at the new house and configuring new names.

The names in the app are not what is showing in YazFi either, it would be great if that was the case as that is what I would like for them to show as in YazFi.

I didn't reset my router after moving as it took me a long time to get it all working I am not that great with router config and networking as you might tell.

is there any other files that I might have edited to have these names? I know it isn't a big deal I just wish I could find where these names are stored.
 
Did you previously assign manual IP addresses to these devices via the DHCP Server page? If so are they still there? If they are, you could try removing them, applying the setting change, rebooting the router to see if the hostnames change (or are removed).
 
Did you previously assign manual IP addresses to these devices via the DHCP Server page? If so are they still there? If they are, you could try removing them, applying the setting change, rebooting the router to see if the hostnames change (or are removed).
I did but I removed them awhile ago after installing YazFi. I am wondering if that is where they are stuck? is there a file I can check to see or just in GUI. I remember manually adding these to a file a long time ago but can't remember where for the life of me.

Before I installed YazFi I had assigned manual IP addresses to all my devices.
 
I did but I removed them awhile ago after installing YazFi. I am wondering if that is where they are stuck? is there a file I can check to see or just in GUI. I remember manually adding these to a file a long time ago but can't remember where for the life of me.

Before I installed YazFi I had assigned manual IP addresses to all my devices.
One place to check for static DHCP reservations (assumes you are not using YazDHCP) is /jffs/nvram/dhcp_staticlist file and /jffs/nvram/custom_clientlist file using SSH.
Another place to look is in the NVRAM to see if anything is saved there. Via SSH issue a command like the following: nvram show 2>/dev/null | grep "dhcp_staticlist=" and nvram show 2>/dev/null | grep "custom_clientlist=".

Post edit
 
One place to check for static DHCP reservations (assumes you are not using YazDHCP) is /jffs/nvram/dhcp_staticlist file and /jffs/nvram/custom_clientlist file using SSH.
Another place to look is in the NVRAM to see if anything is saved there. Via SSH issue a command like the following: nvram show 2>/dev/null | grep "dhcp_staticlist=" and nvram show 2>/dev/null | grep "custom_clientlist=".

Post edit
Thakns but no luck, I ran "nano /jffs/nvram/dhcp_staticlist" and the file was blank.

ran the second commad and nothing happened.
 
Thakns but no luck, I ran "nano /jffs/nvram/dhcp_staticlist" and the file was blank.

ran the second commad and nothing happened.
See my post edit above, there are two other places to check, custom clients.
 
One place to check for static DHCP reservations (assumes you are not using YazDHCP) is /jffs/nvram/dhcp_staticlist file and /jffs/nvram/custom_clientlist file using SSH.
Another place to look is in the NVRAM to see if anything is saved there. Via SSH issue a command like the following: nvram show 2>/dev/null | grep "dhcp_staticlist=" and nvram show 2>/dev/null | grep "custom_clientlist=".

Post edit
i Wasn't using YazDHCP but I did install it to see if that would fix anyting.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top