diff --git a/config/defaults.json b/config/defaults.json index 81291989..a0e1b190 100644 --- a/config/defaults.json +++ b/config/defaults.json @@ -6,6 +6,12 @@ "static domain_name_server": [ "1.1.1.1 8.8.8.8" ], "subnetmask": [ "255.255.255.0" ] }, + "wlan1": { + "static ip_address": [ "10.9.141.1/24" ], + "static routers": [ "10.9.141.1" ], + "static domain_name_server": [ "1.1.1.1 8.8.8.8" ], + "subnetmask": [ "255.255.255.0" ] + }, "uap0": { "static ip_address": [ "192.168.50.1/24" ], "static routers": [ "192.168.50.1" ], @@ -30,6 +36,9 @@ "wlan0": { "dhcp-range": [ "10.3.141.50,10.3.141.254,255.255.255.0,12h" ] }, + "wlan1": { + "dhcp-range": [ "10.9.141.50,10.9.141.254,255.255.255.0,12h" ] + }, "uap0": { "dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ] } diff --git a/includes/hostapd.php b/includes/hostapd.php index 36411f35..d6864dee 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -344,7 +344,7 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $reg_dom file_put_contents("/tmp/dnsmasqdata", $config); system('sudo cp /tmp/dnsmasqdata '.RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return); } elseif ($bridgedEnable !==1) { - $dhcp_range = ($syscfg['dhcp-range'] =='') ? getDefaultNetValue('dnsmasq','wlan0','dhcp-range') : $syscfg['dhcp-range']; + $dhcp_range = ($syscfg['dhcp-range'] =='') ? getDefaultNetValue('dnsmasq',$ap_iface,'dhcp-range') : $syscfg['dhcp-range']; $config = [ '# RaspAP '.$_POST['interface'].' configuration' ]; $config[] = 'interface='.$_POST['interface']; $config[] = 'domain-needed'; @@ -361,7 +361,7 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $reg_dom // Set dhcp values from system config, fallback to default if undefined $jsonData = json_decode(getNetConfig($ap_iface), true); $ip_address = ($jsonData['StaticIP'] == '') ? getDefaultNetValue('dhcp',$ap_iface,'static ip_address') : $jsonData['StaticIP']; - $domain_name_server = ($jsonData['StaticDNS'] =='') ? getDefaultNetValue('dhcp','wlan0','static domain_name_server') : $jsonData['StaticDNS']; + $domain_name_server = ($jsonData['StaticDNS'] =='') ? getDefaultNetValue('dhcp',$ap_iface,'static domain_name_server') : $jsonData['StaticDNS']; $routers = ($jsonData['StaticRouters'] == '') ? getDefaultNetValue('dhcp',$ap_iface,'static routers') : $jsonData['StaticRouters']; $netmask = ($jsonData['SubnetMask'] == '' || $jsonData['SubnetMask'] == '0.0.0.0') ? getDefaultNetValue('dhcp',$ap_iface,'subnetmask') : $jsonData['SubnetMask']; $ip_address.= (!preg_match('/.*\/\d+/', $ip_address)) ? '/'.mask2cidr($netmask) : null;