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

Recent Comments