O'Reilly logo

Raspberry Pi Networking Cookbook by Rick Golden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a firewall with ufw

This recipe uses a simple, yet powerful command-line tool (ufw) to configure a firewall.

This recipe can be used to completely block access to the Raspberry Pi. It can also be used to configure access through the firewall to specific applications (such as a web server or file server).

After completing this recipe, you will be able to protect the Raspberry Pi with a firewall.

Getting ready

The following are the ingredients:

  • A Raspberry Pi with a 5V power supply
  • An installed and configured "official" Raspbian Linux SD card
  • A network connection

This recipe does not require the desktop GUI and could either be run from the text-based console or from within an LXTerminal.

If the Raspberry Pi's Secure Shell server is running, this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required