Menu="NetworkSettings:100" Title="Interface eth0" Tag="icon-ethernet" --- $value) { if ($member == $source) continue; if ($value['BONDING']=='yes' && in_array($port,explode(',',$value['BONDNICS']))) return $value['BONDNAME'].' '.$member; if ($value['BRIDGING']=='yes' && in_array($port,explode(',',$value['BRNICS']))) return $value['BRNAME'].' '.$member; } return false; } function vlanID($cfg) { return array_filter($cfg,function($key){return strpos($key,'VLANID:')===0;},ARRAY_FILTER_USE_KEY); } function index($key) { return filter_var($key,FILTER_SANITIZE_NUMBER_INT); } // remove non-existing ethernet ports foreach (glob("$docroot/webGui/Eth[1-9]*.page",GLOB_NOSORT) as $port) { if (!in_array(strtolower(basename($port,'.page')), $ports)) { @unlink($port); $build = true; } } // add new ethernet ports foreach ($ports as $ethX) { $file = "$docroot/webGui/".ucfirst($ethX).".page"; if (!file_exists($file)) { $X = filter_var($ethX,FILTER_SANITIZE_NUMBER_INT); $nnn = 100 + $X; $tabX = 'tab'.($X+1); $bondX = 'bond'.$X; $brX = 'br'.$X; copy($template, $file); exec("sed -i 's/parentname:nnn/NetworkSettings:$nnn/;s/tabX/$tabX/;s/bondX/$bondX/g;s/brX/$brX/g;s/ethX/$ethX/g' $file"); $build = true; } } // enable interface only when VMs and Docker are stopped $service = exec("pgrep libvirt") ? 'VM manager' : ''; $service .= exec("pgrep docker") ? ($service ? ' and ' : '').'Docker service' : ''; // eth0 port status $no_eth0 = exec("ip link show eth0|grep -Pom1 '(NO-CARRIER|state DOWN)'"); // get VLAN interfaces $vlan_eth0 = $sort_eth0 = []; if (isset($eth0)) foreach (vlanID($eth0) as $key => $val) {$vlan_eth0[] = index($key); $sort_eth0[] = (int)$val;} array_multisort($sort_eth0,$vlan_eth0); ?>
Interface description: : " onchange="exitCode(this.form,true)"> > Use this optional field to provide addditional information about the purpose of the connection.
  : must be Stopped to change (see [Settings](/Settings))