mirror of
https://github.com/unraid/webgui.git
synced 2026-01-19 08:00:24 -06:00
571 lines
27 KiB
Plaintext
571 lines
27 KiB
Plaintext
Menu="parentname:nnn"
|
|
Title="_(Interface)_ ethX"
|
|
Tag="icon-ethernet"
|
|
---
|
|
<?PHP
|
|
/* Copyright 2005-2020, Lime Technology
|
|
* Copyright 2012-2020, Bergware International.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License version 2,
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*/
|
|
?>
|
|
<?
|
|
$locked = locked('ethX','ethX');
|
|
|
|
// get VLAN interfaces
|
|
$vlan_ethX = $sort_ethX = [];
|
|
if (!$locked && isset($ethX)) foreach (vlanID($ethX) as $key => $val) {$vlan_ethX[] = index($key); $sort_ethX[] = (int)$val;}
|
|
array_multisort($sort_ethX,$vlan_ethX);
|
|
|
|
$cmd = 'Down';
|
|
$more = true;
|
|
if (strpos($locked,'bond')===0 || strpos($locked,'br')===0) {
|
|
list($master_ethX,$root) = explode(' ',$locked);
|
|
$reason = _('member of')." $master_ethX ("._('see interface')." $root)";
|
|
$class = 'green-text';
|
|
} elseif (!exec("ip link show ethX|grep -om1 'UP>'")) {
|
|
$reason = _("shutdown")." ("._("inactive").")";
|
|
$class = 'blue-text';
|
|
$cmd = 'Up';
|
|
} elseif (empty($ethX)) {
|
|
$reason = _("not configured");
|
|
$class = 'red-text';
|
|
} else {
|
|
$more = false;
|
|
$class = '';
|
|
}
|
|
?>
|
|
<script>
|
|
function portcheck_ethX() {
|
|
$.post('/webGui/include/CheckPort.php',{port:'ethX'},function(text) {
|
|
var html = $('#user-notice').html();
|
|
if (!html || html.indexOf('ethX')>0) showNotice(text);
|
|
setTimeout(portcheck_ethX,10000);
|
|
});
|
|
}
|
|
$(function() {
|
|
var ctrl = "<span id='wait_ethX' class='status vshift red-text' style='display:none;font-size:1.2rem;font-style:italic'><i class='fa fa-spinner fa-spin'></i> _(Please wait)_... _(configuring interface)_</span>";
|
|
var form = document.ethX_settings;
|
|
<?if ($tabbed && !$service):?>
|
|
$('#tabX').bind({click:function(){
|
|
$('#bond-ethX').dropdownchecklist('destroy').dropdownchecklist({emptyText:'_(None)_', width:<?=$width[0]?>});
|
|
$('#bridge-ethX').dropdownchecklist('destroy').dropdownchecklist({emptyText:'_(None)_', width:<?=$width[0]?>});
|
|
}});
|
|
<?endif;?>
|
|
if (!$.cookie('#view-ethX')) {$('#view-ethX').show(); $('#tag-ethX').removeClass('fa-chevron-down').addClass('fa-chevron-up');}
|
|
<?foreach ($vlan_ethX as $i):?>
|
|
if (!$.cookie('#view-ethX-<?=$i?>')) {$('#view-ethX-<?=$i?>').show(); $('#tag-ethX-<?=$i?>').removeClass('fa-chevron-down').addClass('fa-chevron-up');}
|
|
<?endforeach;?>
|
|
$('#bond-ethX').dropdownchecklist({emptyText:'_(None)_', width:<?=$width[0]?>});
|
|
$('#bridge-ethX').dropdownchecklist({emptyText:'_(None)_ ', width:<?=$width[0]?>});
|
|
checkBondingSettings(form,0,'ethX');
|
|
checkBridgingSettings(form,0,'ethX');
|
|
checkNetworkAccess(form,'ethX');
|
|
selectProtocol(form,'ethX');
|
|
<?if (!$tabbed):?>
|
|
$('div#title').each(function(){
|
|
if ($(this).text().indexOf('Interface ethX')==0) $(this).find('span.left').append(ctrl);
|
|
});
|
|
<?endif;?>
|
|
<?if ($master_ethX):?>
|
|
$('div.slave-ethX').hide();
|
|
disableForm(form);
|
|
<?elseif ($service):?>
|
|
disableForm(form);
|
|
<?endif;?>
|
|
<?if ($no_eth0):?>
|
|
$('input[name="#shut_ethX"]').prop('disabled',true);
|
|
<?endif;?>
|
|
setTimeout(portcheck_ethX,Number('ethX'.substr(3))*1000);
|
|
});
|
|
</script>
|
|
<form markdown="1" name="ethX_settings" method="POST" action="/update.php" target="progressFrame" onchange="exitCode(this,false)" onsubmit="return prepareSettings(this)">
|
|
<input type="hidden" name="#file" value="<?=$ini?>">
|
|
<input type="hidden" name="#include" value="/webGui/include/update.ethernet.php">
|
|
<input type="hidden" name="#section" value="ethX">
|
|
<input type="hidden" name="#command" value="/webGui/scripts/netconfig">
|
|
<input type="hidden" name="#arg[1]" value="">
|
|
<input type="hidden" name="BONDNAME" value="bondX">
|
|
<input type="hidden" name="BONDING_MIIMON" value="100">
|
|
<input type="hidden" name="BRNAME" value="brX">
|
|
<input type="hidden" name="BRSTP" value="no">
|
|
<input type="hidden" name="BRFD" value="0">
|
|
_(Interface description)_:
|
|
: <span class="status vshift"><i id="tag-ethX" class="fa fa-fw fa-chevron-down" style="cursor:pointer" onclick="viewToggle('ethX')"></i></span>
|
|
<?if (!$more):?>
|
|
<input type="text" name="DESCRIPTION:0" maxlength="80" value="<?=htmlspecialchars($ethX["DESCRIPTION:0"])?>" onchange="exitCode(this.form,true)">
|
|
<?else:?>
|
|
<span class="<?=$class?>"><?=$reason?></span>
|
|
<?endif;?>
|
|
|
|
:help120
|
|
> Use this field to give addditional information about the purpose of the connection.
|
|
:end
|
|
|
|
<div markdown="1" id="view-ethX" style="display:none">
|
|
_(MAC address)_:
|
|
: <?=strtoupper(exec("ip link show ethX|grep -Pom1 'ether \K\S+'"))?>
|
|
|
|
:help121
|
|
> This is the hardware address of the interface.
|
|
> When tagging is enabled all VLANs on this interface will share the same hardware address.
|
|
:end
|
|
|
|
<div markdown="1" class="slave-ethX">
|
|
_(Enable bonding)_:
|
|
: <select name="BONDING" onchange="checkBondingSettings(this.form,1,'ethX')">
|
|
<?=mk_option($ethX['BONDING'], "no", _("No"))?>
|
|
<?=mk_option($ethX['BONDING'], "yes", _("Yes"))?>
|
|
</select>
|
|
|
|
:help122
|
|
> 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.
|
|
:end
|
|
|
|
<div markdown="1" id="bond-members-ethX" style="display:none">
|
|
_(Bonding mode)_:
|
|
: <select name="BONDING_MODE" onchange="checkBondingSettings(this.form,-1,'ethX')">
|
|
<?=mk_option($eth0['BONDING_MODE'], "0", _("balance-rr")." (0)")?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "1", _("active-backup")." (1)",isset($ethX['BONDING_MODE'])?'':'selected')?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "2", _("balance-xor")." (2)")?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "3", _("broadcast")." (3)")?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "4", _("802.3ad")." (4)")?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "5", _("balance-tlb")." (5)")?>
|
|
<?=mk_option($eth0['BONDING_MODE'], "6", _("balance-alb")." (6)")?>
|
|
</select>
|
|
<span id="attention0" style="display:none">**_(Attention)_:** _(this mode requires a network switch with proper setup and support)_...</span>
|
|
|
|
:help123
|
|
> **Mode 0 (balance-rr)**<br>
|
|
> This mode transmits packets in a sequential order from the first available slave through the last.
|
|
> If two real interfaces are slaves in the bond and two packets arrive destined out of the bonded interface the first will be transmitted on the first slave and the second frame will be transmitted on the second slave.
|
|
> The third packet will be sent on the first and so on. This provides load balancing and fault tolerance.
|
|
>
|
|
> **Mode 1 (active-backup) - default**<br>
|
|
> This mode places one of the interfaces into a backup state and will only make it active if the link is lost by the active interface.
|
|
> Only one slave in the bond is active at an instance of time. A different slave becomes active only when the active slave fails.
|
|
> This mode provides fault tolerance.
|
|
>
|
|
> **Mode 2 (balance-xor)**<br>
|
|
> This mode transmits packets based on an XOR formula. Source MAC address is XOR'd with destination MAC address modula slave count.
|
|
> This selects the same slave for each destination MAC address and provides load balancing and fault tolerance.
|
|
>
|
|
> **Mode 3 (broadcast)**<br>
|
|
> This mode transmits everything on all slave interfaces. This mode is least used (only for specific purpose) and provides only fault tolerance.
|
|
>
|
|
> **Mode 4 (802.3ad)**<br>
|
|
> This mode is known as *Dynamic Link Aggregation*. It creates aggregation groups that share the same speed and duplex settings.
|
|
> It requires a switch that supports IEEE 802.3ad dynamic link.
|
|
> Slave selection for outgoing traffic is done according to the transmit hash policy, which may be changed from the default simple XOR policy via the xmit_hash_policy option.
|
|
> Note that not all transmit policies may be 802.3ad compliant, particularly inregards to the packet mis-ordering requirements of section 43.2.4 of the 802.3ad standard.
|
|
> Different peer implementations will have varying tolerances for noncompliance.
|
|
>
|
|
> **Mode 5 (balance-tlb)**<br>
|
|
> This mode is called *Adaptive transmit load balancing*. The outgoing traffic is distributed according to the current load and queue on each slave interface.
|
|
> Incoming traffic is received by the current slave.
|
|
>
|
|
> **Mode 6 (balance-alb)**<br>
|
|
> This mode is called *Adaptive load balancing*. This includes balance-tlb + receive load balancing (rlb) for IPV4 traffic.
|
|
> The receive load balancing is achieved by ARP negotiation.
|
|
> The bonding driver intercepts the ARP Replies sent by the server on their way out and overwrites the src hw address with the unique hw address of one of the slaves in the bond
|
|
> such that different clients use different hw addresses for the server.
|
|
>
|
|
> *Mode 1 (active-backup) is the recommended setting. Other modes allow you to set up a specific environment, but may require proper switch support.
|
|
> Choosing a unsupported mode can result in a disrupted communication.*
|
|
:end
|
|
|
|
_(Bonding members of)_ bondX:
|
|
: <select id="bond-ethX" name="BONDNICS" multiple="multiple" style="display:none">
|
|
<?=mk_option($ethX['BONDNICS'],'ethX','ethX','selected disabled')?>
|
|
<?foreach ($ports as $port):?>
|
|
<?if ($port!='ethX' && !locked('ethX',$port)) echo mk_option_check($ethX['BONDNICS'],$port,$port)?>
|
|
<?endforeach;?>
|
|
</select>
|
|
|
|
:help124
|
|
> Select which interfaces are member of the *bonded* interface. By default ethX is a member, while other interfaces are optional.
|
|
:end
|
|
|
|
</div>
|
|
_(Enable bridging)_:
|
|
: <select name="BRIDGING" onchange="checkBridgingSettings(this.form,1,'ethX')">
|
|
<?=mk_option($ethX['BRIDGING'], "no", _("No"))?>
|
|
<?=mk_option($ethX['BRIDGING'], "yes", _("Yes"))?>
|
|
</select>
|
|
|
|
:help125
|
|
> Bridging is a feature which creates a virtual bridge and allows VMs and Docker containers to communicate directly with the physical Ethernet port.
|
|
> Both bonding and bridging can be combined to let VMs or containers communicate over a *bonded* interface.
|
|
:end
|
|
|
|
<div markdown="1" id="bridge-members-ethX" style="display:none">
|
|
_(Bridging members of)_ brX:
|
|
: <select id="bridge-ethX" name="BRNICS" multiple="multiple" style="display:none">
|
|
<?=mk_option($ethX['BRNICS'],'ethX','ethX','selected disabled')?>
|
|
<?foreach ($ports as $port):?>
|
|
<?if ($port!='ethX' && !locked('ethX',$port)) echo mk_option_check($ethX['BRNICS'],$port,$port)?>
|
|
<?endforeach;?>
|
|
</select>
|
|
|
|
:help126
|
|
> Select which interfaces are member of the *bridged* interface. By default ethX is a member, while other interfaces are optional.
|
|
:end
|
|
|
|
</div>
|
|
_(Network protocol)_:
|
|
: <select name="PROTOCOL:0" onchange="selectProtocol(this.form,'ethX',0)">
|
|
<?=mk_option($ethX["PROTOCOL:0"], 'ipv4', _('IPv4 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:0"], 'ipv6', _('IPv6 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:0"], 'ipv4+ipv6', _('IPv4 + IPv6'))?>
|
|
</select>
|
|
|
|
:help127
|
|
> Select which protocol(s) are used. By default IPv4 only is used.<br>
|
|
> When both IPv4 and IPv6 is selected, each protocol can be configured independently.
|
|
:end
|
|
|
|
<div markdown="1" class="ipv4-ethX-0" style="display:none">
|
|
_(IPv4 address assignment)_:
|
|
: <select name="USE_DHCP:0" onchange="selectProtocol(this.form,'ethX',0)">
|
|
<?=mk_option($ethX["USE_DHCP:0"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP:0"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP:0"], '', _('None'))?>
|
|
</select>
|
|
|
|
:help128
|
|
> The following settings are possible:
|
|
>
|
|
> *Automatic* - the server will attempt to obtain a IPv4 address from the local DHCP server<br>
|
|
> *Static* - the IPv4 address is manually set for this interface<br>
|
|
> *None* - no IPv4 address is assigned to the interface
|
|
:end
|
|
|
|
<div markdown="1" class="more-ipv4-ethX-0" style="display:none">
|
|
_(IPv4 address)_:
|
|
: <input type="text" name="IPADDR:0" maxlength="15" value="<?=$ethX["IPADDR:0"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">/<select name="NETMASK:0" class="slim">
|
|
<?=mk_option($ethX["NETMASK:0"], "255.0.0.0", "8")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.0.0", "16")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.128.0", "17")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.192.0", "18")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.224.0", "19")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.240.0", "20")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.248.0", "21")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.252.0", "22")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.254.0", "23")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.0", "24", $ethX["IPADDR:0"]?"":"selected")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.128", "25")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.192", "26")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.224", "27")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.240", "28")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.248", "29")?>
|
|
<?=mk_option($ethX["NETMASK:0"], "255.255.255.252", "30")?>
|
|
</select>
|
|
|
|
:help129
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address and mask of the interface.
|
|
:end
|
|
|
|
_(IPv4 default gateway)_:
|
|
: <input type="text" name="GATEWAY:0" maxlength="15" value="<?=$ethX["GATEWAY:0"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
|
<input type="text" name="METRIC:0" min="1" max="9999" value="<?=$ethX["METRIC:0"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred, 0 is no default gateway))_*
|
|
|
|
:help130
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
|
|
:end
|
|
|
|
</div>
|
|
</div>
|
|
<div markdown="1" class="ipv6-ethX-0" style="display:none">
|
|
_(IPv6 address assignment)_:
|
|
: <select name="USE_DHCP6:0" onchange="selectProtocol(this.form,'ethX',0)">
|
|
<?=mk_option($ethX["USE_DHCP6:0"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:0"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:0"], '', _('None'))?>
|
|
</select>
|
|
|
|
:help135
|
|
> The following settings are possible:
|
|
>
|
|
> *Automatic* - the server will attempt to obtain a IPv6 address from the local DHCP server or Router Advertisement (RA)<br>
|
|
> *Static* - the IPv6 address is manually set for this interface<br>
|
|
> *None* - no IPv6 address is assigned to the interface
|
|
:end
|
|
|
|
<div markdown="1" class="more-ipv6-ethX-0" style="display:none">
|
|
_(IPv6 address)_:
|
|
: <input type="text" name="IPADDR6:0" maxlength="39" value="<?=$ethX["IPADDR6:0"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">/<input type="number" name="NETMASK6:0" min="1" max="128" value="<?=$ethX["NETMASK6:0"]?>" class="slim">
|
|
|
|
:help136
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the interface.
|
|
:end
|
|
|
|
_(IPv6 default gateway)_:
|
|
: <input type="text" name="GATEWAY6:0" maxlength="39" value="<?=$ethX["GATEWAY6:0"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
|
<input type="text" name="METRIC6:0" min="1" max="9999" value="<?=$ethX["METRIC6:0"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred))_*
|
|
|
|
:help137
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of your router.
|
|
:end
|
|
|
|
_(IPv6 privacy extensions)_:
|
|
: <select name="PRIVACY6:0">
|
|
<?=mk_option($ethX["PRIVACY6:0"], "0", _("Disabled"))?>
|
|
<?=mk_option($ethX["PRIVACY6:0"], "2", _("Enabled"))?>
|
|
</select>
|
|
|
|
:help138
|
|
> Enable or disable the generation of a random IPv6 interface identifier according to RFC4941. This is similar to the temporary IPv6 address generation on Windows machines.
|
|
:end
|
|
|
|
</div>
|
|
</div>
|
|
_(Desired MTU)_:
|
|
: <input type="number" name="MTU" min="68" max="9198" value="<?=$locked?$ethX['MTU']:$ethX['MTU']?>" class="narrow" placeholder="1500">
|
|
|
|
:help143
|
|
> 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).
|
|
:end
|
|
|
|
_(Enable VLANs)_:
|
|
: <select name="TYPE" onchange="checkNetworkAccess(this.form,'ethX')">
|
|
<?=mk_option($ethX['TYPE'], 'access', _('No'))?>
|
|
<?=mk_option($ethX['TYPE'], 'trunk', _('Yes'))?>
|
|
</select>
|
|
|
|
:help144
|
|
> By default no VLANs are configured.<br>
|
|
> Enabling VLANs extends the number of logical connections over the same physical connection.
|
|
>
|
|
> Note: your router and switch must support VLANs too when this feature is used.
|
|
:end
|
|
|
|
</div>
|
|
</div>
|
|
<div id='index-ethX-0'></div>
|
|
<?foreach ($vlan_ethX as $i):?>
|
|
<div markdown="1" id="index-ethX-<?=$i?>" class="access-ethX shade-<?=$display['theme']?>" style="display:none">
|
|
_(Interface description)_:
|
|
: <span class="status vshift"><i id="tag-ethX-<?=$i?>" class="fa fa-fw fa-chevron-down" style="cursor:pointer" onclick="viewToggle('ethX','<?=$i?>')"></i></span>
|
|
<input type="text" name="DESCRIPTION:<?=$i?>" maxlength="80" value="<?=htmlspecialchars($ethX["DESCRIPTION:$i"])?>" onchange="exitCode(this.form,true)">
|
|
|
|
:help145
|
|
> Use this field to give addditional information about the purpose of the connection.
|
|
:end
|
|
|
|
<div markdown="1" id="view-ethX-<?=$i?>" style="display:none">
|
|
_(VLAN number)_:
|
|
: <input type="number" name="VLANID:<?=$i?>" min="1" max="4095" value="<?=$ethX["VLANID:$i"]?>" class="narrow gap" required>
|
|
<?if (!$service):?><input type="button" class="form" value="_(Delete VLAN)_" onclick="removeVLAN($('#index-ethX-<?=$i?>'))"><?endif;?>
|
|
|
|
:help146
|
|
> Give each VLAN a unique identifier. Numbers range from 1 to 4095.
|
|
:end
|
|
|
|
_(Network protocol)_:
|
|
: <select name="PROTOCOL:<?=$i?>" onchange="selectProtocol(this.form,'ethX',<?=$i?>)">
|
|
<?=mk_option($ethX["PROTOCOL:$i"], 'ipv4', _('IPv4 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:$i"], 'ipv6', _('IPv6 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:$i"], 'ipv4+ipv6', _('IPv4 + IPv6'))?>
|
|
</select>
|
|
|
|
:help147
|
|
> Select which protocol(s) are used. By default IPv4 only is used.<br>
|
|
> When both IPv4 and IPv6 is selected, each protocol can be configured independently.
|
|
:end
|
|
|
|
<div markdown="1" class="ipv4-ethX-<?=$i?>" style="display:none">
|
|
_(IPv4 address assignment)_:
|
|
: <select name="USE_DHCP:<?=$i?>" onchange="selectProtocol(this.form,'ethX',<?=$i?>)">
|
|
<?=mk_option($ethX["USE_DHCP:$i"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP:$i"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP:$i"], '', _('None'))?>
|
|
</select>
|
|
|
|
:help148
|
|
> The following settings are possible:
|
|
>
|
|
> *Automatic* - the server will attempt to obtain a IPv4 address from the local DHCP server<br>
|
|
> *Static* - the IPv4 address is manually set for this interface<br>
|
|
> *None* - no IPv4 address is assigned to the interface
|
|
:end
|
|
|
|
<div markdown="1" class="more-ipv4-ethX-<?=$i?>" style="display:none">
|
|
_(IPv4 address)_:
|
|
: <input type="text" name="IPADDR:<?=$i?>" maxlength="15" value="<?=$ethX["IPADDR:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">/<select name="NETMASK:<?=$i?>" class="slim">
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.0.0.0", "8")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.0.0", "16")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.128.0", "17")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.192.0", "18")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.224.0", "19")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.240.0", "20")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.248.0", "21")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.252.0", "22")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.254.0", "23")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.0", "24", $ethX["IPADDR:$i"]?"":"selected")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.128", "25")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.192", "26")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.224", "27")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.240", "28")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.248", "29")?>
|
|
<?=mk_option($ethX["NETMASK:$i"], "255.255.255.252", "30")?>
|
|
</select>
|
|
|
|
:help149
|
|
> Greyed out when using automatic IP assignment or NONE assignment. Otherwise specify here the IPv4 address and mask of the interface.
|
|
:end
|
|
|
|
_(IPv4 default gateway)_:
|
|
: <input type="text" name="GATEWAY:<?=$i?>" maxlength="15" value="<?=$ethX["GATEWAY:$i"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
|
<input type="text" name="METRIC:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred, 0 is no default gateway))_*
|
|
|
|
:help150
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv4 address of your router.
|
|
:end
|
|
|
|
</div>
|
|
</div>
|
|
<div markdown="1" class="ipv6-ethX-<?=$i?>" style="display:none">
|
|
_(IPv6 address assignment)_:
|
|
: <select name="USE_DHCP6:<?=$i?>" onchange="selectProtocol(this.form,'ethX',<?=$i?>)">
|
|
<?=mk_option($ethX["USE_DHCP6:$i"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:$i"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:$i"], '', _('None'))?>
|
|
</select>
|
|
|
|
:help151
|
|
> The following settings are possible:
|
|
>
|
|
> *Automatic* - the server will attempt to obtain a IPv6 address from the local DHCP server or Router Advertisement (RA)<br>
|
|
> *Static* - the IPv6 address is manually set for this interface<br>
|
|
> *None* - no IPv6 address is assigned to the interface
|
|
:end
|
|
|
|
<div markdown="1" class="more-ipv6-ethX-<?=$i?>" style="display:none">
|
|
_(IPv6 address)_:
|
|
: <input type="text" name="IPADDR6:<?=$i?>" maxlength="39" value="<?=$ethX["IPADDR6:$i"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">/<input type="number" name="NETMASK6:<?=$i?>" min="1" max="128" value="<?=$ethX["NETMASK6:$i"]?>" class="slim">
|
|
|
|
:help152
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address and prefix of the interface.
|
|
:end
|
|
|
|
_(IPv6 default gateway)_:
|
|
: <input type="text" name="GATEWAY6:<?=$i?>" maxlength="39" value="<?=$ethX["GATEWAY6:$i"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
|
<input type="text" name="METRIC6:<?=$i?>" min="1" max="9999" value="<?=$ethX["METRIC6:$i"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred, 0 is no default gateway))_*
|
|
|
|
:help153
|
|
> Greyed out when using automatic IP assignment. Otherwise specify here the IPv6 address of your router.
|
|
:end
|
|
|
|
_(IPv6 privacy extensions)_:
|
|
: <select name="PRIVACY6:<?=$i?>">
|
|
<?=mk_option($ethX["PRIVACY6:$i"], "0", _("Disabled"))?>
|
|
<?=mk_option($ethX["PRIVACY6:$i"], "2", _("Enabled"))?>
|
|
</select>
|
|
|
|
:help154
|
|
> Enable or disable the generation of a random IPv6 interface identifier according to RFC4941. This is similar to the temporary IPv6 address generation on Windows machines.
|
|
:end
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?endforeach;?>
|
|
|
|
|
|
: <input type="submit" value="_(Apply)_" onclick="$('#wait_<?=$tabbed?'eth0':'ethX'?>').show()" disabled><input type="button" value="_(Done)_" onclick="done()">
|
|
<input type="button" name="#shut_ethX" value="<?=_('Port '.$cmd)?>" onclick="portToggle('ethX','<?=$cmd?>')">
|
|
<?if (!$service):?>
|
|
<input type="button" class="access-ethX" value="_(Add VLAN)_" onclick="addVLAN('ethX')" style="display:none">
|
|
<?else:?><?=sprintf(_('Stop **%s** to make changes, see'),$service).' (<a href="/Settings">'._('Settings').'</a>)'?><?endif;?>
|
|
</form>
|
|
|
|
<script markdown="1" type="text/html" id="network-template-ethX">
|
|
<div markdown="1" id="index-ethX-INDEX" class="access-ethX shade-<?=$display['theme']?>">
|
|
_(Interface description)_:
|
|
: <span class="status vshift"><i id="tag-ethX-INDEX" class="fa fa-fw fa-chevron-up" style="cursor:pointer" onclick="viewToggle('ethX','INDEX')"></i></span>
|
|
<input type="text" name="DESCRIPTION:INDEX" maxlength="80" value="<?=htmlspecialchars($ethX["DESCRIPTION:INDEX"])?>" onchange="exitCode(this.form,true)">
|
|
|
|
<div markdown="1" id="view-ethX-INDEX">
|
|
_(VLAN number)_:
|
|
: <input type="number" name="VLANID:INDEX" min="1" max="4095" value="<?=$ethX["VLANID:INDEX"]?>" class="narrow gap" required>
|
|
<input type="button" class="form" value="_(Delete VLAN)_" onclick="removeVLAN($('#index-ethX-INDEX'))">
|
|
|
|
_(Network protocol)_:
|
|
: <select name="PROTOCOL:INDEX" onchange="selectProtocol(this.form,'ethX',INDEX)">
|
|
<?=mk_option($ethX["PROTOCOL:INDEX"], 'ipv4', _('IPv4 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:INDEX"], 'ipv6', _('IPv6 only'))?>
|
|
<?=mk_option($ethX["PROTOCOL:INDEX"], 'ipv4+ipv6', _('IPv4 + IPv6'))?>
|
|
</select>
|
|
|
|
<div markdown="1" class="ipv4-ethX-INDEX" style="display:none">
|
|
_(IPv4 address assignment)_:
|
|
: <select name="USE_DHCP:INDEX" onchange="selectProtocol(this.form,'ethX',INDEX)">
|
|
<?=mk_option($ethX["USE_DHCP:INDEX"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP:INDEX"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP:INDEX"], '', _('None'))?>
|
|
</select>
|
|
|
|
<div markdown="1" class="more-ipv4-ethX-INDEX" style="display:none">
|
|
_(IPv4 address)_:
|
|
: <input type="text" name="IPADDR:INDEX" maxlength="15" value="<?=$ethX["IPADDR:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">/<select name="NETMASK:INDEX" class="slim">
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.0.0.0", "8")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.0.0", "16")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.128.0", "17")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.192.0", "18")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.224.0", "19")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.240.0", "20")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.248.0", "21")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.252.0", "22")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.254.0", "23")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.0", "24", "selected")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.128", "25")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.192", "26")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.224", "27")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.240", "28")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.248", "29")?>
|
|
<?=mk_option($ethX["NETMASK:INDEX"], "255.255.255.252", "30")?>
|
|
</select>
|
|
|
|
_(IPv4 default gateway)_:
|
|
: <input type="text" name="GATEWAY:INDEX" maxlength="15" value="<?=$ethX["GATEWAY:INDEX"]?>" class="narrow" pattern="<?=$validIP4?>" title="_(IPv4 address A.B.C.D)_">
|
|
<input type="text" name="METRIC:INDEX" min="1" max="9999" value="<?=$ethX["METRIC:INDEX"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred, 0 is no default gateway))_*
|
|
|
|
</div>
|
|
</div>
|
|
<div markdown="1" class="ipv6-ethX-INDEX" style="display:none">
|
|
_(IPv6 address assignment)_:
|
|
: <select name="USE_DHCP6:INDEX" onchange="selectProtocol(this.form,'ethX',INDEX)">
|
|
<?=mk_option($ethX["USE_DHCP6:INDEX"], 'yes', _('Automatic'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:INDEX"], 'no', _('Static'))?>
|
|
<?=mk_option($ethX["USE_DHCP6:INDEX"], '', _('None'))?>
|
|
</select>
|
|
|
|
<div markdown="1" class="more-ipv6-ethX-INDEX" style="display:none">
|
|
_(IPv6 address)_:
|
|
: <input type="text" name="IPADDR6:INDEX" maxlength="39" value="<?=$ethX["IPADDR6:INDEX"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">/<input type="number" name="NETMASK6:INDEX" min="1" max="128" value="<?=$ethX["NETMASK6:INDEX"]?>" class="slim">
|
|
|
|
_(IPv6 default gateway)_:
|
|
: <input type="text" name="GATEWAY6:INDEX" maxlength="39" value="<?=$ethX["GATEWAY6:INDEX"]?>" pattern="<?=$validIP6?>" title="_(IPv6 address nnnn:xxxx::yyyy)_">
|
|
<input type="text" name="METRIC6:INDEX" min="1" max="9999" value="<?=$ethX["METRIC6:INDEX"]?>" class="slim"><i class="fa fa-sort-numeric-asc"></i> *_(optional metric (lowest is preferred, 0 is no default gateway))_*
|
|
|
|
_(IPv6 privacy extensions)_:
|
|
: <select name="PRIVACY6:INDEX">
|
|
<?=mk_option($ethX['PRIVACY6:INDEX'], "0", _("Disabled"))?>
|
|
<?=mk_option($ethX['PRIVACY6:INDEX'], "2", _("Enabled"))?>
|
|
</select>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</script>
|