[solved] default/my.wanup is running like 20 times

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
dlublink
DD-WRT Novice


Joined: 29 Jan 2008
Posts: 18

PostPosted: Fri Apr 23, 2010 15:21    Post subject: [solved] default/my.wanup is running like 20 times Reply with quote
Hello,

I am running dd-wrt v24 SP1 revision 10020 stable.

I modified the firmware and added a few scripts in /etc/config/

I have a script called "mycoolscript.wanup". When the router starts, it often runs the script multiple times. This morning it ran it about 20 times at once.

I added a locking code into it, but I think that there must be something wrong here.

Is there a status code I am supposed to return at the end of the script execution? What am I doing wrong?

Thanks,

David


Last edited by dlublink on Fri Apr 23, 2010 18:41; edited 1 time in total
Sponsor
ReadtheAnnouncements!
DD-WRT Guru


Joined: 02 Mar 2010
Posts: 1362

PostPosted: Fri Apr 23, 2010 15:23    Post subject: Re: default/my.wanup is running like 20 times Reply with quote
dlublink wrote:
Hello,

I am running dd-wrt v24 SP1 revision 10020 stable.



I can't help with scripts, but dump that build. See below.

_________________
If I've said it once, I've must have said it a thousand times! READ the announcements at the start of the broadcom forum!
THESE:
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=54889
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=51486
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=54845
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=52043
(We'll wait....!) Wink
dlublink
DD-WRT Novice


Joined: 29 Jan 2008
Posts: 18

PostPosted: Fri Apr 23, 2010 17:02    Post subject: Re: default/my.wanup is running like 20 times Reply with quote
ReadtheAnnouncements! wrote:
dlublink wrote:
Hello,

I am running dd-wrt v24 SP1 revision 10020 stable.



I can't help with scripts, but dump that build. See below.


I upgraded to v24 preSP2 (Build13064)

I still have the same problem.

David
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Fri Apr 23, 2010 17:18    Post subject: Reply with quote
You have seen the script execution wiki haven't you? http://www.dd-wrt.com/wiki/index.php/Script_Execution

As explained there, .wanup scripts execute every time the WAN interface comes up. When the router boots it usually has the WAN toggle up 3 times. It's just like as if you had saved your commands to the firewall script in the GUI.

You need to write your script to account for the fact that it will run every time the WAN comes up. Avoid running anything as background processes and if you're doing anything besides iptables (which the firmware flushes and rebuilds) then you need to clean up any mess you create.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
dlublink
DD-WRT Novice


Joined: 29 Jan 2008
Posts: 18

PostPosted: Fri Apr 23, 2010 18:35    Post subject: Re: default/my.wanup is running like 20 times Reply with quote
dlublink wrote:
I still have the same problem.


Ok, I did locking with $$ and although the script is still being launched like 15 times, all the other ones die immediately as it hits the lock.

David
dlublink
DD-WRT Novice


Joined: 29 Jan 2008
Posts: 18

PostPosted: Fri Apr 23, 2010 18:39    Post subject: Reply with quote
phuzi0n wrote:
When the router boots it usually has the WAN toggle up 3 times.


This information is missing from the wiki, I'll add it for the next person who reads the article.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Fri Apr 23, 2010 19:15    Post subject: Reply with quote
Depending on what you're doing locking could be bad. I'm not sure if there's any threading that's making you need it or whether you're running background processes yourself that are to blame, but you should make sure that pulling the WAN cable and plugging it back in doesn't break things for you.
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
jdonkey123
DD-WRT Novice


Joined: 27 Jul 2010
Posts: 9

PostPosted: Thu Jul 29, 2010 6:54    Post subject: WanUp, and up and up up up.... Reply with quote
I also seem to be experiencing some condition which causes my WanUp script to execute often. Is there a more elegant way to make my command not run if the VPN is already up and running?

Situation:
Netgear WNDR3700 running BS build 14815. I'm using the OpenVPN client to keep an established connection with remote network (which has the OpenVPN server.)

Sometimes it seems like it's doing a WanUp every 10 minutes. It only disrupts the VPN for ~2 seconds, but I'm worried that will affect some applications, (SIP, active file transfer, etc.)

Ideal test would be to ping the remote firewall's internal IP, 192.168.0.101 as this would always be available if the VPN is active. If ping fails, kill OpenVPN and then issue startup command again.

I'm VERY new to linux/DD-WRT, is there a command/script action to do this? If not, what are the less robust options I could settle for?
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Thu Jul 29, 2010 14:08    Post subject: Reply with quote
For openvpn you should just use the GUI to configure it and let the firmware handle reconnecting on its own. If you're running openvpn 'manually' because you want to store your files somewhere other than nvram then just continue to store most of them where you want and just set your config file in the GUI with paths to your cert/key/etc.

Also, if it seem that you're having a disconnect every 10 mins, you probably are. Check your WAN status page to see the connection uptime. If your WAN is using DHCP then you might have this problem:

http://svn.dd-wrt.com:8000/dd-wrt/ticket/973

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
jdonkey123
DD-WRT Novice


Joined: 27 Jul 2010
Posts: 9

PostPosted: Fri Jul 30, 2010 4:29    Post subject: Reply with quote
That was definitely the original plan, but the rabbit hole went deeper... The server is a Watchguard firewall. It runs it's own flavor of OpenVPN and I'm limited in my configurability.

Their custom client solution is a standard Windows OpenVPN with a simple frontend they've written which makes everything simple and GUI. I got that working so I could then port all the cert's & setup from that to my router.

The client config from their custom OVPN uses 3 features that the DD-WRT GUI doesn't seem to offer;

tls-remote "/O=WatchGuard_Technologies/OU=Fireware/CN=.."
remote-cert-eku "TLS Web Server Authentication"
and auth-user-pass are entered into the frontend as well.

I've learned a bit in the process and since the first two both seem to be optional security for the client and I'm fairly confident I can turn off the auth-user-pass requirement on the server, then I think I could probably use the GUI as is. But I'm accessing a work network that may not be very well-protected, especially once someone is in, which makes me tepid about loosening VPN security settings...

Is there a way to add these custom settings, while still using the GUI, but not have them lost on reboot or overwritten by the GUI?

BTW, I will see if that thread helps me address frequent disconnects.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum