Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Experiment no:8 Roll No:26062

Title of experiment : Configuring Firewall on PC


Aim : Configuring and setting firewall on Personal
computer

Theory:
To install and set up the Uncomplicated Firewall (UFW) on an Ubuntu
server, follow these steps:

**Step 1: Access Your Ubuntu Server**

Access your Ubuntu server either physically or through a remote


connection, typically via SSH.

**Step 2: Update the System**

Before installing any software, ensure your system is up to date. Run the
following commands:

```bash
sudo apt update
sudo apt upgrade
```

**Step 3: Install UFW**

Install UFW by running the following command:


```bash
sudo apt install ufw
```

**Step 4: Enable UFW**

Enable UFW with the following command:

```bash
sudo ufw enable
```

You'll receive a prompt asking if you want to proceed; type 'y' and press
Enter.

**Step 5: Set Default Policies**

By default, UFW denies incoming and allows outgoing traffic. It's


recommended to keep these defaults and create specific rules for your
server. To set the defaults:

```bash
sudo ufw default deny incoming
sudo ufw default allow outgoing
```

**Step 6: Define Rules**


Now, define rules for the services you want to allow. For example, to
allow SSH access (port 22):

```bash
sudo ufw allow OpenSSH
```

To allow other services, you can specify the port number and protocol.
For instance, to allow HTTP (port 80) and HTTPS (port 443):

```bash
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
```

**Step 7: Review Rules**

You can check the rules you've defined by running:

```bash
sudo ufw status
```

This will display a list of the rules you've set up.

**Step 8: Adjust Rules as Needed**

You can modify or delete rules as necessary. For example, if you need to
delete a rule:
```bash
sudo ufw delete RULE
```

Replace "RULE" with the rule you want to remove.

**Step 9: Reload UFW**

After making changes to UFW, reload it to apply the new rules:

```bash
sudo ufw reload
```

**Step 10: Additional Configuration**

Depending on your server's role and security requirements, you may


need to define more specific rules for services, applications, and network
access. Regularly review and update your rules as needed.

**Step 11: Test Your Configuration**

After configuring UFW, test it thoroughly to ensure it's not blocking


necessary services while enhancing your server's security.

Remember to adjust your UFW rules to meet the specific requirements


of your server, and regularly review and update them to maintain
security.
Conclusion: After performing the practical I understood the
installation of the firewall and its configuration on ubuntu machine

MARKS OBTAINED SIGN OF TEACHER


PROCESS PRODUCT TOTAL(25)
RELATED (10) RELATED(15)

You might also like