etc
This commit is contained in:
39
iptables.md
Normal file
39
iptables.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Iptables.
|
||||
|
||||
## Allow ssh traffic.
|
||||
~~~
|
||||
iptables -A INPUT -p tcp --dport=22 -j ACCEPT
|
||||
|
||||
# -A Append (End table) | -I Insert (Start table).
|
||||
# -p Protocol.
|
||||
# -j Action.
|
||||
~~~
|
||||
|
||||
## Allow localhost traffic.
|
||||
~~~
|
||||
iptables -A INPUT -i lo -j ACCEPT
|
||||
|
||||
# -i Interface name.
|
||||
~~~
|
||||
|
||||
## Allow ping.
|
||||
~~~
|
||||
iptables -A INPUT -p icmp -j ACCEPT
|
||||
~~~
|
||||
|
||||
## Warning!!!.
|
||||
~~~
|
||||
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
~~~
|
||||
|
||||
## Input policy drop.
|
||||
~~~
|
||||
iptables -P INPUT DROP
|
||||
~~~
|
||||
|
||||
## Save/Restore rules from file.
|
||||
~~~
|
||||
iptables-save > ./filename.rules
|
||||
|
||||
# iptables-restore < ./filename.rules
|
||||
~~~
|
Reference in New Issue
Block a user