What's new

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

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

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:
 
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!
 
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!
 
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
 
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.
 
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.
    63f9bb0269.png

  • 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
 
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.
 
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?
 
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:
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#
 
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
9261a8808d.png
 
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?

9261a8808d.png
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

meinertac68U@RT-AC68U-ADE8:/tmp/home/root#
Where do I find Redirect Internet traffic in router interface?
 
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

meinertac68U@RT-AC68U-ADE8:/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.
 
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.
 
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: 930
Last edited:

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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