+
+
+
+ The Firewall tab provides comprehensive firewall management for your virtual machine. You can enable or disable the firewall, create allow and block rules for network traffic, manage aliases for IP addresses and networks, and configure IP sets for advanced rule management.
+
+
+
+
+ Firewall Status
+
+
+
+ The firewall can be enabled or disabled using the toggle switch at the top of the Firewall tab. When enabled, all configured firewall rules will be active and enforced. When disabled, all traffic will be allowed by default.
+
+
+ - Enabled: All firewall rules are active and traffic is filtered according to your rules
+ - Disabled: All traffic is allowed, firewall rules are ignored
+
+
+
+
+
+ Firewall Rules
+
+
+
+ Firewall rules control which network traffic is allowed or blocked. Rules are processed in order from top to bottom, and the first matching rule determines the action taken.
+
+
+
Rule Actions
+
+
+
+ | Action |
+ Description |
+
+
+
+
+ | ACCEPT |
+ Allows the matching traffic to pass through |
+
+
+ | REJECT |
+ Blocks the traffic and sends a rejection response to the sender |
+
+
+ | DROP |
+ Silently blocks the traffic without sending a response |
+
+
+
+
+
Rule Parameters
+
+ - Source: IP address or network (CIDR notation) where traffic originates from (e.g.,
192.168.1.0/24)
+ - Destination: IP address or network (CIDR notation) where traffic is going to
+ - Protocol: Network protocol (TCP, UDP, ICMP, ICMPv6, or Any)
+ - Destination Port: Port number or range (e.g.,
80, 443, or 1000:2000)
+ - Source Port: Source port number or range
+ - Interface: Network interface name (e.g.,
net0) to apply the rule to
+ - Log Level: Optional logging level for matching traffic (info, warning, error, etc.)
+ - Comment: Optional description for the rule
+
+
+
Rule Order
+
+ Rules are processed in order from top to bottom. The first matching rule determines the action. It's important to place more specific rules before general ones. For example:
+
+
+ - Allow specific IP addresses first
+ - Then allow specific port ranges
+ - Finally, block or reject all other traffic
+
+
+
+
+
+ Aliases
+
+
+
+ Aliases allow you to create named references to IP addresses or networks. This makes firewall rules more readable and easier to maintain. Instead of typing IP addresses repeatedly, you can use an alias name.
+
+
+ Example: Create an alias named trusted-network for 192.168.1.0/24, then use trusted-network in your firewall rules instead of the full CIDR notation.
+
+
+ - Alias names must be unique
+ - CIDR notation is required (e.g.,
192.168.1.0/24)
+ - Aliases can be used in firewall rule source and destination fields
+
+
+
+
+
+ IP Sets
+
+
+
+ IP sets are collections of IP addresses or networks that can be referenced in firewall rules. They are useful for managing large lists of IP addresses, such as blocked IPs or allowed IPs for specific services.
+
+
+ Use Cases:
+
+
+ - Blocking multiple IP addresses from accessing your services
+ - Creating allow lists for specific applications
+ - Managing IP addresses that change frequently
+
+
+ Note: After creating an IP set, you can add individual IP addresses or networks to it through the API. IP sets can then be referenced in firewall rules using the set name.
+
+
+
+
+
+ Best Practices
+
+
+
+ - Default Deny: Start with a default deny policy and explicitly allow only necessary traffic
+ - Specific Rules First: Place more specific rules before general ones to ensure correct matching
+ - Use Aliases: Use aliases for frequently referenced networks to improve readability and maintenance
+ - Enable Logging: Enable logging on important rules to monitor traffic and troubleshoot issues
+ - Test Rules: Test new rules carefully to avoid accidentally blocking legitimate traffic
+ - Document Rules: Use comments to document the purpose of each rule
+ - Regular Review: Periodically review and clean up unused rules, aliases, and IP sets
+
+
+
+
+
+ Common Scenarios
+
+
+
Allow SSH from Specific IP
+
Action: ACCEPT
+Source: 192.168.1.100
+Protocol: TCP
+Destination Port: 22
+Comment: Allow SSH from office
+
+
Block All Traffic from a Network
+
Action: DROP
+Source: 10.0.0.0/8
+Comment: Block private network range
+
+
Allow Web Traffic on Ports 80 and 443
+
Action: ACCEPT
+Protocol: TCP
+Destination Port: 80,443
+Comment: Allow HTTP and HTTPS
+
+
+