Difference between revisions of "Iptables - general"
From MyWiki
Line 18: | Line 18: | ||
</source> | </source> | ||
Good ref - https://fedoraproject.org/wiki/How_to_edit_iptables_rules#Appending_Rules<br> | Good ref - https://fedoraproject.org/wiki/How_to_edit_iptables_rules#Appending_Rules<br> | ||
− | This adds a rule at the end of the specified chain - 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<br> |
+ | <br> | ||
+ | to delete a rule you must know its line number<br> |
Revision as of 15:47, 18 July 2016
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 line number