Linux-Noob Forums
how to open a port - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Server Administration (https://www.linux-noob.com/forums/forum-8.html)
+--- Forum: Security and Firewalls (https://www.linux-noob.com/forums/forum-87.html)
+--- Thread: how to open a port (/thread-3636.html)



how to open a port - anyweb - 2004-02-10


via lokkit, in the 'Other Ports' field, type:

 

https:tcp

 

then apply the changes. or if you want to do this in the console,

 

type:-

 



Code:
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT




 

iptables -L will list your current rules

 

the above example opens port 443

 

cheers

 

anyweb




how to open a port - raky - 2007-08-28


does this mean port 67 is open?

output from iptables -L:

 

ACCEPT udp -- anywhere anywhere udp spt:bootps state ESTABLISHED




how to open a port - xDamox - 2007-08-28


Quote:iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
 



Code:
iptables -A INPUT




This sets the IP rule to be appended into the INPUT table

 



Code:
-i eth0




This rule applys on the eth0 interface

 



Code:
-p tcp --sport 443




This sets the protocol to TCP and the source port is 443

 



Code:
-m state --state ESTABLISHED -j ACCEPT




This sets a match on the state of established that means if the connection has been established it will be accepted.

 

However this rule will deny any new connections as the rule needs the state of NEW

 



Code:
iptables -A INPUT -i eth0 -p tcp --sport 443 -m state --state NEW,ESTABLISHED -j ACCEPT







how to open a port - znx - 2007-08-28


Quote:ACCEPT udp -- anywhere anywhere udp spt:bootps state ESTABLISHED
 

This says, accept UDP, from any host, to any host FROM the source port (spt) of bootps with the an established state.

 

So, no your port isn't "open". Instead, only when your system has a connection already active, will it accept access from port 67 on the remote host.