Difference between revisions of "Iptables - general"

From MyWiki
Jump to: navigation, search
Line 20: Line 20:
 
This adds a rule at the end of the specified chain - 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<br>
 
<br>
 
<br>
to delete a rule you must know its position in the chain<br>
+
To delete a rule you must know its position in the chain<br>

Revision as of 15:48, 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 position in the chain