I am using Debian 12 and I am trying to open port 7890. I added the rules to iptables using the following command.
The rules are shown when iptables is listed.
However, when I check the status of port 7890, it is show as closed.
What am I doing wrong?
Code:
$ sudo iptables -A INPUT -p tcp --dport 7890 -j ACCEPT$ sudo iptables-save# Generated by iptables-save v1.8.9 (nf_tables) on Tue Jul 23 18:15:42 2024*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -p tcp -m tcp --dport 7890 -j ACCEPTCOMMIT# Completed on Tue Jul 23 18:15:42 2024
Code:
$ sudo iptables -LChain INPUT (policy ACCEPT)target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:7890Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destination
Code:
$ nmap localhost -p 7890Starting Nmap 7.93 ( https://nmap.org ) at 2024-07-23 18:16 UTCNmap scan report for localhost (127.0.0.1)Host is up (0.000096s latency).Other addresses for localhost (not scanned): ::1PORT STATE SERVICE7890/tcp closed unknownNmap done: 1 IP address (1 host up) scanned in 0.05 seconds
Statistics: Posted by debber — 2024-07-24 20:24 — Replies 4 — Views 97