Default settings
Overview
Creating a software routed access point (AP) requires the installation and setup of several related Linux services. RaspAP uses a known-good default configuration as a starting point. This facilitates a faster setup by not prompting the user for various network settings during the installation. More importantly, it eliminates guesswork that can lead to conflicts down the road. When the manual or quick installation is completed, you will have a functional AP that you may then administer with RaspAP's web interface.
While this project handles every facet of this process for you, it's still recommended that users familiarize themselves with the steps involved in building a software AP from start to finish.
Configuration directory
To every extent possible, RaspAP's default settings are contained within the project's /config folder. The networking defaults, DNS servers, wireless regulatory data and so on are found here.
In this way, the user may modify RaspAP's baseline application settings without touching code.
The exception to this is hostapd.conf which is effectively rewritten depending on user input. This is due to the complexity of this configuration relative to other services managed by the project. The settings applied for each wireless mode (802.11 b/g/a/n/ac/ax/be) are themselves defined in the hostapd section of defaults.json, described below.
Tip
RaspAP has a mechanism that lets advanced users create their own custom hostapd configuration. These custom user settings are managed outside of RaspAP and are unmodified by the application.
Baseline configurations for dhcpcd and dnsmasq (described below) are contained here, along with bridged AP configurations, ad blocking lists (blocklists.json), firewall rules (iptables_rules.json) and client device prototypes (client_udev_prototypes.json).
Managing config values
The interface itself, default Linux file paths, and so on may be changed by modifying the project's configuration file config.php.
Note
The file config/config.php is copied during the installation to includes/config.php and ignored by Git. This way, users can modify includes/config.php without git pull or upgrades complaining about local changes. The file includes/defaults.php loads corresponding default values if they are not set.
Customizing the interface
RaspAP's interface may be fully rebranded by modifying includes/config.php. The brand text, page title, logo and theme color can each be changed without touching code:
define('RASPI_BRAND_TEXT', 'RaspAP');
define('RASPI_BRAND_TITLE', RASPI_BRAND_TEXT.' Admin Panel');
define('RASPI_BRAND_ICON', '');
define('RASPI_BRAND_COLOR', '#2b8080');
define('RASPI_UI_STATIC_LOGO', false);
| Constant | Description |
|---|---|
RASPI_BRAND_TEXT |
Name displayed in the navbar header and on the login page. |
RASPI_BRAND_TITLE |
Browser tab title. Defaults to the brand text followed by "Admin Panel". |
RASPI_BRAND_ICON |
Logo displayed in the navbar and on the login page. Leave empty to use the default RaspAP logo. Set it to an image path or URL (for example, app/img/mylogo.png) or to a Font Awesome class such as fas fa-wifi. Font Awesome icons inherit the theme color. |
RASPI_BRAND_COLOR |
Default theme color. Accepts hex, rgb(), rgba() or named CSS colors. Invalid values fall back to #2b8080. |
RASPI_UI_STATIC_LOGO |
Set to true to disable the animated wireless "pulse" of the default logo on the login page. |
Note
A color selected in System > Theme is stored in a browser cookie and overrides RASPI_BRAND_COLOR for that browser.
RaspAP's interface may be further customized by enabling or disabling optional services with the following values:
// Optional services, set to true to enable.
define('RASPI_WIFICLIENT_ENABLED', true);
define('RASPI_HOTSPOT_ENABLED', true);
define('RASPI_NETWORK_ENABLED', true);
define('RASPI_DHCP_ENABLED', true);
define('RASPI_ADBLOCK_ENABLED', false);
define('RASPI_OPENVPN_ENABLED', false);
define('RASPI_VPN_PROVIDER_ENABLED', false);
define('RASPI_WIREGUARD_ENABLED', false);
define('RASPI_TORPROXY_ENABLED', false);
define('RASPI_CONFAUTH_ENABLED', true);
define('RASPI_CHANGETHEME_ENABLED', true);
define('RASPI_VNSTAT_ENABLED', true);
define('RASPI_SYSTEM_ENABLED', true);
define('RASPI_MONITOR_ENABLED', false);
define('RASPI_RESTAPI_ENABLED', false);
define('RASPI_PLUGINS_ENABLED', true);
Authentication for the web interface is controlled by RASPI_AUTH_ENABLED. RASPI_AUTH_GRACE_LOGINS sets the number of logins allowed with the default admin password before a password change is required, and RASPI_SESSION_TIMEOUT sets the period of inactivity, in seconds, after which a session expires.
The constants defined for Linux configuration file paths are typical and needn't be changed, in most cases. However, you could easily do so simply by modifying this file.
Networking defaults
The default AP interface used by RaspAP is wlan0. This is a typical setting if you are using the RPi's onboard wireless adapter. You can change this to a different interface by modifying
the following value in config.php:
Tip
If a second wireless adapter is configured for your device, for example bound to the wlan1 interface, RaspAP will automatically detect it and assign it as the default wireless client interface. You may change this setting simply by selecting wlan1 as the AP interface in the Hotspot > Basic panel. After restarting the hotspot, RaspAP will use wlan0 as the client interface.
Default values for the dnsmasq and dhcpcd services can be modified as well. The file config/defaults.json was introduced with the version 2.6 release. This file is copied during the installation to /etc/raspap/networking/, so any changes to it must be made at this location.
The defaults.json file uses the standard JSON data-interchange format. For example, the default dhcp settings for wlan0 are displayed below:
"dhcp": {
"wlan0": {
"static ip_address": [ "10.3.141.1" ],
"static routers": [ "10.3.141.1" ],
"static domain_name_servers": [ "1.1.1.1 8.8.8.8" ],
"subnetmask": [ "255.255.255.0" ]
}
Likewise, the DHCP ranges for both wlan0 and the virtual uap0 interface are shown below:
"dnsmasq": {
"wlan0": {
"dhcp-range": [ "10.3.141.50,10.3.141.254,255.255.255.0,12h" ]
},
"uap0": {
"dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ]
}
Defaults are also provided for the wlan1, wlan2 and eth0 interfaces, as well as enx and wlx entries which apply to USB adapters named after their MAC address (for example, wlx00c0ca123456).
In addition to dhcp and dnsmasq, defaults.json contains the following sections:
| Section | Description |
|---|---|
hostapd |
Settings applied for each wireless mode (802.11 b/g/a/n/ac/ax/be). |
wireguard |
Default WireGuard server and peer values. |
txpower |
Transmit power options, in dBm. |
These default settings are defined as fallback values. That is, if a user-defined value is missing these will be used in their place.
DNS servers
The list of hosted DNS servers available in the Upstream DNS servers panel in DHCP > Advanced may be modified to suit your needs. The file config/dns-servers.json in RaspAP's web root (for example, /var/www/html/config/dns-servers.json) contains
a JSON formatted collection of hostnames and IPv4 addresses, like so:
"Google": [
"8.8.4.4",
"8.8.8.8"
],
"OpenDNS": [
"208.67.220.220",
"208.67.222.222"
],
"Quad9": [
"9.9.9.9",
"149.112.112.112"
],
Edits to this file in place will immediately be reflected in the user interface.
VPN providers
RaspAP version 3.0 introduced support for a select number of VPN providers. These services are largely defined in the config/vpn-providers.json file. An example provider definition is shown below:
"id": 1,
"name": "ExpressVPN",
"bin_path": "/usr/bin/expressvpn",
"install_page": "https://www.expressvpn.com/support/vpn-setup/app-for-linux/",
"account_page": "https://www.expressvpn.com/subscriptions",
"cmd_overrides": {
"countries": "list all",
"log": "diagnostics",
"version": "-v"
},
"regex": {
"status": "\/not connected\/",
"pattern": "\/^(.{2,5})\\s(?:.{1,28})(.{1,26}).*$\/",
"replace": "$1,$2",
"slice": 3
}
The regex object tells RaspAP how to parse the provider's CLI output: status matches the disconnected state, while pattern and replace extract the list of countries or locations. The optional slice value skips that number of header lines in the output.
It is not necessary to modify these definitions, unless you would like to experiment by adding a provider not currently supported by RaspAP.
Restoring settings
If you've modified RaspAP's default configuration and the AP no longer works as expected, the defaults may be restored by performing a system reset. From the System > Tools tab, click or tap the Perform reset button. A dialog will appear to confirm this action.
Alternatively, you may follow the steps described in the manual installation.
Discussions
Questions or comments about RaspAP's defaults? Join the discussions here.