Restrict Network Access Using Firewall-CMD/Firewall

LinuxLinuxBeginner
Practice Now

Introduction

In this challenge, you will learn how to manage basic networking and restrict network access using the firewall-cmd and firewall commands in a Linux system. You will configure a firewall to allow or block specific network traffic, ensuring secure access to your system.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/BasicSystemCommandsGroup(["`Basic System Commands`"]) linux/BasicSystemCommandsGroup -.-> linux/echo("`Text Display`") subgraph Lab Skills linux/echo -.-> lab-389473{{"`Restrict Network Access Using Firewall-CMD/Firewall`"}} end

Configure a Firewall Rule to Allow SSH Access

Tasks

  • Create a firewall rule to allow SSH access to the system.
  • Verify that the firewall rule is correctly applied and SSH access is allowed.

Requirements

  • The firewall rule must be created using the firewall-cmd command.
  • The firewall rule must allow SSH access (port 22) to the system.
  • The firewall rule must be made permanent, so that it persists after a system reboot.

Example

After configuring the firewall rule, you should be able to connect to the system via SSH without any issues.

Configure a Firewall Rule to Block a Specific IP Address

Tasks

  • Create a firewall rule to block network traffic from a specific IP address.
  • Verify that the firewall rule is correctly applied and the specified IP address is blocked.

Requirements

  • The firewall rule must be created using the firewall command.
  • The firewall rule must block network traffic from the IP address 192.168.1.100.
  • The firewall rule must be made permanent, so that it persists after a system reboot.

Example

After configuring the firewall rule, any attempt to access the system from the IP address 192.168.1.100 should be blocked.

Summary

In this challenge, you learned how to manage basic networking and restrict network access using the firewall-cmd and firewall commands in a Linux system. You configured firewall rules to allow SSH access and block a specific IP address, ensuring secure access to your system. These skills are essential for system administrators to maintain the security and integrity of their Linux environments.

Other Linux Tutorials you may like