| 276 | Another way to specify which rule you want to delete is by providing the rule ID. This information can be obtained with the following command: |
| 277 | {{{ |
| 278 | sudo ufw status numbered |
| 279 | }}} |
| 280 | |
| 281 | {{{ |
| 282 | Output |
| 283 | Status: active |
| 284 | |
| 285 | To Action From |
| 286 | -- ------ ---- |
| 287 | [ 1] Anywhere DENY IN 203.0.113.100 |
| 288 | [ 2] Anywhere on eth0 ALLOW IN 203.0.113.102 |
| 289 | }}} |
| 290 | |
| 291 | From the output, you can see that there are two active rules. The first rule, with highlighted values, denies all connections coming from the IP address 203.0.113.100. The second rule allows connections on the eth0 interface coming in from the IP address 203.0.113.102. |
| 292 | |
| 293 | Because by default UFW already blocks all external access unless explicitly allowed, the first rule is redundant, so you can remove it. To delete a rule by its ID, run: |
| 294 | {{{ |
| 295 | sudo ufw delete 1 |
| 296 | }}} |
| 297 | You will be prompted to confirm the operation and to make sure the ID you’re providing refers to the correct rule you want to delete. |
| 298 | {{{ |
| 299 | Output |
| 300 | Deleting: |
| 301 | deny from 203.0.113.100 |
| 302 | Proceed with operation (y|n)? y |
| 303 | Rule deleted |
| 304 | }}} |
| 305 | |
| 306 | '''List Available Application Profiles''' |
| 307 | |
| 308 | Upon installation, applications that rely on network communications will typically set up a UFW profile that you can use to allow connection from external addresses. This is often the same as running '''''ufw allow from''''', with the advantage of providing a shortcut that abstracts the specific port numbers a service uses and provides a user-friendly nomenclature to referenced services. |
| 309 | |
| 310 | To list which profiles are currently available, run the following; |
| 311 | {{{ |
| 312 | sudo ufw app list |
| 313 | }}} |
| 314 | |
| 315 | '''Enable Application Profile''' |