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



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

2 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