Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In Windows besides the Windows firewall a user could have installed a firewall program, or there is another service listening to that port.

In Ubuntu how can I see what blocks/filters open ports? Iptables rules? What about outbound connections?

thanks!

share|improve this question

2 Answers 2

To list rules on local machine use

sudo iptables -L -n

Ubuntu is shipped with firewall(ufw), which is not enabled by default

  • To check status of firewall:sudo ufw status
  • To enable: sudo ufw enable
  • To disable: sudo ufw disable
  • To allow traffic on port: sudo ufw allow <port_num>
  • To block a port: sudo ufw block <port_num>

To check what outbound connections are running use command

sudo lsof -i -P -n
share|improve this answer

In Linux, all the firewalls are actually interfaces to setting up the rules of the kernel iptables.

To list all rules, type

sudo iptables -S

You can also see what firewall packages are installed by writing

dpkg -l | grep -i firewall
share|improve this answer
    
What happens in systems where iptables is not installed? Is there any other way to list the kernel iptables? –  Sitoplex Oct 14 '12 at 11:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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