Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
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'
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.