1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-01 03:17:57 +01:00

Merge pull request #818 from slash3b/slash3b

iptables: add page
This commit is contained in:
Leandro Ostera 2016-03-07 09:37:42 +01:00
commit 99db37c893

27
pages/linux/iptables.md Normal file
View file

@ -0,0 +1,27 @@
# iptables
> Program that allows to configure tables, chains and rules provided by the Linux kernel firewall.
- See chains and rules for specific table:
`sudo iptables -t {{table_name}} -vnL`
- Set chain policy rule:
`sudo iptables -p {{chain}} {{rule}}`
- Append rule to chain policy for IP:
`sudo iptables -A {{chain}} -s {{ip}} -j {{rule}}`
- Append rule to chain policy for IP considering protocol and port:
`sudo iptables -A {{chain}} -s {{ip}} -p {{protocol}} --dport {{port}} -j {{rule}}`
- Delete chain rule:
`sudo iptables -D {{chain}} {{rule_line_number}}`
- Savin iptables configuration:
`sudo iptables-save > {{path_to_iptables_file}}`