In this video, you'll learn about UFW.
UFW is uncomplicated firewall, and it was developed to work with an intuitive syntax.
It's a default that you will find on Ubuntu.
Let's go to an Ubuntu server where I can show you how to work with it.
So for this demo, as you can see, we are on an Ubuntu server.
And a fun, complicating part is that I'm on SSH.
So yeah, what are we going to do?
Well, I want to check if UFW is currently available, so I'm using sudo ufw status.
And there we can see that UFW is inactive.
Well, I want to enable it, so sudo ufw enable.
Oh boy, may disrupt existing SSH connection.
Proceed with operation.
Let's not do that, and let's do the smart thing and first use sudo ufw allow ssh.
I want to make sure that we have a rule for SSH before I'm going to enable the firewall.
And then I'm going to reset, and now we can see firewall is active and enabled on system startup.
UFW status should show us that at this moment.
As you can see, port 22 is allowed over IPv4 as well as v6.
Next, do I really want to sudo ufw reject out SSH?
No, I don't want to do that.
I want sudo ufw reject out FTP.
No FTP outgoing traffic.
I'm not going to try to cut off the branch on which I'm sitting.
So that is why I'm using FTP as I'm not using it anyway.
So sudo ufw status is showing the reject out for FTP.
And if you regret, you can always use sudo ufw delete reject out FTP.
As you can see, the syntax is quite straightforward.
But even if the syntax is straightforward, you can do pretty advanced things as well,
like sudo ufw deny proto TCP from 10.0.0.10 to any port 22.
So what is that doing?
Well, let's go back to sudo ufw status.
And we can see that we have denied to port 22 for 10.0.0.10.
So that is how you can deny one IP address,
or if you want to an entire network access to a specific port.
Next, I'm going to show you sudo ufw app list,
because ufw can work with applications.
But this application needs to be installed.
And well, we see one only.
And I can request information about it using sudo ufw app info open SSH.
And there we can see what it is doing its short description.
So you can work with apps and you can work with ports.
And if you want more information, sudo ufw logging on might be convenient.
That is going to enable logging so that you can find extensive information
about firewall access, as well as blocks that might be helpful in troubleshooting.
Finally, the man page for ufw is giving all the information about what you can do.
Now, man ufw is giving information about all the different syntax components.
And based on that, you should be able to build yourself a pretty serious firewall.