mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 01:02:09 +02:00
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:
parent
542435035a
commit
7de6d9b69f
6 changed files with 51 additions and 11 deletions
7
pages/linux/ip6tables-restore.md
Normal file
7
pages/linux/ip6tables-restore.md
Normal 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`
|
7
pages/linux/ip6tables-save.md
Normal file
7
pages/linux/ip6tables-save.md
Normal 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
7
pages/linux/ip6tables.md
Normal 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`
|
9
pages/linux/iptables-restore.md
Normal file
9
pages/linux/iptables-restore.md
Normal 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}}`
|
17
pages/linux/iptables-save.md
Normal file
17
pages/linux/iptables-save.md
Normal 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}}`
|
|
@ -1,7 +1,8 @@
|
||||||
# iptables
|
# iptables
|
||||||
|
|
||||||
> Program that allows configuration of tables, chains and rules provided by the Linux kernel firewall.
|
> Configure tables, chains and rules of the Linux kernel IPv4 firewall.
|
||||||
> More information: <https://www.netfilter.org/projects/iptables/>.
|
> 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:
|
- 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:
|
- [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:
|
- 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:
|
- [D]elete chain rule:
|
||||||
|
|
||||||
`sudo iptables --delete {{chain}} {{rule_line_number}}`
|
`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}}`
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue