April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

RESTRICTING NETWORK ACCESS WITH IPTABLES

The first thing is to install the iptables-services.x86_64 package.

[root@slave ~]# yum -y install iptables-services.x86_64
In this example, we will be blocking traffic from the 10.10.0.0/8 network.

[root@slave ~]# iptables -A INPUT -s 10.10.0.0/8 -j REJECT
[root@slave ~]# service iptables restart
Redirecting to /bin/systemctl restart iptables.service
Verify that the network is being blocked by issuing the following command:

[root@slave ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
REJECT all — 10.0.0.0/8 anywhere reject-with icmp-port-unreachable

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>