A Windows Forms application for managing Windows Firewall rules with an intuitive graphical interface.
Firewall Port Manager is a desktop application that provides an easy-to-use interface for managing Windows Firewall rules. It allows users to view, add, edit, and delete firewall rules without needing to use the command line or navigate through complex Windows settings.
- Tabbed Interface: Separate tabs for Inbound and Outbound rules
- Profile Filtering: Filter rules by Windows Firewall profiles (Domain, Private, Public)
- Search & Filter: Search by port number or rule name, filter by action (Allow/Block)
- Rule Management: Add, edit, delete, and refresh firewall rules
- Modern UI: Clean, intuitive interface with color-coded buttons
- Status Monitoring: Real-time firewall status display
- Template Support: Pre-configured rule templates for common scenarios
- Operating System: Windows 7 or later
- .NET Framework: 4.0 or higher
- Privileges: Administrator rights required for firewall management
- Screen Resolution: Minimum 1024x768 (optimized for low resolution screens)
- Go to the Releases page
- Download the latest
FirewallPortManager.exe - Run as Administrator
- Clone the repository:
git clone https://github.com/yourusername/FirewallPortManager.git
- Open
FirewallPortManager.csprojin Visual Studio - Build the solution (Ctrl+Shift+B)
- Run the executable from
bin/Debug/orbin/Release/
- Right-click on
FirewallPortManager.exe - Select "Run as administrator"
- The main interface will open showing current firewall rules
- Click the Add Rule button (blue)
- Fill in the rule details:
- Rule Name: Descriptive name for the rule
- Port: Port number or range (e.g., 80, 8080-8090)
- Protocol: TCP or UDP
- Direction: Inbound or Outbound
- Action: Allow or Block
- Description: Optional description
- Click OK to save
- Select a rule from the list
- Click the Edit Rule button (green)
- Modify the desired fields
- Click OK to save changes
- Select a rule from the list
- Click the Delete Rule button (red)
- Confirm the deletion
- Profile Filter: Use the dropdown to filter by firewall profile
- Search: Type port number or rule name in the search box
- Action Filter: Filter by Allow/Block actions
- Clear: Reset all filters
FirewallPortManager/
├── Forms/
│ ├── MainForm.cs # Main application window
│ ├── AddRuleForm.cs # Add new rule dialog
│ └── EditRuleForm.cs # Edit existing rule dialog
├── Models/
│ ├── FirewallRule.cs # Firewall rule data model
│ └── RuleTemplate.cs # Rule template model
├── Services/
│ ├── FirewallService.cs # Windows Firewall API integration
│ ├── FilterService.cs # Rule filtering logic
│ ├── ListViewService.cs # ListView management
│ ├── UIStateManager.cs # UI state management
│ ├── RuleBuilderService.cs # Rule creation logic
│ ├── RuleValidationService.cs # Input validation
│ ├── RuleManagementService.cs # CRUD operations
│ └── ConfigurationService.cs # Application configuration
├── Utils/
│ ├── AdminHelper.cs # Administrator privilege checks
│ ├── Constants.cs # Application constants
│ └── PortHelper.cs # Port validation utilities
├── sample_rules.json # Sample rule templates (JSON)
├── sample_rules.xml # Sample rule templates (XML)
└── logo.ico # Application icon
The application supports rule templates in both JSON and XML formats:
JSON Format (sample_rules.json):
{
"templates": [
{
"name": "Web Server (HTTP)",
"port": "80",
"protocol": "TCP",
"direction": "Inbound",
"action": "Allow",
"description": "Allow HTTP traffic"
}
]
}XML Format (sample_rules.xml):
<RuleTemplates>
<Template>
<Name>Web Server (HTTP)</Name>
<Port>80</Port>
<Protocol>TCP</Protocol>
<Direction>Inbound</Direction>
<Action>Allow</Action>
<Description>Allow HTTP traffic</Description>
</Template>
</RuleTemplates>- Visual Studio 2017 or later
- .NET Framework 4.0 SDK
- Windows SDK
# Restore NuGet packages
dotnet restore
# Build the project
dotnet build
# Build for release
dotnet build --configuration Release- System.Windows.Forms: UI framework
- vocaluxe.dependencies.netfwtypelib: Windows Firewall API access
- Administrator Rights: Required for firewall rule management
- UAC Prompt: Application will request elevation on startup
- Firewall Access: Direct integration with Windows Firewall API
- Input Validation: All user inputs are validated before processing
"Access Denied" Error
- Ensure the application is running as Administrator
- Check Windows Firewall service is running
Rules Not Displaying
- Verify Windows Firewall is enabled
- Check firewall profile settings
- Try refreshing the rule list
Build Errors
- Ensure .NET Framework 4.0 is installed
- Restore NuGet packages
- Check RuntimeIdentifier configuration
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: Project Wiki
- v1.0.0 - Initial release
- Basic firewall rule management
- Tabbed interface for Inbound/Outbound rules
- Profile filtering and search functionality
- Windows Firewall API documentation
- .NET Framework community
- Contributors and testers