NetXFW provides a unified service that integrates Web interface, API interface, and metrics monitoring into a single service.
//api/* path/metrics pathGET / -> Web UI
GET /api/stats -> Statistics
GET /api/rules -> Rule Management
GET /api/config -> Configuration Management
GET /api/sync -> Sync Operations
GET /api/conntrack -> Connection Tracking
GET /metrics -> Prometheus Metrics
In config.yaml, you can control service behavior with the following configuration:
web:
enabled: true
port: 11811
token: "auto-generated" # Auto-generated or manually specified
metrics:
enabled: true # Enable metrics collection
server_enabled: false # If false, provide metrics on web server
port: 11812 # Independent metrics server port
When metrics.server_enabled is false, metrics are provided on the web server’s /metrics path.
When metrics.server_enabled is true, metrics are provided on an independent server.
| Metric Name | Type | Description |
|————-|——|————-|
| netxfw_packets_total | Counter | Total packets processed |
| netxfw_packets_passed | Counter | Packets passed |
| netxfw_packets_dropped | Counter | Packets dropped |
| netxfw_drop_blacklist | Counter | Dropped by blacklist |
| netxfw_drop_rate_limit | Counter | Dropped by rate limit |
| netxfw_pass_whitelist | Counter | Passed by whitelist |
| Metric Name | Type | Description |
|————-|——|————-|
| netxfw_blacklist_count | Gauge | Blacklist entry count |
| netxfw_whitelist_count | Gauge | Whitelist entry count |
| netxfw_conntrack_count | Gauge | Connection tracking count |
| netxfw_rule_count | Gauge | IP+Port rule count |
| Metric Name | Type | Description |
|————-|——|————-|
| netxfw_uptime_seconds | Gauge | Service uptime |
| netxfw_config_version | Gauge | Configuration version |
Add the following to your prometheus.yml:
scrape_configs:
- job_name: 'netxfw'
static_configs:
- targets: ['localhost:11811']
metrics_path: '/metrics'
NetXFW provides a pre-built Grafana dashboard for visualizing metrics:
contrib/grafana-dashboard.jsonFor production deployment, enable TLS:
web:
enabled: true
port: 11811
tls:
enabled: true
cert_file: /path/to/cert.pem
key_file: /path/to/key.pem