iptables: update page; ip6tables, ip{6,}tables-{restore,save}: add page (#10715)

* iptables: update page

* iptables-{restore,save}: add page

* ip6tables, ip6tables-{restore,save}: add alias page

* iptables-save: remove trailing whitespace
This commit is contained in:
Lena
2023-09-18 05:57:51 +02:00
committed by GitHub
parent 542435035a
commit 7de6d9b69f
6 changed files with 51 additions and 11 deletions

View File

@@ -1,7 +1,8 @@
# iptables
> Program that allows configuration of tables, chains and rules provided by the Linux kernel firewall.
> More information: <https://www.netfilter.org/projects/iptables/>.
> Configure tables, chains and rules of the Linux kernel IPv4 firewall.
> Use `ip6tables` to set rules for IPv6 traffic. See also: `iptables-save`, `iptables-restore`.
> More information: <https://manned.org/iptables>.
- View chains, rules, packet/byte counters and line numbers for the filter table:
@@ -17,7 +18,7 @@
- [A]ppend rule to chain policy for IP considering [p]rotocol and port:
`sudo iptables --append {{chain}} --source {{ip}} --protocol {{protocol}} --dport {{port}} --jump {{rule}}`
`sudo iptables --append {{chain}} --source {{ip}} --protocol {{tcp|udp|icmp|...}} --dport {{port}} --jump {{rule}}`
- Add a NAT rule to translate all traffic from the `192.168.0.0/24` subnet to the host's public IP:
@@ -26,11 +27,3 @@
- [D]elete chain rule:
`sudo iptables --delete {{chain}} {{rule_line_number}}`
- Save `iptables` configuration of a given [t]able to a file:
`sudo iptables-save --table {{tablename}} > {{path/to/iptables_file}}`
- Restore `iptables` configuration from a file:
`sudo iptables-restore < {{path/to/iptables_file}}`