Hi
I have tried to follow this guide here (How To Set Up a Firewall Using IPTables on Ubuntu 14.04) and have done everything this tutorial said. But still when I scan my server with nmap <myserverip> i still only get port 22 and port 80 as open. I need to open port 50010 for a service I am trying to create, but I see no way for me to open this port.
sudo iptables -L:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere
ACCEPT all – anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:ssh
ACCEPT tcp – anywhere anywhere tcp dpt:http
ACCEPT tcp – anywhere anywhere tcp dpt:50010
Chain FORWARD (policy ACCEPT) target prot opt source destination
Chain OUTPUT (policy ACCEPT) target prot opt source destination
Answers will be greately appreciated!
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!
So for those of you still having a problem, the answer is simple. Apache needs a rule to allow traffic through the port. First find your port lsof -i :5000 (5000 is the port in question).
This will give you
app 2850 root 3u IPv4 22462 0t0 TCP *:5000 (LISTEN)```
As you can see we are listening to 5000 with TCP connection. Now just add the rule to apache:
```sudo ufw allow 5000/tcp```. This will tell the firewall (ufw) to let traffic through. Now you should be okay to use the ```http://<yourport>:5000/path/to/service```. Good Luck.
Hello, all
You can use UFW in order to do that.
UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall. While iptables is a solid and flexible tool, it can be difficult for beginners to learn how to use it to properly configure a firewall. If you’re looking to get started securing your network and are not sure which tool to use, UFW may be the right choice for you.
Ff your service is listening on port 50010, you can use this command to allow connections on that port:
sudo ufw allow 50010
You can check the tutorial for Ubunut 18.04 here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04
Hope that this helps! Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.