Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure xtables-addons to deny IP access under CentOS system

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to configure xtables-addons under the CentOS system to deny IP access". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to configure xtables-addons under the CentOS system to deny IP access".

Sometimes, the IP of some countries has been trying to login or attacking the server, and so on, so you need to analyze the suspicious IP first, and then use iptables to block it. The delay takes time and effort. You can now use xtables-addons to block the source IP.

1. prerequisite

Iptables > = 1.4.5

Kernel-devel > = 3.7

two。 Install dependency packages

The code is as follows:

# yum install gcc gcc-c++ make automake unzip zip xz kernel-devel- `uname-r` iptables-devel perl-Text-CSV_XS

3. Install xtables-addons

The code is as follows:

# wget http://sourceforge.net/projects/xtables-addons/files/Xtables-addons/2.3/xtables-addons-2.3.tar.xz/download

# wget http://sourceforge.net/projects/xtables-addons/files/Xtables-addons/2.3/xtables-addons-2.3.tar.xz/download

# xz-d xtables-addons-2.3.tar.xz

# tar xvf xtables-addons-2.3.tar

# cd xtables-addons-2.3

#. / configure

# make

# make install

4. Geoip related suite

The code is as follows:

# cd geoip

#. / xt_geoip_dl

#. / xt_geoip_build GeoIPCountryWhois.csv

# mkdir-p / usr/share/xt_geoip/

# cp-rp {BE,LE} / usr/share/xt_geoip/

5. Write iptables rules. If you reject the IP in Taiwan

The code is as follows:

# iptables-I INPUT-m geoip-- src-cc TW-j DROP

Thank you for your reading. the above is the content of "how to configure xtables-addons under CentOS system to deny IP access". After the study of this article, I believe you have a deeper understanding of how to configure xtables-addons under CentOS system to deny IP access, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report