4

I have Ubuntu 14.04 LTS installed on my laptop, I am using 3G USB modem to connect to the internet (sometimes I do not have direct access to this laptop, but I need it to stay online). But every day or two it keeps disconnecting from this network. I was wondering, is there any way to set the system to connect automatically at specific time?

1 Answers1

1

You can use nmcli and cron to bringing up connection at specific time.

First you create connection using Network-Manager.

Then start terminal to test some things

  • list all NM connections: nmcli con

  • start connection: nmcli con up id ConnectionName

  • down connection: nmcli con down id ConnectionName

If work, setup cron to trigger connection

sudo crontab -e

at the end add

45 10 * * * nmcli con up id bdc

this will trigger command every day at 10 h and 45 min. In cron you can specify min, hour, day, month ... Also you can start connectio every min

* * * * * nmcli con up id bdc

More example how to setup time in cron can find here

2707974
  • 10,758