IPtables Installation And Configuration Kodekloud

 


Solution:

You have to do this in all app servers (app01, app02, app03)

Login to appserver

ssh [email protected]

Install Services

sudo yum install -y iptables-services

sudo yum install iptables

Accept traffic from only LBR Host for mentioned PORT in the question

sudo iptables -A INPUT -p tcp --dport 8081 -s 172.16.238.14 -j ACCEPT

Block traffic from other sources

sudo iptables -A INPUT -p tcp --dport 8081 -j DROP

Apply the changes permanently

sudo service iptables save

sudo systemctl restart iptables


Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment