{{-- Global Loader Styles --}}
{{-- Page Header --}}
{{-- Error Modal --}} @if($error && $showErrorModal)

{{ $error }}

Close
@endif {{-- Main Firewall Toggle & Status --}}
{{-- Decorative elements --}}

Master Firewall Control

@if($firewallEnabled) Active - Your VM is protected @else Disabled - No firewall protection @endif

@if($firewallEnabled) Disable Disabling... @else Enable Firewall Enabling... @endif
{{-- Firewall Policies & Network Adapters Grid --}} @if($firewallEnabled)
{{-- Default Policies Card --}}

Default Policies

Control default traffic behavior

Update Policies Updating...
{{-- Network Adapters --}}

Network Adapters

Per-device firewall control

@if(count($networkAdapters) > 0)
@foreach($networkAdapters as $adapter)
{{ $adapter['name'] }} {{ ($adapterFirewallStates[$adapter['name']] ?? false) ? 'Active' : 'Off' }}
{{ ucfirst($adapter['model'] ?? 'Unknown') }} @if($adapter['mac']) {{ $adapter['mac'] }} @endif
@if($adapterFirewallStates[$adapter['name']] ?? false) Disable ... @else Enable ... @endif
@endforeach
@else @endif
{{-- Policy Info Modal --}} @if($showPolicyInfoModal)

Understanding Firewall Policies

How default policies control your network traffic

Policy In (Incoming Traffic)

Controls what happens to traffic coming INTO your VM when it doesn't match any explicit firewall rule.

  • ACCEPT: Allow all incoming traffic by default (permissive, requires explicit DENY rules)
  • REJECT: Block incoming traffic and send rejection notification to sender
  • DROP: Silently discard incoming traffic without notifying sender (recommended)

Policy Out (Outgoing Traffic)

Controls what happens to traffic going OUT of your VM when it doesn't match any explicit firewall rule.

  • ACCEPT: Allow all outgoing traffic by default (recommended for most VMs)
  • REJECT: Block outgoing traffic and notify your VM
  • DROP: Silently discard outgoing traffic

Creating a Whitelist Configuration

To create a strict whitelist (only allow specific traffic):

  1. Set Policy In to DROP
  2. Set Policy Out to DROP (if restricting outbound)
  3. Create explicit ACCEPT rules for allowed traffic
  4. Everything not explicitly allowed will be blocked

Additional Filters

IP Filter: Validates that source/destination IP addresses in packets match the VM's assigned IPs. Helps prevent IP spoofing.

MAC Filter: Validates that MAC addresses match the VM's network adapters. Provides additional layer of security.

@endif {{-- Tabs Navigation --}}
{{-- Tab Contents --}}
{{-- RULES TAB --}}

Firewall Rules

@if(count($rules) > 0)
@foreach($rules as $index => $rule) @endforeach
Order Pos Action Direction Source Destination Protocol Ports Status Actions
@if($index > 0) @else
@endif @if($index < count($rules) - 1) @else
@endif
{{ $rule['pos'] ?? '-' }} @php $actionClass = match($rule['action'] ?? '') { 'ACCEPT' => 'bg-success/20 text-success', 'REJECT' => 'bg-warning/20 text-warning', 'DROP' => 'bg-error/20 text-error', default => 'bg-base/20 text-base/60' }; @endphp {{ $rule['action'] ?? '-' }} {{ strtoupper($rule['type'] ?? 'IN') }}
{{ $rule['source'] ?? '-' }} @php $ruleSourceIP = $rule['source'] ?? ''; @endphp @if($ruleSourceIP && $ruleSourceIP !== '-' && $this->checkIsPublicIP($ruleSourceIP))
{{-- IP Location Modal (same as logs) --}}
@endif
{{ $rule['dest'] ?? '-' }} @php $ruleDestIP = $rule['dest'] ?? ''; @endphp @if($ruleDestIP && $ruleDestIP !== '-' && $this->checkIsPublicIP($ruleDestIP))
{{-- IP Location Modal (same structure) --}}
@endif
{{ strtoupper($rule['proto'] ?? ($rule['macro'] ?? 'ANY')) }} {{ $rule['dport'] ?? $rule['sport'] ?? '-' }} @if(isset($rule['enable']) && $rule['enable'] == 0) Disabled @else Enabled @endif
@else

No Firewall Rules

Create your first rule to control network traffic

@endif
{{-- ALIASES TAB --}}

IP Aliases

Create named references to IP addresses or CIDR ranges

@if(count($aliases) > 0)
@foreach($aliases as $alias)
{{ $alias['name'] }}
{{ $alias['cidr'] }}
@if(!empty($alias['comment']))
{{ $alias['comment'] }}
@endif
@endforeach
@else

No IP Aliases

Create aliases to simplify rule management

@endif
{{-- IPSETS TAB --}}

IP Sets

Group multiple IPs/CIDRs for easier rule management

{{-- IPSets List --}}

Available IP Sets

@if(count($ipsets) > 0)
@foreach($ipsets as $ipset)
{{ $ipset['name'] }}
@if(!empty($ipset['comment']))
{{ $ipset['comment'] }}
@endif
@endforeach
@else

No IP Sets created yet

@endif
{{-- IPSet Members --}}
@if($selectedIPSetName)

Members of: {{ $selectedIPSetName }}

@if(count($ipsetMembers) > 0)
@foreach($ipsetMembers as $member)
{{ $member['cidr'] }}
@if(!empty($member['comment']))
{{ $member['comment'] }}
@endif @if(isset($member['nomatch']) && $member['nomatch']) No Match @endif
@endforeach
@else

No members in this IPSet

@endif @else

Select an IP Set to view its members

@endif
{{-- LOGS TAB --}}

Firewall Logs

Showing the latest logs first (most recent at top)

@if($lastLogRefresh) • Last updated: {{ $lastLogRefresh }} @endif • Auto-refreshes every 30s
@if(!empty($logError))

{{ $logError }}

@endif @if(!$logsLoaded && count($firewallLogs) === 0)

Loading firewall logs...

@elseif(count($firewallLogs) > 0)
@foreach($this->paginatedLogs as $log) @endforeach
Time Action Source Destination Protocol Src Port Dest Port Analysis
@if(isset($log['timestamp_iso']) && $log['timestamp_iso'] !== '-')
@else {{ $log['timestamp_display'] ?? $log['timestamp'] ?? '-' }} @endif
{{ $log['action'] ?? '-' }}
{{ $log['source'] ?? '-' }} @php $sourceIP = $log['source'] ?? ''; @endphp @if($sourceIP && $sourceIP !== '-' && $this->checkIsPublicIP($sourceIP))
{{-- IP Location Modal --}}
@endif
{{ $log['destination'] ?? '-' }} @php $destIP = $log['destination'] ?? ''; @endphp @if($destIP && $destIP !== '-' && $this->checkIsPublicIP($destIP))
{{-- IP Location Modal --}}
@endif
{{ $log['protocol'] ?? '-' }} {{ $log['source_port'] ?? '-' }} {{ $log['destination_port'] ?? '-' }} @php $sourceIP = $log['source'] ?? ''; $destIP = $log['destination'] ?? ''; $sourcePort = $log['source_port'] ?? ''; $destPort = $log['destination_port'] ?? ''; $protocol = $log['protocol'] ?? ''; @endphp @if($coreRouterConfigured && $sourceIP && $sourceIP !== '-')
{{-- Network Analysis Modal --}}
@endif
{{-- Pagination Controls --}}
{{-- Records per page selector --}}
per page
{{-- Page info and navigation --}}
Showing {{ (($currentPage - 1) * $perPage) + 1 }} - {{ min($currentPage * $perPage, count($firewallLogs)) }} of {{ count($firewallLogs) }} logs
{{-- First page --}} {{-- Previous page --}} {{-- Page numbers --}} @php $totalPages = $this->totalPages; $startPage = max(1, $currentPage - 2); $endPage = min($totalPages, $currentPage + 2); @endphp @if($startPage > 1) @if($startPage > 2) ... @endif @endif @for($i = $startPage; $i <= $endPage; $i++) @endfor @if($endPage < $totalPages) @if($endPage < $totalPages - 1) ... @endif @endif {{-- Next page --}} {{-- Last page --}}
@else

No Firewall Logs

Logs will appear here when the firewall blocks or allows traffic

@endif
{{-- SAVED CONFIGURATIONS TAB --}}

Saved Configurations

Save and reuse firewall configurations across your VPS instances

{{-- Apply to All Button --}} {{-- Save Current Configuration Button --}}
@if(count($savedConfigurations) > 0)
@foreach($savedConfigurations as $config) @endforeach
Configuration Name Rules Policies Created Actions
{{ $config['configuration_name'] }}
{{ is_array($config['firewall_rules']) ? count($config['firewall_rules']) : 0 }} rules
IN: {{ $config['incoming_policy'] }} OUT: {{ $config['outgoing_policy'] }}
{{ \Carbon\Carbon::parse($config['created_at'])->format('M d, Y H:i') }}
@else

No Saved Configurations

Save your current firewall configuration to reuse it later or apply it to other VPS instances

@endif
@else

Firewall Protection Disabled

Your virtual machine is currently unprotected. Enable the firewall above to secure your network traffic with customizable rules.

Traffic Control

Define rules to allow or block specific connections

Monitor Activity

Track and log all firewall events in real-time

Flexible Policies

Configure default behavior for incoming and outgoing traffic

@endif {{-- Rule Form Modal --}} @if($showRuleForm)

{{ $editingRuleIndex !== null ? 'Edit' : 'Create' }} Firewall Rule

{{-- Action --}}
{{-- Type --}}
{{-- Macro --}}

Selecting a macro will automatically set the protocol and port(s)

{{-- Interface --}}
{{-- Source --}}

Can use alias names or leave empty for any source

{{-- Destination --}}
{{-- Protocol --}}
{{-- Destination Port --}}
{{-- Source Port --}}
{{-- Log Level --}}
{{-- Comment --}}
{{-- Enable --}}
@endif {{-- Delete Rule Modal --}} @if($showDeleteRuleModal && $deletingRuleIndex !== null && isset($rules[$deletingRuleIndex])) @php $ruleToDelete = $rules[$deletingRuleIndex]; @endphp

Delete Firewall Rule

Are you sure you want to delete this rule? This action cannot be undone.

Action: {{ $ruleToDelete['action'] ?? '-' }}
Source: {{ $ruleToDelete['source'] ?? 'Any' }}
Destination: {{ $ruleToDelete['dest'] ?? 'Any' }}
Cancel Delete Rule Deleting...
@endif {{-- Alias Form Modal --}} @if($showAliasForm)

{{ $editingAliasName ? 'Edit' : 'Create' }} IP Alias

@error('aliasName') {{ $message }} @enderror
@error('aliasCidr') {{ $message }} @enderror
@endif {{-- Delete Alias Modal --}} @if($showDeleteAliasModal && $deletingAliasName)

Delete IP Alias

Delete alias "{{ $deletingAliasName }}"?

This may affect firewall rules using this alias.

Cancel Delete Deleting...
@endif {{-- IPSet Form Modal --}} @if($showIPSetForm)

Create IP Set

@error('ipsetName') {{ $message }} @enderror

After creating the IPSet, you can add IP addresses and CIDR ranges to it.

@endif {{-- Delete IPSet Modal --}} @if($showDeleteIPSetModal && $deletingIPSetName)

Delete IP Set

Delete IPSet "{{ $deletingIPSetName }}"?

All members will be removed and rules using this IPSet may be affected.

Cancel Delete Deleting...
@endif {{-- IPSet Member Form Modal --}} @if($showIPSetMemberForm && $selectedIPSetName)

Add IP/CIDR to {{ $selectedIPSetName }}

@error('memberCidr') {{ $message }} @enderror
@endif {{-- Delete IPSet Member Modal --}} @if($showDeleteIPSetMemberModal && $deletingMemberCidr)

Remove Member

Remove "{{ $deletingMemberCidr }}" from {{ $selectedIPSetName }}?

Cancel Remove Removing...
@endif
{{-- Save Configuration Modal --}} @if($showSaveConfigModal)

Save Current Configuration

Save your current firewall rules and policies as a reusable configuration

@error('newConfigName')

{{ $message }}

@enderror

Configuration Summary

Rules {{ count($rules) }}
Incoming Policy {{ $policyIn }}
Outgoing Policy {{ $policyOut }}
@endif {{-- View Configuration Modal --}} @if($showViewConfigModal && $viewingConfiguration)

{{ $viewingConfiguration->configuration_name }}

Created on {{ $viewingConfiguration->created_at->format('M d, Y H:i') }}

{{-- Policies --}}

Traffic Policies

Incoming Traffic {{ $viewingConfiguration->incoming_policy }}
Outgoing Traffic {{ $viewingConfiguration->outgoing_policy }}
{{-- Compatibility Warnings --}} @if(count($configCompatibilityIssues) > 0)

Compatibility Issues

The following rules may not be compatible with this VPS:

    @foreach($configCompatibilityIssues as $issue)
  • • Rule #{{ $issue['rule_index'] + 1 }}: {{ implode(', ', $issue['issues']) }}
  • @endforeach
@endif {{-- Rules --}}

Firewall Rules ({{ count($viewingConfiguration->firewall_rules) }})

@if(count($viewingConfiguration->firewall_rules) > 0)
@foreach($viewingConfiguration->firewall_rules as $index => $rule) @php $hasIssue = collect($configCompatibilityIssues)->contains('rule_index', $index); @endphp @endforeach
# Action Direction Source Destination Protocol Port Status
{{ $index + 1 }} {{ $rule['action'] ?? 'ACCEPT' }} {{ strtoupper($rule['type'] ?? '-') }} {{ $rule['source'] ?? 'any' }} {{ $rule['dest'] ?? 'any' }} {{ $rule['proto'] ?? '-' }} {{ $rule['dport'] ?? '-' }} @if($hasIssue) Incompatible @elseif(isset($rule['enable']) && $rule['enable'] == 0) Disabled @else Enabled @endif
@else

No rules in this configuration

@endif
@endif {{-- Apply Configuration Modal --}} @if($showApplyConfigModal && $applyingConfiguration)

Apply Configuration

Apply "{{ $applyingConfiguration->configuration_name }}" to this VPS

Warning

This will replace all existing firewall rules with the rules from this configuration. This action cannot be undone.

@if(count($applyCompatibilityWarnings) > 0)

Compatibility Notice

{{ count($applyCompatibilityWarnings) }} rule(s) in this configuration are not fully compatible with this VPS and will be disabled.

@endif

Configuration Details

Rules

{{ count($applyingConfiguration->firewall_rules) }}

IN Policy

{{ $applyingConfiguration->incoming_policy }}

OUT Policy

{{ $applyingConfiguration->outgoing_policy }}

@endif {{-- Delete Configuration Modal --}} @if($showDeleteConfigModal && $deletingConfigId)

Delete Configuration

Are you sure you want to delete this saved configuration? This action cannot be undone.

Cancel Delete Deleting...
@endif {{-- Apply to All Servers Modal --}} @if($showApplyToAllModal)

Apply to All Servers

Apply the current firewall configuration to all your other VPS instances.

@php $otherServers = $this->getUserOtherServers(); @endphp @if(count($applyToAllResults) > 0) {{-- Show Results --}}

Results

@foreach($applyToAllResults as $result)
@if($result['success']) @else @endif {{ $result['hostname'] }}
{{ $result['message'] }}
@endforeach
@else {{-- Show Confirmation --}}

Warning

This will replace the firewall configuration on all your other servers. Existing rules will be deleted and replaced with the current configuration.

@if(count($otherServers) > 0)

Servers to Update ({{ count($otherServers) }})

@foreach($otherServers as $otherServer)
{{ $otherServer['hostname'] ?? 'VPS ' . $otherServer['vm_id'] }} VM {{ $otherServer['vm_id'] }}
@endforeach

Configuration to Apply

Rules: {{ count($rules) }}
Policy In: {{ $policyIn }}
Policy Out: {{ $policyOut }}
@else

No other servers found to apply the configuration to.

@endif
@if(count($otherServers) > 0) @endif
@endif
@endif {{-- Rename Configuration Modal --}} @if($showRenameConfigModal && $renamingConfigId)

Rename Configuration

Enter a new name for this configuration

@error('renameConfigName')

{{ $message }}

@enderror
@endif @script @endscript