mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Define/set default subnet for wlan1
This commit is contained in:
parent
645c336c97
commit
ef084ef537
@ -6,6 +6,12 @@
|
|||||||
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ],
|
"static domain_name_server": [ "1.1.1.1 8.8.8.8" ],
|
||||||
"subnetmask": [ "255.255.255.0" ]
|
"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": {
|
"uap0": {
|
||||||
"static ip_address": [ "192.168.50.1/24" ],
|
"static ip_address": [ "192.168.50.1/24" ],
|
||||||
"static routers": [ "192.168.50.1" ],
|
"static routers": [ "192.168.50.1" ],
|
||||||
@ -30,6 +36,9 @@
|
|||||||
"wlan0": {
|
"wlan0": {
|
||||||
"dhcp-range": [ "10.3.141.50,10.3.141.254,255.255.255.0,12h" ]
|
"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": {
|
"uap0": {
|
||||||
"dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ]
|
"dhcp-range": [ "192.168.50.50,192.168.50.150,12h" ]
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $reg_dom
|
|||||||
file_put_contents("/tmp/dnsmasqdata", $config);
|
file_put_contents("/tmp/dnsmasqdata", $config);
|
||||||
system('sudo cp /tmp/dnsmasqdata '.RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return);
|
system('sudo cp /tmp/dnsmasqdata '.RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return);
|
||||||
} elseif ($bridgedEnable !==1) {
|
} 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 = [ '# RaspAP '.$_POST['interface'].' configuration' ];
|
||||||
$config[] = 'interface='.$_POST['interface'];
|
$config[] = 'interface='.$_POST['interface'];
|
||||||
$config[] = 'domain-needed';
|
$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
|
// Set dhcp values from system config, fallback to default if undefined
|
||||||
$jsonData = json_decode(getNetConfig($ap_iface), true);
|
$jsonData = json_decode(getNetConfig($ap_iface), true);
|
||||||
$ip_address = ($jsonData['StaticIP'] == '') ? getDefaultNetValue('dhcp',$ap_iface,'static ip_address') : $jsonData['StaticIP'];
|
$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'];
|
$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'];
|
$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;
|
$ip_address.= (!preg_match('/.*\/\d+/', $ip_address)) ? '/'.mask2cidr($netmask) : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user