Skip to content

port_forwarding

Thomas Holterbach edited this page Apr 8, 2022 · 5 revisions

Port forwarding

To configure their devices, students first access a proxy container. There is one proxy container for every AS, and from a proxy container students can only access the devices that are within their AS.

The access to the proxy container (from the real Internet) is made possible by installing SSH tunnels that forward SSH connections to the corresponding proxy container based on the port number used.

The script utils/ssh/port_fowarding.sh configure all those tunnels automatically based on the configuration files. It also opens the corresponding ports using ufw.

In a nutshell, just run the following command to enable SSH access:

sudo ./utils/ssh/port_forwarding.sh

In case you want to delete the SSH forwarding rules that were created, you can use the following command:

for pid in $(ps aux | grep ssh | grep StrictHostKeyChecking | tr -s ' ' | cut -f 2 -d ' '); do sudo kill -9 $pid; done

⚠️ This command might also delete SSH tunnels that are unrelated to mini-Internet.