Configurando a Rede Local - Curso Firewall OPNsense

3 min read 4 hours ago
Published on Nov 16, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial is designed to guide you through the process of configuring a local network using OPNsense, a popular open-source firewall solution. Whether you're setting up a home network or managing a small business, understanding how to configure OPNsense can enhance your network security and performance.

Step 1: Initial Setup of OPNsense

  • Download the OPNsense installation image from the official website.
  • Create a bootable USB drive using tools like Rufus or Etcher.
  • Boot your system from the USB drive and follow the installation prompts:
    • Select the appropriate disk for OPNsense installation.
    • Configure basic settings such as language and keyboard layout.
    • Set up the admin password for access to the OPNsense dashboard.

Step 2: Accessing the OPNsense Dashboard

  • After installation, connect to the OPNsense device using a web browser.
  • Enter the default IP address (usually 192.168.1.1) in the address bar.
  • Log in using the admin credentials you set during installation.

Step 3: Configuring Interfaces

  • Navigate to the Interfaces menu in the dashboard.
  • Configure the WAN (Wide Area Network) and LAN (Local Area Network) interfaces:
    • For WAN:
      • Set the connection type (DHCP or static).
      • If static, enter the IP address, subnet mask, and gateway details.
    • For LAN:
      • Set a static IP address for your local network.
      • Define the subnet mask (e.g., 255.255.255.0).

Step 4: Setting Up DHCP Server

  • Go to Services > DHCP Server.
  • Enable the DHCP server for the LAN interface:
    • Define the range of IP addresses that can be assigned to devices.
    • Set the default gateway and DNS servers for network clients.
  • Save your settings and apply the changes.

Step 5: Configuring Firewall Rules

  • Navigate to Firewall > Rules.
  • Select the LAN tab to create rules that control traffic:
    • Click "Add" to create a new rule.
    • Set the following parameters:
      • Action: Pass
      • Interface: LAN
      • Source: LAN net
      • Destination: Any
    • Save and apply the changes to allow traffic from the LAN to the internet.

Step 6: Testing the Configuration

  • Connect a device to the LAN network and check for internet connectivity.
  • Use the command prompt to ping a public IP address (e.g., 8.8.8.8) to verify the connection.
  • If there are issues, revisit the firewall rules and interface settings for corrections.

Conclusion

You have successfully configured a local network using OPNsense. This setup includes basic interface configuration, DHCP server setup, and firewall rules to ensure secure connectivity. For advanced configurations, consider exploring topics like VPN setup, logging, and monitoring. Keep practicing to enhance your network management skills!