Categories
Life hack

How to configure ubuntu’s built-in firewall

@chrisbhoffman
Updated July 10, 2017, 4:11pm EDT

How to configure ubuntu’s built-in firewall

Ubuntu includes its own firewall, known as ufw – short for “uncomplicated firewall.” Ufw is an easier-to-use frontend for the standard Linux iptables commands. You can even control ufw from a graphical interface.

Ubuntu’s firewall is designed as an easy way to perform basic firewall tasks without learning iptables. It doesn’t offer all the power of the standard iptables commands, but it’s less complex.

Terminal Usage

The firewall is disabled by default. To enable the firewall, run the following command from a terminal:

You don’t necessarily have to enable the firewall first. You can add rules while the firewall is offline, and then enable it after you’re done configuring it.

How to configure ubuntu’s built-in firewall

Working With Rules

Let’s say you want to allow SSH traffic on port 22. To do so, you can run one of several commands:

sudo ufw allow 22 (Allows both TCP and UDP traffic – not ideal if UDP isn’t necessary.)

sudo ufw allow 22/tcp (Allows only TCP traffic on this port.)

sudo ufw allow ssh (Checks the /etc/services file on your system for the port that SSH requires and allows it. Many common services are listed in this file.)

Ufw assumes you want to set the rule for incoming traffic, but you can also specify a direction. For example, to block outgoing SSH traffic, run the following command:

You can view the rules you’ve created with the following command:

How to configure ubuntu’s built-in firewall

To delete a rule, add the word delete before the rule. For example, to stop rejecting outgoing ssh traffic, run the following command:

sudo ufw delete reject out ssh

Ufw’s syntax allows for fairly complex rules. For example, this rule denies TCP traffic from the IP 12.34.56.78 to port 22 on the local system:

sudo ufw deny proto tcp from 12.34.56.78 to any port 22

To reset the firewall to its default state, run the following command:

How to configure ubuntu’s built-in firewall

Application Profiles

Some applications requiring open ports come with ufw profiles to make this even easier. To see the application profiles available on your local system, run the following command:

How to configure ubuntu’s built-in firewall

View information about a profile and its included rules with the following command:

How to configure ubuntu’s built-in firewall

Allow an application profile with the allow command:

More Information

Logging is disabled by default, but you can also enable logging to print firewall messages to the system log:

For more information, run the man ufw command to read ufw’s manual page.

GUFW Graphical Interface

GUFW is a graphical interface for ufw. Ubuntu doesn’t come with a graphical interface, but gufw is included in Ubuntu’s software repositories. You can install it with the following command:

GUFW appears in the Dash as an application named Firewall Configuration. Like ufw itself, GUFW provides a simple, easy-to-use interface. You can easily enable or disable the firewall, control the default policy for inbound or outbound traffic, and add rules.

How to configure ubuntu’s built-in firewall

The rules editor can be used to add simple rules or more complicated ones.

How to configure ubuntu’s built-in firewall

Remember, you can’t do everything with ufw – for more complicated firewall tasks, you’ll have to get your hands dirty with iptables.

The first step in securing your system is configuring a firewall. To set up and manage your firewall, Linux has designed iptables, a flexible firewall utility.

Users who are new to network security may find iptables a bit intimidating. That’s why we recommend starting with UFW. UFW (Uncomplicated Firewall) is a user-friendly interface implemented on top of iptables. It provides a simple way to configure a firewall.

In this tutorial, you will learn how to set up firewall protection of your Ubuntu 18.04 system with UFW.

How to configure ubuntu’s built-in firewall

  • A user account with sudo privileges
  • Access to a command line/terminal window (CtrlAltT)

Set Up UFW from Command Line

Install UFW on Ubunutu

UFW comes pre-installed with Ubuntu 18.04.

In the unlikely case you do not have UFW, run the following command to install it:

Configure UFW to Support IPv6

If the system has both IPv4 and IPv6, you need to modify the UFW configuration file to support both protocols.
Open the file using Nano or any other text editor:

How to configure ubuntu’s built-in firewall

The IPv6 value should be set to yes.

Save and close the file.

Set Up Default UFW Policy

The default UFW configuration is set to allow all outgoing connections and deny all incoming connections.

These rules work fine for personal computers which do not need to respond to incoming requests.

If you want to return to the default settings, run the following commands:

Allow SSH Connections

If you plan to connect to your server from remote locations, you need to set up UFW to allow incoming SSH connections.
Configure UFW to allow SSH connections with the command:

Enable UFW

After you have configured the firewall to allow SSH connections, you can enable it with:

The output will inform you that existing SSH connections could be disrupted by enabling the firewall. Confirm you want to proceed by typing y and hitting Enter.

The output should inform you that the firewall is now active, as in the image below:

Check UFW Status

To check UFW status and then set rules run the command:

You will see its status, the default settings, and which ports are open for connection as in the image below.

How to configure ubuntu’s built-in firewall

Adding More UFW Rules

You can add more rules to further define the extent of communication the server has.

Specify which connections are allowed and which are denied.

Allow Incoming Connections on Other Ports

Depending on what you use the server for, you may need to open some other ports to allow specific incoming connections. Create additional UWF rules to add these connections to your firewall configuration.

Set your server to listen to HTTP (on port 80) by typing:

To enable HTTPS connections, use one of the following two commands:

You might be using the server as a remote machine to which you want complete access from your home system. To set a rule that allows access to all ports from a specific IP address, run:

To allow access from a particular machine to a specific port run the command:

To allow access to a range of ports, specify the range values and the type of protocol (TCP or UDP). For instance, the following command will allow connections from ports 2000 to 2004 for TCP and UDP:

Note: TCP (Transmission Control Protocol) is a connection-oriented protocol used to guarantee that all the data transmitted is in order. UDP (User Datagram Protocol) is a connection-less oriented protocol that transfers data faster, but is not as reliable.

Deny Incoming Connections on Other Ports

To create a deny rule to forbid connection from a specific IP address run the command:

You can also deny access to particular ports by typing:

Delete UFW Rules

If you want to delete a rule you no longer need, there are two ways to do so.

One option is to display a list of all the rules and find the assigned number of the rule. First, run the command:

As in the image above, the output will list the rules you have defined so far. Each rule has a number according to the order in which it was set.

To delete a rule, use the following syntax with the appropriate rule number:

An alternative way to delete a rule is to specify it word for word (as you added it):

For example, to remove a rule that allows connection to port 2000, use the command:

Application Profiles

Each package installed with the apt command has an application profile in the /etc/ufw/applications.d directory. The profile provides information about the software and its UFW settings.

To see a list of all application profiles use the command:

See more information about a specific package (along with open ports) by typing:

In the example below, there is only one application profile – CUPS. The app info option shows you that the package opens port 631.

Must read

How To Install Kubernetes Cluster On Ubuntu 20.04 Using K3s

How To Install Siege Benchmarking Tool On Ubuntu 20.04

Install Mattermost on Ubuntu 20.04 (With MariaDB)

How To Install Odoo 14 with Let’s Encrypt SSL On Ubuntu 20.04

How to configure ubuntu’s built-in firewall

There is nothing safe from hackers on the Internet, however, we can implement security measures to be more protected against an attack. With this in mind, it is convenient to configure a firewall in our system.

A Firewall is a system that allows protecting a computer or a network of the intrusions that come from the Internet. A firewall behaves as a barrier between the Internet or other public networks and our computer. In the firewall, the incoming and outgoing connections are determined by established rules.

For this reason, it is convenient to take some time to adjust the behavior of the Firewall in the system. Today I will teach you how to configure a firewall in Ubuntu 20.04 / Debian 10.

Configure the Firewall in Ubuntu 20.04 / Debian 10

1.-Upgrade the system

Upgrading the system is always a vital task to perform these types of installations and configurations because doing so provides us with the latest security patches. In short, you’ll have a more secure system. To do this, open a terminal and write:

As a result of updating the system, you will be able to work with the firewall with the certainty of having more updated and more stable packages.

2. Working with UFW the Firewall on Ubuntu 20.04 / Debian 10

By default, Ubuntu has a Firewall installed, but not configured. In other words, it’s almost like not having it. So you have to get to work on it.

First of all, you must enable the service. Without it, the firewall will not run.

1.- Enabling and Starting ufw service

Now, it’s a good idea to see ufw’s default rules for the system. In this case, run:

How to configure ubuntu’s built-in firewall2.- Showing the defaults rules for ufw

If you plan to use a server, then it’s a good idea to allow connections from ssh.

3.- Allowing ssh connections

In effect, the above command, tells the Firewall to allow input and output connections to ssh.

In case you want to “open” a port to be used by another application, you must run:

4.- Opening a port with ufw

Don’t forget to replace 321 with the port you want. If the application uses TCP or UDP, you must change as the case may be.

You can open as many ports as you need. However, these three are basic to working with the computer:

How to configure ubuntu’s built-in firewall5.- Opening several important ports

80/TCP: Used for HTTP
443/TCP: Used for HTTPS
21/TCP: Used for FTP

You can even make a rule to allow or deny connections from any IP address.

With this, you authorize that the applications that come from that IP the firewall will accept them. If the IP address cannot be located, you will see an error like this:

6.- Allowing connections from a single IP

If you are sorry to allow connections to that IP, you can revoke the rule:

Remember to replace “IP” with the corresponding IP address.

However, imagine you’re starting to build a network and you don’t know who to trust, so you can deny connections from all computers.

7.- Denying all incoming connection

It is also possible to list all the options that the firewall has. Show them with the following command:

How to configure ubuntu’s built-in firewall8.- Showing the ufw’s help

As can be seen, manipulating ufw from the terminal is very simple.

3. GUFW. A graphical program to configure the firewall in Ubuntu 20.04 / Debian 10

As can be seen, manipulating ufw from the terminal is very simple, but if you don’t feel comfortable using CLI, then it is possible to use a GUI for it.

With GUFW, you can configure a firewall on Ubuntu easily. Also, you can apply the same options, but with a convenient graphical management interface. To install it:

When you run it, you’ll see a very simple interface like this:

How to configure ubuntu’s built-in firewall9.- Using GUFW

If you click on “Rules” and then on the “+” button you can add the rules we have done before per terminal. Remember to first enable the GUFW.

How to configure ubuntu’s built-in firewall10.- Setting some rules

You can also check the logs that are generated.

How to configure ubuntu’s built-in firewall11.- Checking the logs

As you can be seen, configure a firewall in Ubuntu is simple and provides us with the extra security needed for an operating system. Of course, if we speak at the enterprise level, there are even more customizable and payment solutions to further protect the security of businesses.

Now it’s up to you, tell us about your experience with ufw?

Conclusion

Computer security is not something to be taken lightly, which is why knowing how to configure a firewall is always a good idea. Even in operating systems as safe as Linux or BSD.

Now, with this post, you have the basic tools to configure a Firewall in a fast and easy way and have a more secure system.

Please share this article on your social networks and join our Telegram Channel.

A properly configured firewall is one of the most important aspects of the overall system security. By default Ubuntu comes with a firewall configuration tool called UFW (Uncomplicated Firewall).

UFW is a user-friendly front-end for managing iptables firewall rules and its main goal is to make managing iptables easier or as the name says uncomplicated. Ubuntu’s firewall is designed as an easy way to perform basic firewall tasks without learning iptables. It doesn’t offer all the power of the standard iptables commands, but it’s less complex.

In this tutorial you will learn:

  • What is UFW and its Overview.
  • How to Install UFW and Perform Status Check.
  • How to Use IPv6 with UFW.
  • UFW Default Policies.
  • Application Profiles.
  • How to Allow and Deny Connections.
  • Firewall Log.
  • How to Delete UFW Rules.
  • How to Disable and Reset UFW.

How to configure ubuntu’s built-in firewall

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions

Category Requirements, Conventions or Software Version Used
System Ubuntu 18.04
Software Ubuntu Inbuilt Firewall UFW
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user

UFW Overview

The kernel’s packet filtering system would be of little use to administrators without a userspace interface to manage it. This is the purpose of iptables: When a packet reaches your server, it will be handed off to the Netfilter subsystem for acceptance, manipulation, or rejection based on the rules supplied to it from userspace via iptables. Thus, iptables is all you need to manage your firewall, if you’re familiar with it, but many frontends are available to simplify the task.

UFW, or Uncomplicated Firewall, is a front-end to iptables. Its main goal is to make managing your firewall drop-dead simple and to provide an easy-to-use interface. It’s well-supported and popular in the Linux community—even installed by default in a lot of distributions. As such, it’s a great way to get started securing your sever.

Install UFW and Status Check

Using IPv6 with UFW

UFW Default Policies

command. Firewall policies are the foundation for building more detailed and user-defined rules. In most cases the initial UFW Default Policies are a good starting point.

How to configure ubuntu’s built-in firewall

Ubuntu comes with a firewall module by default, but it is disabled after installing… It also comes with a configuration tool called Uncomplicated Firewall (UFW) which can be used to manage firewall app….

The tool is user-friendly and allows system admins to manage Ubuntu firewall module.. You can use UFW to enable and manage firewall rules as well as disable it if it’s already enabled…

This brief tutorial shows students and new users how enable and manage Ubuntu firewall on Ubuntu 16.04 | 18.04 servers and create rules that will keep your server secured and protected from external threats…When you’re ready to manage Ubuntu firewall, follow the steps below:

Step 1: Enable Ubuntu Firewall

Since the firewall module is disabled by default, the commands below enables it… But first, run the commands below to see the status of the firewall system…

sudo ufw status

That should display similar message as below: Status: inactive

This is the default state of the firewall module…

You can also run the commands below to check the status

sudo ufw status verbose

Now… to protect your server, you’ll want to enable the firewall module… If the firewall is activated, by default, it will block all incoming connections and allow all outbound connections…

So if you’re running servers and services that must be assessed externally, you’ll want to allow those traffic…

The good thing about Ubuntu is many of the popular servers and services have profiles that can be managed via UFW to allow and disallow traffic to them…

The apt command adds an application profile to /etc/ufw/applications.d directory… You can list these profiles by running the commands below:

sudo ufw app list

You should see a list of apps that can easily be allowed and disallowed via UFW…

Now you can easily run the commands below to allow external traffic to Nginx HTTP server…

sudo ufw app info ‘Nginx Full’

To allow SSH run the commands below:

sudo ufw allow OpenSSH

You can also use the service name instead of the app profile to enable or disable it… For example,, if you wish to enable HTTP over port 80, run the commands below:

sudo ufw allow http

Or HTTPS, run the commands below:

sudo ufw allow https

The same can also be accomplished using the commands below to allow HTTP over TCP on port 80 or HTTPS over TCP on port 443

You can do that for all the apps you want to allow traffic to.. After you’ve updated the firewall rules, you can finally enable UFW..

sudo ufw enable

To allow specific computer via IP address 192.168.1.2, run the commands below:

sudo ufw allow from 192.168.1.2

To deny the same IP, run the commands below:

sudo ufw deny from 192.168.1.2

That should enable the enable the firewall and the rules you created above…

Step 2: Disable Ubuntu Firewall

If you want to disable Ubuntu firewall, you can run the commands below to disable it…

sudo ufw disable

The command above will stop and disable the firewall but it will not delete the firewall rules…. The next time you enable to firewall, it should automatically reapply those rules you enabled previously…

To disable and delete all the rules, simply run the commands below:

You’ll be prompted whether to continue with the change…

Type Y to accept and continue..

That should do it.. There are more rules that could be added to Ubuntu firewall configurations…. but the few above should get you started…

You may also like the post below:

Published by Student

This post was not written by a robot! I spend my spare time searching for ways to help students and new users get to know and understand Linux, Ubuntu, Windows, and Open Source software.

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

How to configure ubuntu’s built-in firewall

Ubuntu menyertakan firewallnya sendiri, yang dikenal sebagai ufw – kependekan dari “firewall tidak rumit.” Ufw adalah antarmuka yang lebih mudah digunakan untuk perintah iptables Linux standar. Anda bahkan dapat mengontrol ufw dari antarmuka grafis.

Firewall Ubuntu dirancang sebagai cara mudah untuk melakukan tugas-tugas firewall dasar tanpa mempelajari iptables. Itu tidak menawarkan semua kekuatan dari perintah iptables standar, tetapi itu kurang kompleks.

Penggunaan Terminal

Firewall dinonaktifkan secara default. Untuk mengaktifkan firewall, jalankan perintah berikut dari terminal:

Anda tidak harus mengaktifkan firewall terlebih dahulu. Anda dapat menambahkan aturan saat firewall sedang offline, dan kemudian mengaktifkannya setelah Anda selesai mengonfigurasinya.

How to configure ubuntu’s built-in firewall

Bekerja dengan Aturan

Katakanlah Anda ingin mengizinkan lalu lintas SSH di port 22. Untuk melakukannya, Anda dapat menjalankan salah satu dari beberapa perintah:

sudo ufw memungkinkan 22 (Memungkinkan trafik TCP dan UDP – tidak ideal jika UDP tidak diperlukan.)

sudo ufw izinkan 22 / tcp (Hanya mengizinkan lalu lintas TCP pada port ini.)

sudo ufw allow ssh (Memeriksa file / etc / services pada sistem Anda untuk port yang diperlukan dan diizinkan oleh SSH. Banyak layanan umum tercantum dalam file ini.)

Ufw menganggap Anda ingin menetapkan aturan untuk lalu lintas masuk, tetapi Anda juga dapat menentukan arah. Misalnya, untuk memblokir lalu lintas SSH keluar, jalankan perintah berikut:

Anda dapat melihat aturan yang Anda buat dengan perintah berikut:

How to configure ubuntu’s built-in firewall

Untuk menghapus aturan, tambahkan kata hapus sebelum aturan. Misalnya, untuk berhenti menolak lalu lintas ssh keluar, jalankan perintah berikut:

Sintaks Ufw memungkinkan aturan yang cukup rumit. Misalnya, aturan ini menolak lalu lintas TCP dari IP 12.34.56.78 ke port 22 pada sistem lokal:

sudo ufw tolak proto tcp dari 12.34.56.78 ke port 22

Untuk mengatur ulang firewall ke kondisi default, jalankan perintah berikut:

Profil Aplikasi

Beberapa aplikasi yang membutuhkan port terbuka datang dengan profil ufw untuk membuatnya lebih mudah. Untuk melihat profil aplikasi yang tersedia di sistem lokal Anda, jalankan perintah berikut:

How to configure ubuntu’s built-in firewall

Lihat informasi tentang profil dan aturan yang disertakan dengan perintah berikut:

How to configure ubuntu’s built-in firewall

Izinkan profil aplikasi dengan perintah allow:

Informasi Lebih Lanjut

Logging dinonaktifkan secara default, tetapi Anda juga dapat mengaktifkan logging untuk mencetak pesan firewall ke log sistem:

Untuk informasi lebih lanjut, jalankan perintah man ufw untuk membaca halaman manual ufw.

Antarmuka Grafis GUFW

GUFW adalah antarmuka grafis untuk ufw. Ubuntu tidak datang dengan antarmuka grafis, tetapi gufw termasuk dalam repositori perangkat lunak Ubuntu. Anda dapat menginstalnya dengan perintah berikut:

GUFW muncul di Dash sebagai aplikasi bernama Firewall Configuration. Seperti ufw itu sendiri, GUFW menyediakan antarmuka yang sederhana dan mudah digunakan. Anda dapat dengan mudah mengaktifkan atau menonaktifkan firewall, mengontrol kebijakan default untuk lalu lintas masuk atau keluar, dan menambahkan aturan.

How to configure ubuntu’s built-in firewall

Editor aturan dapat digunakan untuk menambahkan aturan sederhana atau yang lebih rumit.

How to configure ubuntu’s built-in firewall

Ingat, Anda tidak dapat melakukan semuanya dengan ufw – untuk tugas firewall yang lebih rumit, Anda harus membuat tangan Anda kotor dengan iptables.

How to configure ubuntu’s built-in firewall

Configure Linux Built-In Firewall ?

Firewall is always a best layer of defense of any operating system. Ubuntu includes it,s own firewall named as ufw – short for “uncomplicated firewall.” Ufw is an easier-to-use frontend for the standard Linux iptables commands. You can even control ufw from a graphical interface.

By default Linux firewall is disabled you need to be enable this firewall. In my lab i am using the Backtrack5R3 based on Ubuntu.

Enable your built-in firewall with $sudo ufw enable command.

I already enable the firewall, so it will give you message ” Firewall is enable and active on Start-up ”

GUFW Graphical Interface :-

GUFW is a graphical interface for ufw. Ubuntu doesn’t come with a graphical interface, but gufw is included in Ubuntu’s software repositories. You can install it with the following command:

sudo apt-get install gufw

GUFW appears in the Dash as an application named Firewall Configuration. Like ufw itself, GUFW provides a simple, easy-to-use interface. You can easily enable or disable the firewall, control the default policy for inbound or outbound traffic, and add rules.

How to configure ubuntu’s built-in firewall

Now Go to the System menu > Administration and open Firewall configuration

How to configure ubuntu’s built-in firewall

now click on the add button to define your rule.

How to configure ubuntu’s built-in firewall

Working With Rules

Let’s say you want to allow SMTP traffic on port 25. To do so, you can run one of several commands:

sudo ufw allow 25 (Allows both TCP and UDP traffic – not ideal if UDP isn’t necessary.)

sudo ufw allow 25/tcp (Allows only TCP traffic on this port.)

sudo ufw allow smtp (Checks the /etc/services file on your system for the port that Smtp requires and allows it. Many common services are listed in this file.)

Ufw assumes you want to set the rule for incoming traffic, but you can also specify a direction. For example, to block outgoing Smtp traffic, run the following command:

sudo ufw reject out smtp

You can view the rules you’ve created with the following command:

sudo ufw status

I found a good free firewall for Linux called Shorewall. If you are running Linux and you don’t have firewall download it from http://shorewall.net/

Hope you like my post Configure Linux Built-In Firewall. Please Share with others.

Security is crucial when you run your own server. You want to make sure that only authorized users can access your server, configuration, and services.

In Ubuntu, there is a firewall that comes preloaded. It’s called UFW (Uncomplicated Firewall). Although UFW is a pretty basic firewall, it is user friendly, excels at filtering traffic, and has good documentation. Some basic Linux knowledge should be enough to configure this firewall on your own.

Install UFW

Notice that UFW is typically installed by default in Ubuntu. But if anything, you can install it yourself. To install UFW, run the following command.

Allow connections

If you are running a web server, you obviously want the world to be able to access your website(s). Therefore, you need to make sure that the default TCP port for web is open.

In general, you can allow any port you need by using the following format:

Deny connections

If you need to deny access to a certain port, use this:

For example, let’s deny access to our default MySQL port.

UFW also supports a simplified syntax for the most common service ports.

It is highly recommended to restrict access to your SSH port (by default it’s port 22) from anywhere except your trusted IP addresses (example: office or home).

Allow access from a trusted IP address

Typically, you would need to allow access only to publicly open ports such as port 80. Access to all other ports need to be restricted or limited. You can allow your home/office IP address (preferably, it is supposed to be a static IP) to be able to access your server through SSH or FTP.

Let’s also allow access to the MySQL port.

Looks better now. Let’s move on.

Enable UFW

Before enabling (or restating) UFW, you need to make sure that the SSH port is allowed to receive connections from your IP address. To start/enable your UFW firewall, use the following command:

You will see this:

Type Y, then press Enter to enable the firewall.

Check UFW status

Take a look at all of your rules.

You will see output similar to the following.

Use the “verbose” parameter to see a more detailed status report.

Disable/reload/restart UFW

To disable (stop) UFW, run this command.

If you need to reload UFW (reload rules), run the following.

In order to restart UFW, you will need to disable it first, and then enable it again.

Again, before enabling UFW, make sure that the SSH port is allowed for your IP address.

Removing rules

To manage your UFW rules, you need to list them. You can do that by checking UFW status with the parameter “numbered”. You will see output similar to the following.

Noticed the numbers in square brackets? Now, to remove any of these rules, you will need to use these numbers.

Enabling IPv6 support

If you use IPv6 on your VPS, you need to ensure that IPv6 support is enabled in UFW. To do so, open the config file in a text editor.

Once opened, make sure that IPV6 is set to “yes”:

After making this change, save the file. Then, restart UFW by disabling and re-enabling it.

Back to default settings

If you need to go back to default settings, simply type in the following command. This will revert any of your changes.

Conclusion

Overall, UFW is able to protect your VPS against the most common hacking attempts. Of course, your security measures should be more detailed than just using UFW. However, it is a good (and necessary) start.

If you need more examples of using UFW, you can refer to UFW – Community Help Wiki.

Firewall Configuration

Firewalls are customizable. This means that you can add or remove filters based on several conditions. Some of these are:

IP addresses – Each machine on the Internet is assigned a unique address called an IP address. IP addresses are 32-bit numbers, normally expressed as four “octets” in a “dotted decimal number.” A typical IP address looks like this: 216.27.61.137. For example, if a certain IP address outside the company is reading too many files from a server, the firewall can block all traffic to or from that IP address.

Domain names – Because it is hard to remember the string of numbers that make up an IP address, and because IP addresses sometimes need to change, all servers on the Internet also have human-readable names, called domain names. For example, it is easier for most of us to remember www.howstuffworks.com than it is to remember 216.27.61.137. A company might block all access to certain domain names, or allow access only to specific domain names. Protocols – The protocol is the pre-defined way that someone who wants to use a service talks with that service. The “someone” could be a person, but more often it is a computer program like a Web browser. Protocols are often text, and simply describe how the client and server will have their conversation. The http in the Web’s protocol. Some common protocols that you can set firewall filters for include:

  • IP (Internet Protocol) – the main delivery system for information over the Internet
  • TCP (Transmission Control Protocol) – used to break apart and rebuild information that travels over the Internet
  • HTTP (Hyper Text Transfer Protocol) – used for Web pages
  • FTP (File Transfer Protocol) – used to download and upload files
  • UDP (User Datagram Protocol) – used for information that requires no response, such as streaming audio and video
  • ICMP (Internet Control Message Protocol) – used by a router to exchange the information with other routers
  • SMTP (Simple Mail Transport Protocol) – used to send text-based information (e-mail)
  • SNMP (Simple Network Management Protocol) – used to collect system information from a remote computer
  • Telnet – used to perform commands on a remote computer

A company might set up only one or two machines to handle a specific protocol and ban that protocol on all other machines.

Ports – Any server machine makes its services available to the Internet using numbered ports, one for each service that is available on the server (see How Web Servers Work for details). For example, if a server machine is running a Web (HTTP) server and an FTP server, the Web server would typically be available on port 80, and the FTP server would be available on port 21. A company might block port 21 access on all machines but one inside the company.

Specific words and phrases – This can be anything. The firewall will sniff (search through) each packet of information for an exact match of the text listed in the filter. For example, you could instruct the firewall to block any packet with the word “X-rated” in it. The key here is that it has to be an exact match. The “X-rated” filter would not catch “X rated” (no hyphen). But you can include as many words, phrases and variations of them as you need.

Some operating systems come with a firewall built in. Otherwise, a software firewall can be installed on the computer in your home that has an Internet connection. This computer is considered a gateway because it provides the only point of access between your home network and the Internet.

With a hardware firewall, the firewall unit itself is normally the gateway. A good example is the Linksys Cable/DSL router. It has a built-in Ethernet card and hub. Computers in your home network connect to the router, which in turn is connected to either a cable or DSL modem. You configure the router via a Web-based interface that you reach through the browser on your computer. You can then set any filters or additional information.

Hardware firewalls are incredibly secure and not very expensive. Home versions that include a router, firewall and Ethernet hub for broadband connections can be found for well under $100.