IPtables Installation And Configuration Kodekloud

 


Solution:

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

Login to appserver

ssh tony@stapp01

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


Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

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