By Pavel Shchegolevatykh / January 29, 2013

Connecting to the Internet on startup via PPPoE

Today my non-technical neighbor asked me to reconfigure her Internet connection. She used PPPoE because her ISP Rostelecom had told her that switching to PPPoE would solve all her connection problems. Now she has to re-connect to the Internet all the time, enter passwords, open connections, etc. This gets pretty much confusing. She was wondering if it could just work. Work like it used to.

When she starts surfing the Web for the first time she sees connection dialog window that requires to provide credentials every time. She did not want that kind of noise.

I thought the best practice here would be to buy a router and configure it properly to connect via PPPoE and share WiFi to all devices at home. Turned out she didn't want to buy a router and I could not convince her. She would prefer to deal with that annoying connection dialog. So I had to automate it somehow to make her life a bit easier.

The first thing that came to my mind was to just move the connection shortcut to Startup folder in Windows Start Menu. Then configure the dialog so that it would not ask username and password each time. I did that, but after restart it didn't work as I expected. The next thing I tried is to create a batch file with necessary configuration in it and move it to the Startup folder. That actually worked fine.

Here is how I did it:

1. Get PPPoE connection name from Network Connections in Control Panel. You can quickly go there by typing ncpa.cpl in Run window (Windows + R hotkey).
2. Create a text file using notepad and enter the following line start rasdial your_connection_name your_connection_username your_connection_password.
3. Save it as your_isp_name.bat or any other name you like. I saved it into a new sub-folder in Program Files folder because, I believed, it would be more difficult for her to delete the file accidentally.
4. Create a windows shortcut to your batch file and move it to the Startup folder in Start Menu.

That's pretty easy to implement, but it had many drawbacks. For example there is no easy way to reconnect automatically if something goes wrong without restarting your PC or doing this the "old way". I could have implemented a watchdog timer to check the connection but didn't have much time to do that. I'll wait for a her feedback and maybe improve it in the future. Another kind of issue was a "scary" command prompt popup at startup. Sometimes the user can see it which is a bit unfriendly.

If you have any other ideas on that feel free to shere them in comments.