Open Port For Outgoing Connections In IPTables

< Back to the Title Topic

Open Port For Outgoing Connections In IPTables

Step 1 – Access your server via SSH.

Step 2 – Run the following command to open port. This will open port 8000 for an incoming connection.

  

     /sbin/iptables -I OUTPUT -p tcp –sport $uports –dport 8000 -j ACCEPT

     /sbin/iptables -I INPUT -p tcp –sport 8000 –dport $uports -j ACCEPT


Step 3 – edit /etc/rc.local and append the two tables commands at the end of the file, so that the new rules will be applied even after a server reboot.

Previous How to use Ping on a macOS
Next How to Scan for Malware in Linux using AI-BOLIT