Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Similar to how I can run time command, I'd like to run a command such as dont_allow_network_access command. Is this possible?

share|improve this question

2 Answers 2

This will get you a list of your network devices:

ifconfig -a

If your device you want to diable is eth0

ifconfig eth0 down

and to turn it back on:

ifconfig eth0 up
share|improve this answer

You can achieve this with lxc. This package contains a tool named lxc-unshare which you can use as follows:

# lxc-unshare -s NETWORK -- su username -c 'ping 127.0.0.1'
share|improve this answer
    
unshare from util-linux does the same thing. –  grawity Oct 14 '12 at 16:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.