Application Security KodeKloud

 


Question: Allow all incoming traffic to Nginx 8096 port and Block to Apache 5004 port

Solution:

Login to backup server and add these two rules

sudo iptables -A INPUT -p tcp --dport 8096 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT

sudo iptables -A INPUT -p tcp --dport 5004 -m conntrack --ctstate NEW -j REJECT

Then save it by typing following command

sudo iptables-save > /etc/sysconfig/iptables

Now, check if the rules are added or not

cat /etc/sysconfig/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

9 comments:

  1. when I went to save the IP tables "sudo iptables-save > /etc/sysconfig/iptables" it said I did not have permissions, went in with VI and manually added. success.

    ReplyDelete
  2. Indeed, even numerous entrepreneurs have likewise begun utilizing security camera because of simple establishment. tampa security cameras

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. It's ideal to appropriately utilize something a lot easier that they know about like a secondary school understudy proposed. Security Cameras

    ReplyDelete
  5. Great post, you have pointed out some fantastic points , I likewise think this s a very wonderful website. https://www.deathbycaptcha.com/2captcha

    ReplyDelete
  6. Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck. 2captcha api

    ReplyDelete
  7. Such sites are important because they provide a large dose of useful information ... Sincerly René

    ReplyDelete
  8. I have read your excellent post. This is a great job. I have enjoyed reading your post first time. keep posting. private nursing

    ReplyDelete