YazFi Change Hostname for YazFi clients

  • ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

nikr

Regular Contributor
Is it possible to change hostnames for Guest clients using YazFi?
 

nikr

Regular Contributor
Seems like I found the solution while reading about something else.

1618416151657.png
 

bennor

Senior Member
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:

rezzorix

New Around Here
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?
 

bennor

Senior Member
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:

rezzorix

New Around Here
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.
 

bennor

Senior Member
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:

rezzorix

New Around Here
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.
 

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