YazFi YazFi - enhanced AsusWRT-Merlin Guest WiFi inc. SSID <-> VPN Client

  • 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.

Jack Yaz

Part of the Furniture
That's what I first thought as well, but the endpoint appears to be an index as well, not a length.
I've just thrown a few strings and they seem to break at the right place. I think the first number is the index to start, and the second is the length of the string to extract.

I could be wrong but it seems to be working on my AC87U terminal! :confused:
 

Brenneke

Regular Contributor
1) In the terminal like the install script. Copy and paste version below:
Code:
/jffs/scripts/YazFi

2) I'd recommend 192.168.3.1 in your case, i.e. the next subnet up. It can be any subnet you like, my script checks to make sure the selected subnet isn't already in use on the router.

And indeed! I'm toying with the idea of "auto-configuration", so you just set 1 thing and the script sets the rest.
Code:
************@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts/YazFi
YazFi: YazFi v1.1.1 starting up

YazFi: wl01_IPADDR setting last octet to 0

YazFi: wl0.1 passed validation

YazFi: firewall-start doesn't exist, creating

YazFi: wl0.1 (SSID: Telus 2.4) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2

YazFi: VPNCLIENT2 clientlist has changed, restarting

YazFi: DHCP configuration updated

YazFi: YazFi v1.1.1 completed successfully

************@RT-AC68U-ADE8:/tmp/home/root#
No, doesn't have to be automatic, am learning! I really appreciate your script and your assistance - thank you!
 

Jack Yaz

Part of the Furniture
Code:
************@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts/YazFi
YazFi: YazFi v1.1.1 starting up

YazFi: wl01_IPADDR setting last octet to 0

YazFi: wl0.1 passed validation

YazFi: firewall-start doesn't exist, creating

YazFi: wl0.1 (SSID: Telus 2.4) - VPN redirection enabled, sending all interface internet traffic over VPN Client 2

YazFi: VPNCLIENT2 clientlist has changed, restarting

YazFi: DHCP configuration updated

YazFi: YazFi v1.1.1 completed successfully

************@RT-AC68U-ADE8:/tmp/home/root#
No, doesn't have to be automatic, am learning! I really appreciate your script and your assistance - thank you!
All looks good so connect a device to the network and check it shows your VPN IP. If all good I will add the AC68U as confirmed working to the list.

If not, I will do my best to get it all working for you!
 

john9527

Part of the Furniture
I've just thrown a few strings and they seem to break at the right place. I think the first number is the index to start, and the second is the length of the string to extract.

I could be wrong but it seems to be working on my AC87U terminal! :confused:
The second parameter should be a length

${string:position} and ${string:position:length}

"string" specifies our variable name and the "position" is our starting point to extract information from. We can fine tune this further by using the "length" parameter. When length is used with position this means display information starting at position x for a length of y.

So I think that the second parm should always be 255
 

Jack Yaz

Part of the Furniture
The second parameter should be a length



So I think that the second parm should always be 255
Now I do believe you're right on that, I got myself confused between length and index halfway through. I'll patch it in the next version.
 

Jack Yaz

Part of the Furniture
v1.2.0 is available. Key changes:
  • Improved cleanup of networks that were previously enabled. This involved a change to the "clients" added in the Policy Rules table. You must remove the guest network entries from the Policy Routing table, by clicking the "minus" symbol, and then click Apply.

    This is only needed for users updating to v1.2.0, new installs are unaffected.

  • Patch for AC86U users with a lot of policy routed clients (thanks @john9527 !)
Updated script can be downloaded using the below command, run in your SSH/terminal session:
Code:
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/YazFi/master/YazFi" -o "/jffs/scripts/YazFi" && chmod 0755 /jffs/scripts/YazFi && /jffs/scripts/YazFi
 

Brenneke

Regular Contributor
All looks good so connect a device to the network and check it shows your VPN IP. If all good I will add the AC68U as confirmed working to the list.

If not, I will do my best to get it all working for you!
Code:
######                    2.4 GHz Networks                    ######
####################################################################
######                 Guest Network 1 (wl0.1)                 #####
####################################################################
wl01_ENABLED=true
wl01_IPADDR=.0
wl01_DHCPSTART=2
wl01_DHCPEND=254
wl01_DNS1=162.242.211.137
wl01_DNS2=78.46.223.24
wl01_REDIRECTALLTOVPN=true
wl01_VPNCLIENTNUMBER=2
####################################################################
Not working for me yet - Client 3 is set to US server, Client 2 set to Canada - have confirmed both are working correctly. I have both clients set to Start with WAN.
I have no internet on 2.4 guest network and internet on US server on regular network.
After setting config file, save, reopened & confirmed that settings have stuck. After running script, I revisit the config file and find wl01_IPADDR setting changes to .0 every time.
DNS settings are Nord VPN DNS servers.
 

Jack Yaz

Part of the Furniture
Code:
######                    2.4 GHz Networks                    ######
####################################################################
######                 Guest Network 1 (wl0.1)                 #####
####################################################################
wl01_ENABLED=true
wl01_IPADDR=.0
wl01_DHCPSTART=2
wl01_DHCPEND=254
wl01_DNS1=162.242.211.137
wl01_DNS2=78.46.223.24
wl01_REDIRECTALLTOVPN=true
wl01_VPNCLIENTNUMBER=2
####################################################################
Not working for me yet - Client 3 is set to US server, Client 2 set to Canada - have confirmed both are working correctly. I have both clients set to Start with WAN.
I have no internet on 2.4 guest network and internet on US server on regular network.
After setting config file, save, reopened & confirmed that settings have stuck. After running script, I revisit the config file and find wl01_IPADDR setting changes to .0 every time.
DNS settings are Nord VPN DNS servers.
What IP are you entering in _IPADDR? I can do a TeamViewer session with you now if you'd like?
 

Brenneke

Regular Contributor
Sure. PM me the relevant details for the session and I'll join.
Hmmm.....was hoping it was just a web-based thing, TeamViewer not in repositories for Ubuntu.....can we troubleshoot another way?
 

Jack Yaz

Part of the Furniture
Hmmm.....was hoping it was just a web-based thing, TeamViewer not in repositories for Ubuntu.....can we troubleshoot another way?
I think I've spotted the code error, patching and testing now!
 

Jack Yaz

Part of the Furniture
Hmmm.....was hoping it was just a web-based thing, TeamViewer not in repositories for Ubuntu.....can we troubleshoot another way?
v1.2.1 should fix this.
Code:
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/YazFi/master/YazFi" -o "/jffs/scripts/YazFi" && chmod 0755 /jffs/scripts/YazFi && /jffs/scripts/YazFi

Please make sure you have removed any Policy Route entries for the guest SSID so that the updated scripts can re-create them in the new way.

EDIT: Sorry for the added complication for a new user, the Policy Routing change was necessary to make the clean-up more robust :(
 
Last edited:

Brenneke

Regular Contributor
v1.2.1 should fix this.
Code:
/usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/YazFi/master/YazFi" -o "/jffs/scripts/YazFi" && chmod 0755 /jffs/scripts/YazFi && /jffs/scripts/YazFi

Please make sure you have removed any Policy Route entries for the guest SSID so that the updated scripts can re-create them in the new way.

EDIT: Sorry for the added complication for a new user, the Policy Routing change was necessary to make the clean-up more robust :(
No problem at all, really appreciate your time. Policy Route entries are something I would have had to change over and above the installation & setup of your script correct?
Here is what I get when I attempt to run your new command line:
Code:
***********@RT-AC68U-ADE8:/tmp/home/root# /usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/jackyaz/YazFi/master/YazFi" -o "/jffs/scripts/Yaz
Fi" && chmod 0755 /jffs/scripts/YazFi && /jffs/scripts/YazFi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 19732  100 19732    0     0  19732      0  0:00:01 --:--:--  0:00:01 30033
YazFi: YazFi v1.2.1 starting up

YazFi: wl01_IPADDR - .0 - is not a valid IPv4 address, valid format is 1.2.3.4

YazFi: VPN Client 2 is not configured for Policy Routing

YazFi: wl0.1 failed validation

***********@RT-AC68U-ADE8:/tmp/home/root#
 

Jack Yaz

Part of the Furniture
You'll need to put your actual IP (192.168.3.1) in the config file (it will be kept now and not replaced by just .0)

YazFi: wl01_IPADDR - .0 - is not a valid IPv4 address, valid format is 1.2.3.4


Can you confirm the setting you have for Redirect Internet traffic for VPN Client 2 please?
YazFi: VPN Client 2 is not configured for Policy Routing
 

Brenneke

Regular Contributor
You'll need to put your actual IP (192.168.3.1) in the config file (it will be kept now and not replaced by just .0)




Can you confirm the setting you have for Redirect Internet traffic for VPN Client 2 please?

I thought I had to reinstall new script, that is what I got when I attempted to do so.
I changed IP, saved & ran script anyway, this is what I got:
Code:
**********@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts
-sh: /jffs/scripts: Permission denied
***********@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts/YazFi
YazFi: YazFi v1.2.1 starting up

YazFi: VPN Client 2 is not configured for Policy Routing

YazFi: wl0.1 failed validation

[email protected]:/tmp/home/root#
Where do I find Redirect Internet traffic in router interface?
 

Jack Yaz

Part of the Furniture
I thought I had to reinstall new script, that is what I got when I attempted to do so.
I changed IP, saved & ran script anyway, this is what I got:
Code:
**********@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts
-sh: /jffs/scripts: Permission denied
***********@RT-AC68U-ADE8:/tmp/home/root# /jffs/scripts/YazFi
YazFi: YazFi v1.2.1 starting up

YazFi: VPN Client 2 is not configured for Policy Routing

YazFi: wl0.1 failed validation

[email protected]:/tmp/home/root#
Where do I find Redirect Internet traffic in router interface?
Click VPN on the left hand menu (Advanced Settings section), then VPN Client tab, select your client instance (top dropdown, Client 2 for this case), then near the bottom of the page will be the setting.
 

Jack Yaz

Part of the Furniture
v1.2.2 is out, and is a must have update for anyone on 1.2.0 or later. Fixes a bug where iptables rules were being deleted by mistake.
 

Brenneke

Regular Contributor
1) Changed Redirect Internet traffic to Policy Rules (strict)
2) Deleted policy rules with minus sign, apply
3) Ran new command & installed updated script
4) Set IP in config file to 192.168.3.1, saved
5) Ran script
6) Checked, no internet on guest network, internet on regular network on correct server
7) Checked configuration file again, IP now changed to 192.168.3.0
8) Rebooted router, guest network now has internet correctly on Client 2, regular network has internet but no vpn
 

Attachments

  • Screenshot from 2018-04-15 16-32-56.png
    Screenshot from 2018-04-15 16-32-56.png
    126.4 KB · Views: 833
Last edited:

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