Configuration
Configuration
keen-pbr reads its settings from one JSON config file.
Common config file locations:
- Keenetic / NetCraze:
/opt/etc/keen-pbr/config.json - OpenWrt:
/etc/keen-pbr/config.json - Debian:
/etc/keen-pbr/config.json
If you installed the full package, you can usually do your first setup in the Web UI and come back to this section later. Most users only need these four parts of the config:
- Outbounds — where matching traffic should go
- Lists — the sites or IP ranges you want to match
- Route Rules — which lists go through which outbound
- DNS — which DNS server should be used for those lists
Practical Example
This example routes google.com through vpn and leaves everything else on wan:
{
"outbounds": [
{
"type": "interface",
"tag": "vpn",
"interface": "tun0",
"gateway": "10.8.0.1",
"gateway6": "2001:db8::1"
},
{
"type": "interface",
"tag": "wan",
"interface": "eth0",
"gateway": "192.168.1.1"
}
],
"lists": {
"my_sites": {
"domains": ["google.com"]
}
},
"dns": {
"system_resolver": {
"address": "127.0.0.1"
},
"servers": [
{
"tag": "vpn_dns",
"address": "10.8.0.1",
"detour": "vpn"
},
{
"tag": "default_dns",
"address": "1.1.1.1"
}
],
"rules": [
{
"list": ["my_sites"],
"server": "vpn_dns"
}
],
"fallback": ["default_dns"]
},
"route": {
"rules": [
{
"list": ["my_sites"],
"outbound": "vpn"
}
]
}
}Basic Configuration
- Outbounds — choose the VPN and normal internet connections
- Lists — define the sites, domains, or IP ranges to match
- Route Rules — connect each list to an outbound
- DNS — make sure matching domains are resolved through the right DNS server
Advanced Configuration
These settings are optional for most users:
- Advanced — API, service paths, automatic list refresh, and low-level routing options
- Full Reference Config — commented config example with every supported config option
List names, outbound tags, and DNS server tags must all follow the same convention:
^[a-z][a-z0-9_]*$ and must be at most 24 characters.