13 MIN READ TIME

PFSENSE

Build your own hardware firewall

Worried about intruders and hack attacks? Nik Rawlinson shows how to take charge of network security with the BSD-based pfSense firewall.

Credit: http://pfsense.org

OUR EXPERT

Nik Rawlinson is an Esperantospeaking, pencilbothering, manual typewriter fan who also happens to have a soft spot for tech after sufficient years in the business to know what that disk icon on the Save button actually means.

You might not think you need another firewall. The one built into Linux is Y working all the time in the background to protect individual computers, and many routers have their own firewalls to protect the whole network. But running your own custom firewall has several benefits: it gives you more flexibility and better oversight of what’s going on in the background and logs, lots of logs!

And it’s easier than you might think. You don’t need specialist hardware, and you don’t even need to pay for enterprise-level firewall software. The open-source pfSense firewall is free for personal use, with a graphical interface for administration and all the same features as the enterprise version (the difference is that you don’t get commercial support). You can run it in a virtual machine on any PC on your network, or install it natively on a retired PC. Note, however, that you can’t run pfSense on a Raspberry Pi, because it doesn’t support the ARM architecture.

System requirements

PfSense installs as a complete operating system based on FreeBSD, so it has the same system requirements. This means you need to allocate it least 512MB of memory, and have a 64-bit processor running at more than 500MHz. If you want to support gigabit Ethernet or faster connections, it’s recommended to use a system with multiple cores running at speeds in excess of 2GHz.

Select the ISO image, from which your virtual machine will boot.

BASIC TRAFFIC SHAPING

Often called throttling, pfSense can apply per-client rules, for instance on guest VLANs, to stop individuals using all the bandwidth. Doing this in a simple way utilises a static throttling rule on a subnet/client basis without regard for anything else going on – ie it’s a dumb set level.

Select Firewall > Traffic Shaper > Limiters > Add New Limiter. This enables you to create a new static limiter that is used for either upload or download – let’s create one for 10Mb download. You also want to create another one for the alternative upload or download, and then save. Now you have a list of basic limiters that can be used.

Next, head over to Firewall > LAN or the device/network you want to limit, be it a client or entire subnet. The important areas here are Source – for a single host (ie a device), enter its IP address, you can use the Invert switch to apply this to every other device. Leave Destination as Any. Use an decent description so you know what it is down the line. At the bottom of the Advanced options (there are a lot), you’ll find In/Out Pipe, where you select the speed of the In

(upload speed) and Out (the download speed). Once the rule has been created, the cog on the left-hand side of the rule means that there are limiters applied.

Be aware that this rule will not work on Layer-2 traffic, which is to say it can’t control internal network traffic – it can only be applied to packets entering and leaving the network.

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for 99c
SUBSCRIBE NOW
30 day trial, then just $9.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
Summer 2023
VIEW IN STORE

Other Articles in this Issue


Linux Format
Linux Format
The #1 open source mag Future Publishing Limited,
WELCOME
MEET THE TEAM
We’re not avoiding the office, we’re building our own and taking it with us, but what’s the oddest place you’ve found yourself doing work?
Freeeedom!
We’re all avoiding the office these days (just
REGULARS AT A GLANCE
The Red Hat paywall
Red Hat announces source code of RHEL will only be available to paying customers, who can’t redistribute it.
Lemmy numbers spike after Reddit ban
A ban on subreddits helped promote alternative Lemmy with a general boost to federated platforms.
100% free GNU Linux-libre
Bye-bye binary blobs – build a truly free system.
CLONE WARS
“Red Hat’s changes to the way it distributes
DOWN TO THE WIRE
Ashok Sidipotu is a senior software engineer at
Animated JPEGs
FFmpeg has now merged JPEG-XL support. Is this the next step to widespread adoption of the format?
Wine comes to Mac OS
Apple’s Game Porting Toolkit is based on CrossOver’s code.
A wild desktop appears!
Kera Desktop touts itself as an easy and exciting way to enjoy your favourite OS.
Distro watch
What’s behind the free software sofa?
WHAT A NUMBER!
Italo Vignoli is one of founders of LibreOffice
BE KIND PEOPLE!
Jon Masters has been involved with Linux for
Kernel Watch
Jon Masters keeps up with all the latest happenings in the Linux kernel, so you don’t have to
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to answers@linuxformat.com
Mailserver
WRITE TO US Do you have a burning
CudaText
ADVANCED TEXT EDITOR
QMPlay2
MEDIA PLAYER
Mixxx
DJ SOFTWARE
Unison
FILE SYNCHRONISER
SSH-audit
SSH CONFIG ANALYSER
NormCap
COPY TEXT
Gromit-MPX
ON-SCREEN ANNOTATION
Open Fodder
SHOOT-’EM-UP
Empty Clip
RPG
LocalSend
FILE TRANSFER
Jellyfin
MEDIA SERVER
REVIEWS
WD Red Pro 20TB
High-capacity NAS OptiNAND on a platter impresses Shane Downing.
OpenSUSE 15.5
Nate Drake revisits the first Linux distro he ever used and finds that, like a fine wine, OpenSUSE has only improved with age.
Thunderbird 115
Nate Drake takes a sneak peek at the upcoming Thunderbird and finds it still comfortably ruling the roost.
Debian 12 Bookworm
Nate Drake burrows into Debian 12 (Bookworm) and is dazzled by the array of new features, including support for non-free firmware.
Roots of Pacha
Reinventing the wheel sounds like a dream to Management – they’ve sent Andrea Shearon back in time to reap the rewards!
ROUNDUP
Computer-aided design
WE COMPARE TONS OF STUFF SO YOU DON’T HAVE TO!
FREE ALL YOUR FILES
FREE ALL YOUR FILES
It’s time to stop Big Tech being in control of your online documents. Let Jonni Bidwell show you how with Nextcloud and Collabora Office.
Pi USER
Going over the Pi Pico BASICs
Relive your spaghetti code days on your Pi Pico!
I/O Learning HAT
Les Pounder wants to automate his home because his new office is too far away from the coffee machine. Maybe now he can.
Sovol SV06
Denise Bertacchi wonders what if an Ender and a Prusa MK3 had a baby?
NeoPixel URL control
Les Pounder thinks of NeoPixels as LED candy. They taste awful but look phenomenal. Will they taste better with a slice of Pi?
Set up a game development system
DEVELOPMENT
IN DEPTH
Bootstrap your LINUX career
Discover how Linux certification can help you. Stuart Burns explains the why and the how, with a few pro tips thrown in for good measure.
EVOLUTION OF CODING
Mike Bedford reveals how the programming languages of the ’50s morphed into today’s most used languages.
TUTORIALS
Multi-protocol transfer
Shashank ‘Proficient With SMB, SSH, SCP and More’ Sharma never has to rely on thumb drives to move data across different machines…
Take and organise notes with ease
Nick Peers reveals how to put your thoughts and ideas in order with the note-taking app to rule them all.
Build a static project website on GitHub
Matt Holder investigates static site generators, what they are useful for and why they are better than CMS in some situations.
Build a RISC-V LED sign
Tam Hanna takes the GigaDevice RISC-V microcontroller for a spin and creates a gadget that displays impolite messages in large red letters.
Add a little funk to mathematical plots
Always one looking to spice up his life, Ferenc Deák tries out a new function-plotting tool that’s packing a Pascal-like language.
CODING ACADEMY
Code your own Python text adventure
Nate Drake guides you through creating your own interactive text adventure with Python. This time, we LOOK at items…
Rediscover speed with the Redis revolution
REDIS
ADVERTISEMENT
GO COMPARE
go.compare
Linux Format
www.linuxformat.com www.magazinesdirect.com/LIN/B93G www.techradar.com/pro/linux
Magazines direct
www.magazinesdirect.com
Magazines Direct
magazinesdirect.com
BACK ISSUES
www.magazinesdirect.com
Magazines direct
www.magazinesdirect.com/linux-format
Techradar
techradar.com
Code club
www.codeclub.org.uk
EFF
EFF.ORG
THE BRAIN TUMOUR CHARITY
thebraintumourcharity.org
Chat
X
Pocketmags Support