How To Install Iptables-Services On Centos 7?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Install iptables-services package
“`
sudo yum install iptables-services
“`
2. Enable and start the service
“`
sudo systemctl enable iptables
sudo systemctl start iptables
“`
3. Configure iptables rules
“`
sudo iptables -A INPUT -m conntrack –ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp –dport 22 -j ACCEPT
sudo iptables -A INPUT -j DROP
sudo iptables -A FORWARD -j DROP
“`
4. Save the iptables rules
“`
sudo iptables-save > /etc/sysconfig/iptables
“`
5. Check the iptables rules
“`
sudo iptables-save -c
“`