Results 1 to 3 of 3

Thread: Disable networking for a set period of time?

  1. #1
    Join Date
    Apr 2008
    Location
    Cleveland, OH
    Beans
    133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Disable networking for a set period of time?

    In pursuit of productivity...

    Does anyone know a way to disable all network/internet access for a given amount of time? Preferably reversible (during that period of time) only through something drastic like a reboot.

    Example usage:
    running get_to_work.sh would turn off my network/internet access for two hours. After two hours, the network would start working again. Prior to two hours, the only way to get networking back would be to do a re-boot.

    Yes, the purpose is to prevent myself from surfing the 'net when I should be getting some work done on the local machine...

  2. #2
    Join Date
    Feb 2008
    Location
    US
    Beans
    2,782
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Disable networking for a set period of time?

    you could just do
    Code:
    sudo ifconfig eth0 down
    Then when you have finished your work
    Code:
    sudo ifconfig eth0 up
    You could put this in a script with a cron job or something but I would just do it manually if it was me.
    Desktop: Q6600 OC: 343 x 9, 4 GB RAM, 8600 GTS Twinview (22",17"), 1.5 TB RAID 5
    Laptop: Lenovo T61 T7300 @ 2 GHz, 2GB RAM, Nvidia 140M Quadro, 160 GB harddrive
    Remember to mark posts as [SOLVED] when your problem is resolved

  3. #3
    Join Date
    Apr 2008
    Location
    Cleveland, OH
    Beans
    133
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Disable networking for a set period of time?

    Thanks -

    That'll definitely work. Now I'm thinking of some sort of daemon that can monitor eht0 and pull it down...

    Scheduling via "at" may be a good idea too.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •