Question

I have a https jenkins server running on https on port 1444. I set the iptable rules but it does not work as expected.

Posted January 25, 2021 122 views
UbuntuCentOSFirewall

I set the following iptable rules:

  1. iptables -A INPUT -p tcp –dport 22 -m conntrack –ctstate NEW,ESTABLISHED -j ACCEPT # Since I want to allow ssh from anywhere into the host that hosts the jenkins server
  2. iptables -A INPUT -p tcp –dport 1444 -m conntrack –ctstate NEW,ESTABLISHED -j ACCEPT #Since the jenkins server runs on port 1444. Note: The server is https
  3. iptables -A INPUT -j DROP #I want all other traffic other than ssh and https to be dropped

Is there something wrong I am doing while setting the rules? Please help

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @ksd17,

The rules look okay however I do have a question, how are you trying to access the application? Are you using a port or just typing in the domain name IE.

https://domain.com

or

https://domain.com:1444

The second command should work, while the first one shouldn’t unless you’ve configured some kind of a reverse proxy, maybe with Nginx.

Regards,
KFSys.

Submit an Answer