Menu
User

DropVPS Team

Writer: Cooper Reagan

How to open TCP port in Kali Linux?

How to open TCP port in Kali Linux?

Publication Date

07/27/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Opening a TCP port on Kali Linux is useful for hosting services, setting up development tools, or testing penetration tools that require incoming connections.

Step 1: Check if the firewall is enabled

Kali Linux does not always have iptables or ufw enabled by default:

sudo iptables -L

If this returns a list of rules, the firewall is active. Otherwise, it’s empty or minimal.

Step 2: Open a TCP port with iptables

To allow incoming TCP traffic on, for example, port 8080:

sudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

You can replace 8080 with the port you want to open.

Step 3: Save your iptables rules

By default, iptables rules are not persistent. To save them:

sudo apt install iptables-persistent
sudo netfilter-persistent save

These commands install and save the firewall rules across reboots.

Step 4: Verify the open port

To check if the port is open and listening:

sudo netstat -tuln | grep 8080

Or, use:

sudo ss -tuln | grep 8080

You should see the port listed if a service is listening on it.

Opening TCP ports in Kali Linux can be done via iptables or ufw. Always make sure to only open necessary ports for security reasons.

Linux VPS
U
Loading...

Related Posts

How to open TCP port in Kali Linux?