~2026

Blocking network access for a program from CLI

I had to use a commercial program once more. Usually I'm not very impressed by the quality of the software. This time I had to use Cisco's Packets Tracer. I actually quite like this simulation software. However one need to login to use. Here's a simple trick to refuse network access for a program.

Cisco splash

Cisco PacketTracer's Debian package for Ubuntu.

Cisco provides Packet Tracer as Debian Package for Ubuntu. A debian package is just an .ar file. So one can extract the files using ar x the.deb.

Inside there's a data.tar.xf which is extracted using tar -xf data.tar.xs.

If you examine the extracted files you'll notice that the .deb just installs the program to /opt. We can just cd into the opt/pt/bin directory where we find the PacketTracer binary. If we then try to run the binary we will get errors:

$ ./PacketTracer 
./PacketTracer: error while loading shared libraries: libQt5NetworkAuth.so.5: cannot open shared object file: No such file or directory

If you look in the same directory you'll see the library is just there. Let's just force the program to search for libraries in the same dir.

LD_LIBRARY_PATH="." ./PacketTracer 

Hey, now it's working. However we need to log in. I can't really be bothered with logging in nor is it working when I tried. What if we would start PacketTracer without any network? We can use unshare to give a process an empty network name space.

We can start PacketTracer like this:

LD_LIBRARY_PATH="." unshare -n -r ./PacketTracer

Voila, PacketTracer running without the need to login.