What's new

[Fork] Asuswrt-Merlin 374.43 LTS releases (Archive)

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

@Martineau
I got the script working. This funcktion doesn't get any value $1 tested with $dev to.
Code:
DEV=$1
VPN_ID=${DEV:4:1}   # << tun1(1)
if [ $(Check_VPNState $VPN_ID $CONNECTED) = $CONNECTED ]; then
VPN_WANIP=`curl -s --interface "tun1"$VPN_ID "http://ipecho.net/plain"`
 
@Martineau
I got the script working. This funcktion doesn't get any value $1 tested with $dev to.
Code:
DEV=$1
VPN_ID=${DEV:4:1}   # << tun1(1)
if [ $(Check_VPNState $VPN_ID $CONNECTED) = $CONNECTED ]; then
VPN_WANIP=`curl -s --interface "tun1"$VPN_ID "http://ipecho.net/plain"`

Does Syslog show the execution of scripts openvpn-event,VPNClient1_route-up.sh and ip_vpn.sh?
What are the messages in Syslog?

What happens if you run the ip_vpn.sh script from the command line?

Code:
./ip_vpn.sh   tun11
 
@Martineau
If I execute with, haven't replaced "VPN_DNS_Update.sh" and "dnsmasq.conf.add" yet in script.
./ip_vpn.sh tun11
I get:
Code:
Jan 17 22:07:46 (again.sh): 14791 Identifying VPN Client 1 WAN address and e-mail.......
Jan 17 22:07:47 (ip_vpn.sh): 14791 Waiting for VPN Client 1 (ovpnc1) to connect.....
Jan 17 22:07:48 (ip_vpn.sh): 14791 VPN Client 1 (ovpnc1) connect'd in 0 secs
Jan 17 22:07:48 (ip_vpn.sh): 14791 **Warning Skipping '/jffs/configs/dnsmasq.conf.add' DNS updates for VPN Client 1 (ovpnc1)
Jan 17 22:07:48 (ip_vpn.sh): 14791 Send e-mail: VPN Client 1 WAN IP address is 4x.2x7.xx.xx
Code:
+ DEV=tun11
+ VPN_ID=1
Seems to work that way.
 
Can you also show the syslog entry for openvpn-event?
I don't have any, testing with: ./ip_vpn.sh tun11 at the moment. (hope i understad you right)
 
@Martineau
If I execute with, haven't replaced "VPN_DNS_Update.sh" and "dnsmasq.conf.add" yet in script.

Whoops :eek: I forgot to remove the code for my DNS update requirements :oops: although it doesn't affect the desired outcome of the script!

i.e. the ip-vpn.sh code should be modified

from

Code:
if [ "$OK" = "1" ];then
   Say "VPN Client" $1 "("$VPNTAG")" $WSTATE"'d in" $i "secs"
   if [ "$WSTATE" == "connect" ]; then
    # Update /jffs/configs/dnsmasq.conf.add with new HMA DNS for any VPNxDomains
    if [ -f /jffs/scripts/VPN_DNS_Update.sh ] && [ -f /jffs/configs/dnsmasq.conf.add ];then
      sh /jffs/scripts/VPN_DNS_Update.sh $1
    else
     Say "**Warning Skipping '/jffs/configs/dnsmasq.conf.add' DNS updates for VPN Client" $1 "("$VPNTAG")"
    fi
   fi
      echo "2"
   else
   echo -e " "
   Say "***ERROR*** VPN Client" $1 "("$VPNTAG") FAILED to" $WSTATE "after" $i "secs"
   echo -e "\a?"
fi

to simply

Code:
if [ "$OK" = "1" ];then
   Say "VPN Client" $1 "("$VPNTAG")" $WSTATE"'d in" $i "secs"
      echo $2          # Return whatever NVRAM state was requested to be matched e.g. '2' ('connected') or '0' ('disconnected')
      return 0
   else
      Say "***ERROR*** VPN Client" $1 "("$VPNTAG") FAILED to" $WSTATE "after" $i "secs"
      echo -e "\a?"    #  Return '?' ('unknown') neither 'connected' nor 'disconnected'
      return 1
fi

So if ip_vpn.sh correctly identifies the VPN WAN address without the use of @canufrank's script, then all you need to do now is create the VPNClient1-route-up.sh which is called from openvpn-event.
 
Last edited:
@Martineau
Okey, thanks no problem. Only thing I don't know just now how to call my sendmail script?
/jffs/configs/sendmail.sh vpnup
 
@Martineau
Okey, thanks no problem. Only thing I don't know just now how to call my sendmail script?
/jffs/configs/sendmail.sh vpnup

Replace the call to the example Send_mail procedure

Send_Mail $VPN_ID $VPN_WANIP

with a call to your /jffs/configs???/sendmail.sh script and pass the appropriate VPN WAN IP as an additional argument, or simply copy your sendmail.sh code inline.
 
Thanks, that testing will be tomorrow. :)
 
01172017.jpg

Hello, I just loaded the latest fork FW on my AC68U. Does anyone know why I can't seem to be able to view the Tools tab? Sometimes I get this view, with a slow response that won't refresh.
 
Hello, I just loaded the latest fork FW on my AC68U. Does anyone know why I can't seem to be able to view the Tools tab? Sometimes I get this view, with a slow response that won't refresh.
I don't know about the Tools tab, but showing the log could take very long if you have it saved in /opt/var/log.
 
View attachment 8283
Hello, I just loaded the latest fork FW on my AC68U. Does anyone know why I can't seem to be able to view the Tools tab? Sometimes I get this view, with a slow response that won't refresh.
What firmware was on previously? The corrupted Tools page is an indicator that a factory default reset is required.

But, I'd like to track down what nvram setting is causing the problem. Can you login to the router and
save the nvram before
nvram show > before.txt

and after the reset.
nvram show > after.txt

Then post them to a file sharing site and send me a PM.
 
What firmware was on previously? The corrupted Tools page is an indicator that a factory default reset is required.

But, I'd like to track down what nvram setting is causing the problem. Can you login to the router and
save the nvram before
nvram show > before.txt

and after the reset.
nvram show > after.txt

Then post them to a file sharing site and send me a PM.

Prior FW was Asus 376.3626, from Recovery Mode.
Then to Fork 22E4.

Edit: I've done a factory reset, and that fixed it. I've saved the NVRAM Before, now doing the After. I'll PM when I've saved them to a hosting site. Thanks John.
 
Last edited:
I don't know if this is a bug or what but dnsbench says this when I try to run the benchmark.
This only happens on 22e4, rolled back to 22e2 and it runs normally.
 
I don't know if this is a bug or what but dnsbench says this when I try to run the benchmark.
This only happens on 22e4, rolled back to 22e2 and it runs normally.
The only scenario I can think of is that you enabled DNSSEC with 'Strict enforcement' checked (new in 22E4), but your your DNS server is not really DNSSEC enabled. But then, you should have other problems, like the router system time not being set and no internet access........

Unless....you are also using DNSFilter on the system you are running from and pointing to a specific non-router server or have a DNS servers set on the LAN page. Then you would have internet access, but your router would still be in trouble since the system time couldn't be set.
 
It works fine for me. Is it because you're using DNSCrypt or something like that?

I do have dnscrypt enabled.

The only scenario I can think of is that you enabled DNSSEC with 'Strict enforcement' checked (new in 22E4), but your your DNS server is not really DNSSEC enabled. But then, you should have other problems, like the router system time not being set and no internet access........

Unless....you are also using DNSFilter on the system you are running from and pointing to a specific non-router server or have a DNS servers set on the LAN page. Then you would have internet access, but your router would still be in trouble since the system time couldn't be set.

Strict enforcement is disabled, no dns filter on the system, no dns servers on the lan page as well. The dnscrypt servers I am using are 'dnscrypt.eu with dnssec' servers (after i clarified another issue with you a few days back). I got no other symptoms other than a few failed queries in chrome which would then quickly resolve.
 
Replace the call to the example Send_mail procedure
Send_Mail $VPN_ID $VPN_WANIP
with a call to your /jffs/configs???/sendmail.sh script and pass the appropriate VPN WAN IP as an additional argument, or simply copy your sendmail.sh code inline.
@Martineau I can't move my sendmail script, can send several different mail.
I can not get "additional argument" to function.
I think you meant this, hope I get that right.
One solution would be write to nvram and "nvram get"
Code:
if [ -f /jffs/configs/sendmail.sh ]; then
sh /jffs/configs/sendmail.sh $VPN_WANIP
 
Last edited:
I can not get "additional argument" to function.
Just to double check....in your sendmail script where you would need the value of $VPN_WANIP your are referencing it as $1 correct?

EDIT: And that you are testing by calling from the vpnclient scripts. A lot of the environment variables that are being used aren't created unless the call originates from openvpn.
 
Just to double check....in your sendmail script where you would need the value of $VPN_WANIP your are referencing it as $1 correct?

EDIT: And that you are testing by calling from the vpnclient scripts. A lot of the environment variables that are being used aren't created unless the call originates from openvpn.

@john9527
Thanks think i got it. $2 working.
Now I can se my vpn_ip in mail. :)
 
Last edited:

Sign Up For SNBForums Daily Digest

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