Menu="NetworkSettings:100" Title="Interface eth0" Tag="tag" --- $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; } // 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_id = 'VLANID:'; $vlan_eth0 = [0]; if (isset($eth0)) foreach ($eth0 as $key => $val) if (strpos($key,$vlan_id)===0) $vlan_eth0[] = substr($key,strlen($vlan_id)); ?>
MAC address: : > This is the hardware address of the interface. > When tagging is enabled all VLANs on this interface will share the same hardware address. Enable bonding: : > Bonding is a feature that combines multiple physical Ethernet interfaces into a single *bonded* interface named **bond0**. > This can be used to improve the connection redundancy and/or throughput of the system. > Different bonding modes are supported (see below), but some modes require proper switch support. Enable bridging: : > Bridging is a feature which creates a virtual bridge and allows VMs to communicate directly with the physical Ethernet port. > Both bonding and bridging can be combined to let VMs communicate over a *bonded* interface. Interface description: : " onchange="exitCode(this.form,true)"> > Use this optional field to provide addditional information about the purpose of the connection. Network protocol: : IP address assignment: : > The following settings are possible: > > *Automatic* - the server will attempt to obtain its IP address from the local DHCP server (IPv4) or SLAAC (IPv6)
> *Static* - the IP address is manually set for this interface
> *None* - no IP address is assigned to the interface (only available for VLANs) DNS server assignment: : > If set to *Automatic* the server will use DNS server IP address returned by the local automatic assignment.
> If set to *Static* you may enter your own list. > > This is useful in Active Directory configurations where you need to set the first DNS Server entry to the IP address of your AD Domain server. Desired MTU: : > This is the MTU size to use on the physical Ethernet interface. > If left blank, the MTU will automatically be determined (by default 1500 bytes). Enable VLANs: :
  : Stopped to change (see Settings)" : ""?>