“Airplane Mode” in OS X. Alternative command for `rfkill`?
Make an ad hoc location named isolated or airplane where all the network interfaces are present and turned off.

Switch to this deaf location with:

networksetup -switchtolocation isolated


It might be more interesting than rfkill since you can protect you
from an unnoticed Ethernet cable which might be listening to all your
communications (and they are a lot) :[.
To check that everything is really off, run:

ifconfig -a | grep '[&lt;,]UP[,&gt;]' | grep -v '[&lt;,]LOOPBACK[,&gt;]'


If this command doesn't display anything, then all your interfaces are down, everything is OK.

If this command output anything, as here:

en1: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500


then it means that the interface name (here en1 which is the wireless
one on this Mac)
is on where it shouldn't. This is the sign that either the configuration made is failing or that some Trojan horse turned it on to reach its control server via the Internet.