How To Install iptables on Fedora 34

iptables is Tools for managing Linux kernel packet filtering capabilities Tools for managing Linux kernel packet filtering capabilities

Introduction

In this tutorial we learn how to install iptables on Fedora 34.

What is iptables

The iptables utility controls the network packet filtering code in the Linux kernel. If you need to set up firewalls and/or IP masquerading, you should install this package. iptables 1.8.7 3.fc34 x86_64 109 k iptables-1.8.7-3.fc34.src.rpm fedora Tools for managing Linux kernel packet filtering capabilities http GPLv2 and Artistic Licence 2.0 and ISC The iptables utility controls the network packet filtering code in the Linux kernel. If you need to set up firewalls and/or IP masquerading, you should install this package.

We can use yum or dnf to install iptables on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install iptables.

Install iptables on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install iptables using dnf by running the following command:

sudo dnf -y install iptables

Install iptables on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install iptables using yum by running the following command:

sudo yum -y install iptables

How To Uninstall iptables on Fedora 34

To uninstall only the iptables package we can use the following command:

sudo dnf remove iptables

iptables Package Contents on Fedora 34

/usr/bin/iptables-xml
/usr/lib/.build-id
/usr/lib/.build-id/87
/usr/lib/.build-id/87/cd80ec0bb1e30691670932da328e3477f39e64
/usr/sbin/ip6tables
/usr/sbin/ip6tables-apply
/usr/sbin/ip6tables-legacy
/usr/sbin/ip6tables-legacy-restore
/usr/sbin/ip6tables-legacy-save
/usr/sbin/ip6tables-restore
/usr/sbin/ip6tables-save
/usr/sbin/iptables
/usr/sbin/iptables-apply
/usr/sbin/iptables-legacy
/usr/sbin/iptables-legacy-restore
/usr/sbin/iptables-legacy-save
/usr/sbin/iptables-restore
/usr/sbin/iptables-save
/usr/sbin/xtables-legacy-multi
/usr/share/doc/iptables
/usr/share/doc/iptables/INCOMPATIBILITIES
/usr/share/licenses/iptables
/usr/share/licenses/iptables/COPYING
/usr/share/man/man1/iptables-xml.1.gz
/usr/share/man/man8/ip6tables-apply.8.gz
/usr/share/man/man8/ip6tables-restore-translate.8.gz
/usr/share/man/man8/ip6tables-restore.8.gz
/usr/share/man/man8/ip6tables-save.8.gz
/usr/share/man/man8/ip6tables-translate.8.gz
/usr/share/man/man8/ip6tables.8.gz
/usr/share/man/man8/iptables-apply.8.gz
/usr/share/man/man8/iptables-extensions.8.gz
/usr/share/man/man8/iptables-restore-translate.8.gz
/usr/share/man/man8/iptables-restore.8.gz
/usr/share/man/man8/iptables-save.8.gz
/usr/share/man/man8/iptables-translate.8.gz
/usr/share/man/man8/iptables.8.gz
/usr/share/man/man8/xtables-legacy.8.gz
/usr/bin/iptables-xml
/usr/lib/.build-id
/usr/lib/.build-id/c8
/usr/lib/.build-id/c8/d964c43a84532aa7ee05da3b824e3fc6cabc13
/usr/sbin/ip6tables
/usr/sbin/ip6tables-apply
/usr/sbin/ip6tables-legacy
/usr/sbin/ip6tables-legacy-restore
/usr/sbin/ip6tables-legacy-save
/usr/sbin/ip6tables-restore
/usr/sbin/ip6tables-save
/usr/sbin/iptables
/usr/sbin/iptables-apply
/usr/sbin/iptables-legacy
/usr/sbin/iptables-legacy-restore
/usr/sbin/iptables-legacy-save
/usr/sbin/iptables-restore
/usr/sbin/iptables-save
/usr/sbin/xtables-legacy-multi
/usr/share/doc/iptables
/usr/share/doc/iptables/INCOMPATIBILITIES
/usr/share/licenses/iptables
/usr/share/licenses/iptables/COPYING
/usr/share/man/man1/iptables-xml.1.gz
/usr/share/man/man8/ip6tables-apply.8.gz
/usr/share/man/man8/ip6tables-restore-translate.8.gz
/usr/share/man/man8/ip6tables-restore.8.gz
/usr/share/man/man8/ip6tables-save.8.gz
/usr/share/man/man8/ip6tables-translate.8.gz
/usr/share/man/man8/ip6tables.8.gz
/usr/share/man/man8/iptables-apply.8.gz
/usr/share/man/man8/iptables-extensions.8.gz
/usr/share/man/man8/iptables-restore-translate.8.gz
/usr/share/man/man8/iptables-restore.8.gz
/usr/share/man/man8/iptables-save.8.gz
/usr/share/man/man8/iptables-translate.8.gz
/usr/share/man/man8/iptables.8.gz
/usr/share/man/man8/xtables-legacy.8.gz

References

Summary

In this tutorial we learn how to install iptables on Fedora 34 using yum and dnf.