What's new
  • 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!

Script to reconnect WLAN if dropped

karendar

New Around Here
Hi guys,

I'm running a PPPoE setup with Bell Fibe here on an AC68U with the latest merlin build. Due to my retarded ISP, to keep all settings for IPTV as well as run a standalone wireless network with my own router, I have to connect through PPPoE on both the supplied Bell router (Which acts as a TV hub only) and PPPoE on the AC68U.

The issue I have is that the ISP has a daily running job to see double userID connections on the PPPoE, forcing a disconnection on any sessions not bound to their crappy router. This forces me to manually reconnect if my Asus connection is killed. I've added a cron job to restart the WAN service at 5 AM, but this is insufficient, as the Bell double login job is run randomly and can happen at any time during the day.

Is there anyone who can help make a monitoring script that detects when the WAN link is down and recycle the WAN port? I could run this script every 15 seconds to determine if WAN is down and hit it with a "service restart_wan" if it is.

Thanks in advance for any help you may supply!
 
Got it.

If anyone wants a working solution:

Create a script in /jffs/scripts/ (I named mine checkwan)

Enter this in your script:

if [ $(ifconfig ppp0 | awk -F':' '/inet addr/&&!/127.0.0.1/{split($2,_," ");print _[1]}') ]
then
logger "WAN service healthy"
else
service restart_wan
logger "WAN service restarted by monitoring script"
fi

The "WAN service is healthy" is just a test line that's added to log everytime you run the script. I plan to use the entry to determine how often I lose internet connection due to my vendor and how many times I force a reconnect, that way I'll be able to determine if a pattern exists.

Afterwards, I used the following URL to schedule a cron job to run every minute:

http://www.smallnetbuilder.com/forums/showpost.php?p=68429&postcount=7

And to top it off, I wanted this to run every 20 seconds. So I went one over:

After the script, add:

sleep 20

Then copy the script underneath. Then another:

sleep 20

And recopy script a third time.

Timing is usually perfect, as restarting the WAN service takes all of 15 seconds, giving you a decent enough buffer in between executions.

I haven't been running this solution for long, but it does seem to work if I force the WAN to disconnect manually. Now to wait for my ISP to kill it again...
 
I also have fibetv and internet from them. What I have done is to enter my credential for internet into router only.

Doing this allow me router to manage internet and modem only does tv and modulation.

I have connection hub modem.
 

Attachments

  • username.jpg
    username.jpg
    34.8 KB · Views: 552
I also have fibetv and internet from them. What I have done is to enter my credential for internet into router only.

Doing this allow me router to manage internet and modem only does tv and modulation.

I have connection hub modem.

The issue I have is that I wanted interactive TV functions (Stingray music interface, Meteomedia, etc.) to work as well as have my AC68U work as a standalone network for internet purposes. To get this to work, you have to supply PPPoE internet to both the Bell connection and to the AC68U.

This is where this script comes into play: If you split your only active FTTH LAN port in two with a switch, it'll permit you to have two separate PPPoE auths going at once through the same port, achieving my needs of having both services above. The issue with that is that if you do this, Bell runs daily jobs to boot out the logged in user that isn't associated with a valid Bell Connection hub. Once they do this, you lose your WAN IP and does not auto-reconnect.

The script monitors the ppp0 interface for a valid IP. If a valid IP is returned, it enters a log entry saying that the WAN is healthy. Otherwise, it restarts the WAN service, re-enabling the IP.

The only other solution I had for my setup to work would be to call bell and threaten them to move to Videotron unless they activate a second LAN port on my FTTH box, which apparently they don't do anymore.
 
Oh, That make sense.

Anyways did you talk to technician. In my case they allowed me to use my b1 id on both Connection HUB and Router.

You may have to call multiple times until you get tech who understand your point of view. As I recall I had to do quite few time until someone more knowledgeable look at my case. Basically I told them I need some feature not offered by their Sagecom Connection hub and I want to use my router for it. After that tech made note on my file to allow two connection with my id of b1

Know I can use on both, but I use only one though but have an option if I choose.
 
Last edited:
Oh, That make sense.

Anyways did you talk to technician. In my case they allowed me to use my b1 id on both Connection HUB and Router.

You may have to call multiple times until you get tech who understand your point of view. As I recall I had to do quite few time until someone more knowledgeable look at my case. Basically I told them I need some feature not offered by their Sagecom Connection hub and I want to use my router for it. After that tech made note on my file to allow two connection with my id of b1

Know I can use on both, but I use only one though but have an option if I choose.

I did not, I try and call tech support the least possible. ;) I will eventually try this though if I don't just switch over to Videotron... I'm not very patient with incompetence in callcenters. :)
 

Latest 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!
Back
Top