I have installed ejabberd on a new installation of Ubuntu 16.04 on digitalocean cloud and am able to connect to it from pidgin from my local machine without configuring any firewall rules.

Curious to see the ports open I did

nmap <ip_address>

PORT     STATE SERVICE
22/tcp   open  ssh
5222/tcp open  xmpp-client
5269/tcp open  xmpp-server
5280/tcp open  xmpp-bosh

However, my ufw status is inactive and

 sudo iptables -S

-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT

is empty

As suggested here I listed each of the tables contents using

sudo iptables -vL -t <table_name>

for each of filter, nat, mangle, raw, security all showing empty outputs.

I would like to know if there is some other way in which firewall rules are configured and displayed.

  • Your firewall is inactive thus open ports are accessible. – dsstorefile1 May 20 at 8:25
  • @dsstorefile1 Can ports be opened independent of any firewall like ufw or iptables? All results in google show either using some firewall like ufw or iptables to open ports in ubuntu – Kalyan Raghu May 20 at 11:34
  • A service can listen on any port, but a port is only open if the active firewall allows others to connect to it as well. – dsstorefile1 May 20 at 11:39
up vote 1 down vote accepted

Your misunderstanding is this: If there is no configuration for Netfilter (iptables) then everything is allowed. The default policy for all chains is ACCEPT.

Is your firewall enabled?

Chances are that you have your rules set, but just haven't turned your firewall on.

  • ufw is not enabled. However, ports are open and I can connect to ejabberd from xmpp clients from another computer. I would like to know why iptables -S output is empty when rules are set? – Kalyan Raghu May 20 at 15:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.