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.

I only want http, https and DNS to be open.

I'm having troubles with setting up port ranges in the UFW GUI. How do I input configs into the feilds?

Basically, something along the lines of this, but in GUFW, as I'm trying to convert my Windows paranoid bro who hates the command line.

iptables -I OUTPUT -p tcp --dport 80 --sport 32768:61000 -j ACCEPT
iptables -I OUTPUT -p udp --dport 53 --sport 32768:61000 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 443 --sport 32768:61000 -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -I OUTPUT -p icmp -j DROP

iptables -I INPUT -p icmp -j DROP
iptables -I INPUT -p udp -j DROP
iptables -I INPUT -p tcp -m tcp --syn -j DROP
iptables -I INPUT -i lo -j ACCEPT

iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

And there has to be a logging system easily accessible to see any supposed intrusions.

share|improve this question
add comment

1 Answer 1

You will have to change the policy to first deny out going , then allow the ports you want.

gksu gufw

When you open gufw, it will look like this

Default

Enable the firewall by clicking the "Enabled" box

Deny Incoming and Outgoing.

Add a rule for the ports you wish to allow (80,443,53)

You can add a simple rule, and list your ports, it will look like this

Rules

Final result

Final

See the firweall section of This guide or The ubuntu wiki GUFW for additional details.

share|improve this answer
add comment

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.