Filter for SSH Traffic (Example)

Precaution Command Before DROP Policy (LAB)

Do this before you change the policy in a LAB ENVIRONMENT to ensure that you do not lock yourself out of the box:

Before changing the policy to DROP

run the following command:

sudo shutdown -r 5

This will tell the system to reboot -r in 5 minutes

Change your policy to DROP

iptables -t filter -P INPUT DROP
iptables -t filter -P OUTPUT DROP
iptables -t filter -P FORWARD DROP

If changing the policy to DROP locked you out of your system then the system will reboot within 5 minutes which will clear out your rules.

If you did not get locked out, then run the following command to cancel the reboot:

sudo shutdown -c

Examples

Without using Multiport

Host A:

Host B:

Using Multiport

Host A:

Host B:

NAT, PAT, and Port Forward (Examples)

Enable IP Forwarding:

1-to-1 NAT (for the servers if you have extra IP's)

PAT (for the clients)

Port Forward (for the servers if you don't have extra IP's)

Last updated

Was this helpful?