Iptables - general

From MyWiki
Revision as of 15:48, 18 July 2016 by George2 (Talk | contribs)

Jump to: navigation, search

Allow incoming ports :
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

Incoming ports for samba :

netbios-ns – 137/tcp # NETBIOS Name Service
netbios-dgm – 138/tcp # NETBIOS Datagram Service
netbios-ssn – 139/tcp # NETBIOS session service
microsoft-ds – 445/tcp # if you are using Active Directory
 
iptables -A INPUT -p tcp -m tcp --dport 137 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 138 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 139 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 445 -j ACCEPT

Good ref - https://fedoraproject.org/wiki/How_to_edit_iptables_rules#Appending_Rules
This adds a rule at the end of the specified chain - https://fedoraproject.org/wiki/How_to_edit_iptables_rules#Appending_Rules

To delete a rule you must know its position in the chain