How can you make a Firewall using Raspberry Pi?

How can you make a Firewall using Raspberry Pi

Is your private network secure? We are searching so many random things on internet. Think of the vulnerability of malicious attack that is threatening the security and privacy. Additionally, your private network can be more secure and less vulnerable by the use of Firewall.

Overview of Raspberry pi

As a matter of fact, all you need a firewall that will protect your private network from malicious worms or any cyber-attack. Moreover, it will safely guard your network from the users who are not authorized. Yeah of course It will act as a filter to all the data that is coming to your network and will help in eliminating some that can be harmful or threat to your privacy and security.

Raspberry pi have a default configuration with correct packages and tweaks that can be used as a firewall. Of course Raspberry pi is a computer that do not have Ethernet switch and comes in many versions.  With the use of OpenWRT you can easily manage your Raspberry pi firewall.

Moreover, OpenWRT can be installed in a raspberry pi that can be your new home firewall. Usually in our homes we use a two interface firewall which can be replaced with OpenWRT firewall. Not only it will give you privacy and security but it will help you to track any malicious activity within your network. It will make you alert with its alarming features.

Before installing OpenWRT in the raspberry pi there is a need of some information. Furthermore these includes the IP address of your PC, broadcast and network mask and make a note of it. Surely all this information is easily available on your existing firewall. The following steps need to be followed or installing your firewall.


This step includes putting the Raspberry pi in its box and arranging the monitor and the USB keyboard. Then you need to put the network card within the USB keyboard. Need to put the network cable but wait to give the power.


2. Producing Bootable SD card:

For this we need to download OpenWRT image and the extraction of the images in thee SD card need to be done. Now the SD card need to flash in to the Raspberry pi and switch on the power supply.

3.Booting Raspberry pi and replacing default password with new one:

By opening the command prompt you can find out the “inet addr” line using the command “ipconfig eth0”. This will help in logging in to the device. In the browser enter the IP address and you will get a warning to change the default password. After changing the password save the changes and click on the apply button.

4. USB Ethernet Adapter Driver installation:

Here you need to activate the USB by installing the kernel drivers. The stock package manager of OpenWRT will select the perfect package perform the required changes through the whole installation process.

Flow chart for USB Ethernet Adapter Driver installation

5. WAN Interface formation:

You have to create the WAN interface using a USB network. You must choose a particular adapter who permits only 1.1 USB Drives to 2.0 USB. The ‘et1’ (USB Network Interface) will be work as an external. Lastly when you are done with defining the et1, the OpenWRT will apply the required policy of firewall.

Flow chart for WAN Interface formation

6. Cut over the Raspberry Pi:

Next, we have to activate the DHCP (DNS) by configuring an internal interface, which will help to address a dynamic IP and allow the name services. By doing so the will be reconnected with the OpenWRT firewall and assign an IP for your pc, without any hooping.

Flow chart for Cut over the Raspberry Pi

Now the browser will not show any result as return because the Raspberry pi is now lied over a different address. Connect with the Raspberry pi by putting the new address to your browser.

Flow chart - Cut over the Raspberry Pi Figure 2

7. DNS Service setup and confirming the firewall:

In the startup option of the system check and make sure that all the services are enabled. There will be an X sign in red that can be used to enable the service.

8. New firewall establishment:

The first thing that need to be done is to switch off the firewall that is already present. Raspberry pi is placed in that position. The Modem that is put into the cable is plugged in the USB. The LAN cable is dragged into the on board interface. The raspberry pi is turned on.

9. Internal interface configuration:

It’s the most important and final part, configuring the interface. Here the new interface will overlap on the old firewall address. A DHCP shield will keep your home network safe from ant interruption.

Flow chart for Internal interface configuration

10. Final check after a reboot:

That’s the final reboot to the system to get familiar with the new services of the new interface. That last reboot is required to give a final check to the new setup. That’ll help you to be in same condition after a shutdown.

Flow chart for Final check after a reboot


In conclusion, this article will guide you to replace the existing firewall with a new one. OpenWRT software is been installed in the Raspberri pi. Actually this software help you to manage the firewall that will provide an user satisfaction. Moreover, DHP and DNS services along with some basic functionalities are provided by this. This are just the starting of the capabilities of this firewall.

This new firewall is more interactive and have more features than other home firewall. It will make your experience of using your private network more secure.

See Also…

Wondering What are Wi-Fi Hotspots? Here is the answer(Opens in a new browser tab)

The millionaire guide on how to turn off firewall windows 10 Systems(Opens in a new browser tab)


Please enter your comment!
Please enter your name here