title: How to open port on Debian
body: <p>I try to open port 5431 so typed:</p>
  
  <pre><code>sudo iptables -A INPUT -p tcp --dport 5431 --jump ACCEPT
  iptables-save
  </code></pre>
  
  <p>when I print the rules in a chain <code>iptables -S</code> then the output is:</p>
  
  <pre><code>-P INPUT ACCEPT
  -P FORWARD ACCEPT
  -P OUTPUT ACCEPT
  -A INPUT -p tcp -m tcp --dport 5431 -j ACCEPT
  </code></pre>
  
  <p>so I tried to check open port by nmap from my machine:</p>
  
  <pre><code>mwalko@mwalko-X58A-UD3R:~$ nmap 10.1.2.30
  
  Starting Nmap 7.01 ( https://nmap.org ) at 2018-04-20 16:46 CEST
  Nmap scan report for static-30.vlan2.vlex.local (10.1.2.30)
  Host is up (0.00027s latency).
  Not shown: 997 closed ports
  PORT     STATE SERVICE
  22/tcp   open  ssh
  111/tcp  open  rpcbind
  5432/tcp open  postgresql
  
  Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
  </code></pre>
  
  <p>and as can be seen above 5431 is still not open. How to open this port?</p>
  
  <p>@Edit</p>
  
  <pre><code>root@dell1950:/sbin# netstat -ntulp
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      923/sshd            
  tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      927/postgres        
  tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      861/rpcbind         
  tcp6       0      0 :::22                   :::*                    LISTEN      923/sshd            
  tcp6       0      0 :::5432                 :::*                    LISTEN      927/postgres        
  tcp6       0      0 :::111                  :::*                    LISTEN      861/rpcbind         
  udp        0      0 0.0.0.0:111             0.0.0.0:*                           861/rpcbind         
  udp        0      0 0.0.0.0:613             0.0.0.0:*                           861/rpcbind         
  udp6       0      0 :::111                  :::*                                861/rpcbind         
  udp6       0      0 :::613                  :::*                                861/rpcbind
  </code></pre>