diff --git a/pages/linux/ip6tables-restore.md b/pages/linux/ip6tables-restore.md new file mode 100644 index 000000000..d2dd06732 --- /dev/null +++ b/pages/linux/ip6tables-restore.md @@ -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` diff --git a/pages/linux/ip6tables-save.md b/pages/linux/ip6tables-save.md new file mode 100644 index 000000000..41d424cfc --- /dev/null +++ b/pages/linux/ip6tables-save.md @@ -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` diff --git a/pages/linux/ip6tables.md b/pages/linux/ip6tables.md new file mode 100644 index 000000000..44d7275e8 --- /dev/null +++ b/pages/linux/ip6tables.md @@ -0,0 +1,7 @@ +# ip6tables + +> This command is an alias of `iptables` for the IPv6 firewall. + +- View documentation for the original command: + +`tldr iptables` diff --git a/pages/linux/iptables-restore.md b/pages/linux/iptables-restore.md new file mode 100644 index 000000000..2aa4a5050 --- /dev/null +++ b/pages/linux/iptables-restore.md @@ -0,0 +1,9 @@ +# iptables-restore + +> Restore the `iptables` IPv4 configuration. +> Use `ip6tables-restore` to do the same for IPv6. +> More information: . + +- Restore the `iptables` configuration from a file: + +`sudo iptables-restore {{path/to/file}}` diff --git a/pages/linux/iptables-save.md b/pages/linux/iptables-save.md new file mode 100644 index 000000000..655aaa688 --- /dev/null +++ b/pages/linux/iptables-save.md @@ -0,0 +1,17 @@ +# iptables-save + +> Save the `iptables` IPv4 configuration. +> Use `ip6tables-save` to to the same for IPv6. +> More information: . + +- 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}}` diff --git a/pages/linux/iptables.md b/pages/linux/iptables.md index b2a48ce45..f30b0dff5 100644 --- a/pages/linux/iptables.md +++ b/pages/linux/iptables.md @@ -1,7 +1,8 @@ # iptables -> Program that allows configuration of tables, chains and rules provided by the Linux kernel firewall. -> More information: . +> 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: . - 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}}`