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.

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


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.