How To Install ipset on CentOS 7

In this tutorial we learn how to install ipset on CentOS 7. ipset is Manage Linux IP sets

Introduction

In this tutorial we learn how to install ipset on CentOS 7.

What is ipset

IP sets are a framework inside the Linux kernel since version 2.4.x, which can be administered by the ipset utility. Depending on the type, currently an IP set may store IP addresses, (TCP/UDP) port numbers or IP addresses with MAC addresses in a way, which ensures lightning speed when matching an entry against a set. If you want to - store multiple IP addresses or port numbers and match against the collection by iptables at one swoop; - dynamically update iptables rules against IP addresses or ports without performance penalty; - express complex IP address and ports based rulesets with one single iptables rule and benefit from the speed of IP sets then ipset may be the proper tool for you.

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

Install ipset on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install ipset

Install ipset on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install ipset

How To Uninstall ipset on CentOS 7

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

sudo dnf remove ipset

References

Summary

In this tutorial we learn how to install ipset on CentOS 7 using yum and dnf.