LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2008, 12:47 PM   #1
jukebox55
Member
 
Registered: Aug 2007
Distribution: slackware 11
Posts: 101

Rep: Reputation: 15
shutdown/startup nic commands


i want to be able to shutdown my nic so that all internet traffic stops (in and out) when im not using the internet.
i searched the LQ forums and found a possible command

Code:
ifup eth0
ifdown eth0
but when i try them, i get :command not found.

is there some reason why this wont work?
 
Old 01-31-2008, 12:53 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by jukebox55 View Post
i want to be able to shutdown my nic so that all internet traffic stops (in and out) when im not using the internet.
i searched the LQ forums and found a possible command

Code:
ifup eth0
ifdown eth0
but when i try them, i get :command not found.

is there some reason why this wont work?
Most distributions don't put the ifup and ifdown commands on the PATH. You usually have to specify the entire path to the command. ifup and ifdown are usually somewhere in /etc so you can use these commands to find them:

find /etc -iname '*ifup*"

find /etc -iname '*ifdown*"

---------------------
Steve Stites
 
Old 01-31-2008, 01:20 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Faster than doing a find would be the which command

which ifup and which ifdown

the issue is that since you are trying to do this as a normal user the command is not in your path. both of those commands reside in the /sbin directory

/sbin/ifup eth0
/sbin/ifdown eth0

but then you run into permissions issues since a normal user will not have rights to shut down the device by default.

you will either need to su - to root to issue the commands, or configure sudo so you can use 'sudo /sbin/ifup eth0'
 
Old 01-31-2008, 01:32 PM   #4
jukebox55
Member
 
Registered: Aug 2007
Distribution: slackware 11
Posts: 101

Original Poster
Rep: Reputation: 15
ifup/ifdown must not be included with slackware 11 because ive used the 'find' and 'which' methods, and i cant find them.

i had a look in /sbin and theyre not in there.
 
Old 01-31-2008, 02:04 PM   #5
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Slackware just uses the standard "ifconfig [interface] up|down"

for example, my wireless card gets enabled with "ifconfig wlan0 up" and disabled with "ifconfig wlan0 down"
 
Old 01-31-2008, 04:08 PM   #6
jukebox55
Member
 
Registered: Aug 2007
Distribution: slackware 11
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Poetics View Post
Slackware just uses the standard "ifconfig [interface] up|down"
oh i see. unfotunately, although 'ifconfig eth0 down' will shut the nic down, 'ifconfig eth0 up' will not bring it back up, i have to reboot for that.
 
Old 11-14-2008, 10:57 AM   #7
geesh
Member
 
Registered: Feb 2004
Posts: 53

Rep: Reputation: 16
If you use a firewall front end like firestarter you can simply lock all traffic out both in and outbound by locking the firestarter. Very very quick and easy. No restarting except to unlock firestarter.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
whats the diffrence between shutdown and halt commands??? Fond_of_Opensource Linux - Newbie 1 12-20-2006 05:35 AM
giving user access to 'shutdown -r now' or -h commands Lleb_KCir Linux - General 2 03-16-2005 11:50 AM
How do I add start and stop commands to systems startup and shutdown processes? mlsbraves Slackware 1 11-25-2004 07:04 AM
Run some commands on system shutdown luizrolla Linux - Newbie 1 07-12-2004 07:42 PM
Run commands at logout/shutdown sbaguz Linux - General 2 08-21-2003 11:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration