Questions tagged [ufw]

Uncomplicated Firewall is a firewall configuration tool for Linux. It acts as a frontend to iptables. Originally designed for Ubuntu, it is available on many Linux distributions.

Uncomplicated Firewall is a firewall configuration tool for Linux. It acts as a frontend to iptables. Originally designed for Ubuntu, it is available on many Linux distributions.

495 questions
64
votes
2 answers

Where are the logs for ufw located on Ubuntu Server?

I have an Ubuntu server where I am blocking some IPs with ufw. I enabled logging, but I don't know where to find the logs. Where might the logs be or why might ufw not be logging?
blockhead
  • 901
62
votes
7 answers

Where does UFW (uncomplicated firewall) save command-line rules to?

You add a rule like this: ufw allow 22/tcp The rule is saved, and is applied even after reboot. But it's not written anywhere in /etc/ufw. Where is it saved to? (Ubuntu, using ufw as pre-installed.)
56
votes
3 answers

Ubuntu ufw: set a rule on a per interface basis

I want to create a rule that allows anyone on eth1 to access port 80. Can UFW do this or should I go back to using Shorewall? To clarify: this is a capabilties question, can ufw handle interfaces as a target?
48
votes
3 answers

UFW Firewall Rules ordering?

I have the following rules on our server within UFW: To Action From -- ------ ---- 22 ALLOW 217.22.12.111 22 ALLOW …
dannymcc
  • 2,747
  • 10
  • 49
  • 73
45
votes
2 answers

Can I use ufw to setup a port forward?

Im currently using ufw to enforce some basic firewall rules. Is it possible to also use ufw to do port forwarding? Specifically im wanting to forward incoming traffic to my server (same machine running ufw) on port 80 to port 8080. (http traffic…
tinny
  • 521
  • 2
  • 5
  • 11
35
votes
3 answers

UFW Enable requires y prompt, how to automate with Bash Script?

I'm trying to automate the setup of UFW on an Ubuntu 16.04 instance. However when I type: sudo ufw enable I get prompted to enter yes or no, is there a way to feed it yes or set it automatically to start without getting stuck with a prompt?
Adron
  • 644
35
votes
4 answers

Copy UFW rules between servers

I'm doing a hardware refresh on a my Colo, I just need to copy my UFW rules from my old server to my new server. I dont seem to be able to get them copy all the active rules from my old server to my new one. How do I copy my active UFW rules…
Squidly
  • 1,825
  • 2
  • 15
  • 19
34
votes
4 answers

Rate limiting with UFW: setting limits

UFW's man page mentions that it can setup iptables rate limiting for me: ufw supports connection rate limiting, which is useful for protecting against brute-force login attacks. ufw will deny connections if an IP address has…
33
votes
4 answers

Docker breaks libvirt bridge network

This issue is driving me crazy. I run a fresh install of Ubuntu 18.04, with: ufw to manage the firewall a br0 bridge lxd and libvirt (KVM) I tried stock docker.io package and packages form docker's own deb repository. I want o be able to deploy…
Laurent
  • 476
32
votes
4 answers

UFW comment existing rule?

I'm trying to comment an existing ufw firewall rule, but I can't find the exact command I can easily add a rule with comment like: sudo ufw allow in on eth0 to any port 80 comment 'test' But how do I comment an existing rule?
Emax
  • 465
29
votes
2 answers

UFW on Ubuntu to Allow All Traffic on LAN

I want to allow all LAN traffic to my Ubuntu server. I have read the documentation and see the command, but when I try to edit the command for my IP range I get an error. How can I allow all traffic starting at 192.168.15.0 - 192.168.15.255? sudo…
26
votes
3 answers

Debugging iptables and common firewall pitfalls?

This is a proposed Canonical Question about understanding and debugging the software firewall on Linux systems. In response to EEAA's answer and @Shog's comment that we need a suitable canonical Q&A for closing common relatively simple…
HBruijn
  • 84,206
  • 24
  • 145
  • 224
25
votes
1 answer

Check ufw default policy action

I know it's very easy to set the default behavior of ufw, e.g. ufw default deny, but how do I check what the default POLICY action is? It does not show in ufw status.
Sarke
  • 471
22
votes
3 answers

How do I use ufw to open ports on ipv4 only?

Whenever I run a command like ufw allow 22, ufw automatically adds the firewall rules to both ipv4 and ipv6. If I want to only open a port on ipv4, is there a way to do so? Something like ufw allow 22 proto ipv4.
Ralph
  • 362
21
votes
2 answers

ufw deny from ip doesn't seem to be working

I've been tailing my server's access log while working today, and have noticed one of my client's wordpress sites getting hammered with login attempts from an IP from out of the country. I wanted to deny access from this IP address and tried the…
rmmoul
  • 325
1
2 3
32 33