1

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?

2 Answers 2

2

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'
1
  • unshare from util-linux does the same thing. Oct 14, 2012 at 16:26
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .