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
pull/23/head
Lena 2023-09-18 05:57:51 +02:00 committed by GitHub
parent 542435035a
commit 7de6d9b69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 11 deletions

View File

@ -0,0 +1,7 @@
# ip6tables-restore
> This command is an alias of `iptables-restore` for the IPv6 firewall.
- View documentation for the original command:
`tldr iptables-restore`

View File

@ -0,0 +1,7 @@
# ip6tables-save
> This command is an alias of `iptables-save` for the IPv6 firewall.
- View documentation for the original command:
`tldr iptables-save`

7
pages/linux/ip6tables.md Normal file
View File

@ -0,0 +1,7 @@
# ip6tables
> This command is an alias of `iptables` for the IPv6 firewall.
- View documentation for the original command:
`tldr iptables`

View File

@ -0,0 +1,9 @@
# iptables-restore
> Restore the `iptables` IPv4 configuration.
> Use `ip6tables-restore` to do the same for IPv6.
> More information: <https://manned.org/iptables-restore>.
- Restore the `iptables` configuration from a file:
`sudo iptables-restore {{path/to/file}}`

View File

@ -0,0 +1,17 @@
# iptables-save
> Save the `iptables` IPv4 configuration.
> Use `ip6tables-save` to to the same for IPv6.
> More information: <https://manned.org/iptables-save>.
- Print the `iptables` configuration:
`sudo iptables-save`
- Print the `iptables` configuration of a specific [t]able:
`sudo iptables-save --table {{table}}`
- Save the `iptables` configuration to a [f]ile:
`sudo iptables-save --file {{path/to/file}}`

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}}`