From 20b1c7cd007312b3d5d25f2071b3b24be0d19045 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Fri, 18 Oct 2019 09:48:32 -0400 Subject: [PATCH] Customize dnsmasq.conf dhcpcd.conf common.sh dhcp.php and insert line in armbianEnv.txt to support secondary DHCP server on R1 eth1. --- config/dhcpcd.conf | 9 +++++++++ config/dnsmasq.conf | 7 +++++-- includes/dhcp.php | 8 ++++---- installers/common.sh | 7 +++++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/config/dhcpcd.conf b/config/dhcpcd.conf index f75f7c0..2efe6b2 100644 --- a/config/dhcpcd.conf +++ b/config/dhcpcd.conf @@ -11,7 +11,16 @@ slaac private nohook lookup-hostname # LokiAP-WebGui wireless configuration +{ interface wlan0 static ip_address=10.3.141.1/24 static routers=10.3.141.1 static domain_name_server=1.1.1.1 127.3.2.1 +} +//For Orange Pi R1 Secondary Ethernet Adapter +{ +interface eth1 +static ip_address=10.3.142.1/24 +static routers=10.3.142.1 +static domain_name_server=1.1.1.1 127.3.2.1 +} diff --git a/config/dnsmasq.conf b/config/dnsmasq.conf index 613dca0..e834441 100644 --- a/config/dnsmasq.conf +++ b/config/dnsmasq.conf @@ -1,5 +1,8 @@ -interface=wlan0 -dhcp-range=10.3.141.1,10.3.141.24,255.255.255.0,12h +except-interface=eth0 +//For Orange Pi R1 Secondary Ethernet Adapter +dhcp-range=eth1,10.3.142.1,10.3.142.24,255.255.255.0,12h +// +dhcp-range=wlan0,10.3.141.1,10.3.141.24,255.255.255.0,12h bind-dynamic domain-needed bogus-priv diff --git a/includes/dhcp.php b/includes/dhcp.php index b60d844..ba4e954 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -109,10 +109,10 @@ function DisplayDHCPConfig() { exec( 'cat '. RASPI_DNSMASQ_CONFIG, $return ); $conf = ParseConfig($return); $arrRange = explode( ",", $conf['dhcp-range'] ); - $RangeStart = $arrRange[0]; - $RangeEnd = $arrRange[1]; - $RangeMask = $arrRange[2]; - $leaseTime = $arrRange[3]; + $RangeStart = $arrRange[1]; + $RangeEnd = $arrRange[2]; + $RangeMask = $arrRange[3]; + $leaseTime = $arrRange[4]; $hselected = ''; $mselected = ''; diff --git a/installers/common.sh b/installers/common.sh index 769ab1f..bbef36c 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -384,6 +384,12 @@ function optimize_php() { fi } +function build_R1 () { + if [ strpos(file_get_contents("/etc/armbian-release"),'orangepi-r1') !== false]; then + sudo sed -i "1i extraargs=net.ifnames=0" /boot/armbianEnv.txt + fi +} + function install_complete() { install_log "Installation completed!" @@ -417,5 +423,6 @@ function install_raspap() { network_tables default_configuration patch_system_files + build_R1 install_complete }