# Check rule creation

18. Create a new rule for port 8080. Verify that it has been added to the active rules and then you can delete it.

```sh
sudo ufw allow 8080
```

<figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-df6659cbe6f3f911d25dbffe6eca95ce28408885%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

```sh
sudo ufw status numbered
```

<figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-c921ff355ed13f751918cda2953a20101464ea8f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

To delete the rule, we must use the command:

```sh
sudo ufw delete num_rule
```

We check that it has been deleted

```sh
sudo ufw status numbered
```

&#x20;and we see the number of the next rule that needs to be deleted..

<figure><img src="https://3975474142-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvxQldFCzdjsw8BkClhdK%2Fuploads%2Fgit-blob-e616c9c06fe330b3a81fdf9cae07b6f4b2c6275d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Delete the new rule.

```sh
sudo ufw delete 5
```

We check that only the required rules in the subject remain:

```sh
sudo ufw status numbered
```
