interfaces_assign.php 19 KB
Newer Older
Ad Schellevis's avatar
Ad Schellevis committed
1 2
<?php

3
/*
4 5
	Copyright (C) 2014-2015 Deciso B.V.
	Copyright (C) Jim McBeath
Ad Schellevis's avatar
Ad Schellevis committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
	All rights reserved.

	Redistribution and use in source and binary forms, with or without
	modification, are permitted provided that the following conditions are met:

	1. Redistributions of source code must retain the above copyright notice,
	   this list of conditions and the following disclaimer.

	2. Redistributions in binary form must reproduce the above copyright
	   notice, this list of conditions and the following disclaimer in the
	   documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/

$pgtitle = array(gettext("Interfaces"),gettext("Assign network ports"));

33
require_once("guiconfig.inc");
Ad Schellevis's avatar
Ad Schellevis committed
34
require_once("filter.inc");
35
require_once("vpn.inc");
Ad Schellevis's avatar
Ad Schellevis committed
36
require_once("rrd.inc");
37 38
require_once("system.inc");
require_once("interfaces.inc");
39
require_once("openvpn.inc");
40
require_once("pfsense-utils.inc");
41
require_once("services.inc");
42
require_once("unbound.inc");
Ad Schellevis's avatar
Ad Schellevis committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

function interface_assign_description($portinfo, $portname) {
	if ($portinfo['isvlan']) {
		$descr = sprintf(gettext('VLAN %1$s on %2$s'),$portinfo['tag'],$portinfo['if']);
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['iswlclone']) {
		$descr = $portinfo['cloneif'];
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['isppp']) {
		$descr = $portinfo['descr'];
	} elseif ($portinfo['isbridge']) {
		$descr = strtoupper($portinfo['bridgeif']);
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['isgre']) {
		$descr = "GRE {$portinfo['remote-addr']}";
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['isgif']) {
		$descr = "GIF {$portinfo['remote-addr']}";
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['islagg']) {
		$descr = strtoupper($portinfo['laggif']);
		if ($portinfo['descr'])
			$descr .= " (" . $portinfo['descr'] . ")";
	} elseif ($portinfo['isqinq']) {
		$descr =  $portinfo['descr'];
	} elseif (substr($portname, 0, 4) == 'ovpn') {
		$descr = $portname . " (" . $ovpn_descrs[substr($portname, 5)] . ")";
	} else
		$descr = $portname . " (" . $portinfo['mac'] . ")";

	return htmlspecialchars($descr);
}

/*
	In this file, "port" refers to the physical port name,
	while "interface" refers to LAN, WAN, or OPTn.
*/

/* get list without VLAN interfaces */
$portlist = get_interface_list();

/* add wireless clone interfaces */
90
if (isset($config['wireless']['clone'])) {
Ad Schellevis's avatar
Ad Schellevis committed
91 92 93 94 95 96 97
	foreach ($config['wireless']['clone'] as $clone) {
		$portlist[$clone['cloneif']] = $clone;
		$portlist[$clone['cloneif']]['iswlclone'] = true;
	}
}

/* add VLAN interfaces */
98
if (isset($config['vlans']['vlan'])) {
Ad Schellevis's avatar
Ad Schellevis committed
99 100 101 102 103 104 105
	foreach ($config['vlans']['vlan'] as $vlan) {
		$portlist[$vlan['vlanif']] = $vlan;
		$portlist[$vlan['vlanif']]['isvlan'] = true;
	}
}

/* add Bridge interfaces */
106
if (isset($config['bridges']['bridged'])) {
Ad Schellevis's avatar
Ad Schellevis committed
107 108 109 110 111 112 113
	foreach ($config['bridges']['bridged'] as $bridge) {
		$portlist[$bridge['bridgeif']] = $bridge;
		$portlist[$bridge['bridgeif']]['isbridge'] = true;
	}
}

/* add GIF interfaces */
114
if (isset($config['gifs']['gif'])) {
Ad Schellevis's avatar
Ad Schellevis committed
115 116 117 118 119 120 121
	foreach ($config['gifs']['gif'] as $gif) {
		$portlist[$gif['gifif']] = $gif;
		$portlist[$gif['gifif']]['isgif'] = true;
	}
}

/* add GRE interfaces */
122
if (isset($config['gres']['gre'])) {
Ad Schellevis's avatar
Ad Schellevis committed
123 124 125 126 127 128 129
	foreach ($config['gres']['gre'] as $gre) {
		$portlist[$gre['greif']] = $gre;
		$portlist[$gre['greif']]['isgre'] = true;
	}
}

/* add LAGG interfaces */
130
if (isset($config['laggs']['lagg'])) {
Ad Schellevis's avatar
Ad Schellevis committed
131 132 133 134 135 136 137 138 139 140 141 142
	foreach ($config['laggs']['lagg'] as $lagg) {
		$portlist[$lagg['laggif']] = $lagg;
		$portlist[$lagg['laggif']]['islagg'] = true;
		/* LAGG members cannot be assigned */
		$lagifs = explode(',', $lagg['members']);
		foreach ($lagifs as $lagif)
			if (isset($portlist[$lagif]))
				unset($portlist[$lagif]);
	}
}

/* add QinQ interfaces */
143
if (isset($config['qinqs']['qinqentry'])) {
Ad Schellevis's avatar
Ad Schellevis committed
144 145 146 147 148 149 150 151 152 153 154 155 156
	foreach ($config['qinqs']['qinqentry'] as $qinq) {
		$portlist["vlan{$qinq['tag']}"]['descr'] = "VLAN {$qinq['tag']}";
		$portlist["vlan{$qinq['tag']}"]['isqinq'] = true;
		/* QinQ members */
		$qinqifs = explode(' ', $qinq['members']);
		foreach ($qinqifs as $qinqif) {
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['descr'] = "QinQ {$qinqif}";
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['isqinq'] = true;
		}
	}
}

/* add PPP interfaces */
157
if (isset($config['ppps']['ppp'])) {
Ad Schellevis's avatar
Ad Schellevis committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171
	foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
		$portname = $ppp['if'];
		$portlist[$portname] = $ppp;
		$portlist[$portname]['isppp'] = true;
		$ports_base = basename($ppp['ports']);
		if (isset($ppp['descr']))
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['descr']}";
		else if (isset($ppp['username']))
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['username']}";
		else
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base})";
	}
}

172 173 174 175 176 177 178 179 180 181 182 183 184
/* add tun0 interface (required for sixxs-aiccu) */
//   This is a temporary solution to allow using sixxs-aiccu without manual code change
//   until the aiccu service is correctly included in the web interface.
//   'mac' is used to add the description in the available network ports list
//   (to avoid additional temporary code in the interface_assign_description function).
$tunfound = "";
exec("/sbin/ifconfig | /usr/bin/grep -c '^tun0'", $tunfound);
if (intval($tunfound[0]) > 0) {
	$portlist['tun0'] = array();
	$portlist['tun0']['if'] = 'tun0';
	$portlist['tun0']['mac'] = 'sixxs-aiccu';
}

Ad Schellevis's avatar
Ad Schellevis committed
185
$ovpn_descrs = array();
186 187 188
if (isset($config['openvpn'])) {
	if (isset($config['openvpn']['openvpn-server'])) {
		foreach ($config['openvpn']['openvpn-server'] as $s) {
Ad Schellevis's avatar
Ad Schellevis committed
189
			$ovpn_descrs[$s['vpnid']] = $s['description'];
190 191 192 193
		}
	}
	if (isset($config['openvpn']['openvpn-client'])) {
		foreach ($config['openvpn']['openvpn-client'] as $c) {
Ad Schellevis's avatar
Ad Schellevis committed
194
			$ovpn_descrs[$c['vpnid']] = $c['description'];
195 196
		}
	}
Ad Schellevis's avatar
Ad Schellevis committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
}

if (isset($_POST['add_x']) && isset($_POST['if_add'])) {
	/* Be sure this port is not being used */
	$portused = false;
	foreach ($config['interfaces'] as $ifname => $ifdata) {
		if ($ifdata['if'] == $_PORT['if_add']) {
			$portused = true;
			break;
		}
	}

	if ($portused === false) {
		/* find next free optional interface number */
		if(!$config['interfaces']['lan']) {
			$newifname = gettext("lan");
			$descr = gettext("LAN");
		} else {
			for ($i = 1; $i <= count($config['interfaces']); $i++) {
				if (!$config['interfaces']["opt{$i}"])
					break;
			}
			$newifname = 'opt' . $i;
			$descr = "OPT" . $i;
		}

		$config['interfaces'][$newifname] = array();
		$config['interfaces'][$newifname]['descr'] = $descr;
		$config['interfaces'][$newifname]['if'] = $_POST['if_add'];
226
		if (match_wireless_interface($_POST['if_add'])) {
Ad Schellevis's avatar
Ad Schellevis committed
227 228 229 230 231 232 233 234 235 236 237 238
			$config['interfaces'][$newifname]['wireless'] = array();
			interface_sync_wireless_clones($config['interfaces'][$newifname], false);
		}

		uksort($config['interfaces'], "compare_interface_friendly_names");

		write_config();

		$savemsg = gettext("Interface has been added.");
	}

} else if (isset($_POST['apply'])) {
239
	write_config();
Ad Schellevis's avatar
Ad Schellevis committed
240

241
	$retval = filter_configure();
242
	$savemsg = get_std_save_message();
Ad Schellevis's avatar
Ad Schellevis committed
243

244
	if (stristr($retval, "error") != true) {
245
		$savemsg = get_std_save_message();
246 247
	} else {
		$savemsg = $retval;
Ad Schellevis's avatar
Ad Schellevis committed
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
	}

} else if (isset($_POST['Submit'])) {

	unset($input_errors);

	/* input validation */

	/* Build a list of the port names so we can see how the interfaces map */
	$portifmap = array();
	foreach ($portlist as $portname => $portinfo)
		$portifmap[$portname] = array();

	/* Go through the list of ports selected by the user,
	build a list of port-to-interface mappings in portifmap */
	foreach ($_POST as $ifname => $ifport) {
		if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt'))
			$portifmap[$ifport][] = strtoupper($ifname);
	}

	/* Deliver error message for any port with more than one assignment */
	foreach ($portifmap as $portname => $ifnames) {
		if (count($ifnames) > 1) {
			$errstr = sprintf(gettext('Port %1$s '.
				' was assigned to %2$s' .
				' interfaces:'), $portname, count($ifnames));

			foreach ($portifmap[$portname] as $ifn)
				$errstr .= " " . $ifn;

			$input_errors[] = $errstr;
279
		} else if (count($ifnames) == 1 && preg_match('/^bridge[0-9]/', $portname) && isset($config['bridges']['bridged'])) {
Ad Schellevis's avatar
Ad Schellevis committed
280
			foreach ($config['bridges']['bridged'] as $bridge) {
281
				if ($bridge['bridgeif'] != $portname) {
Ad Schellevis's avatar
Ad Schellevis committed
282
					continue;
283
				}
Ad Schellevis's avatar
Ad Schellevis committed
284 285 286 287 288 289 290 291 292 293 294 295

				$members = explode(",", strtoupper($bridge['members']));
				foreach ($members as $member) {
					if ($member == $ifnames[0]) {
						$input_errors[] = sprintf(gettext("You cannot set port %s to interface %s because this interface is a member of %s."), $portname, $member, $portname);
						break;
					}
				}
			}
		}
	}

296
	if (isset($config['vlans']['vlan'])) {
Ad Schellevis's avatar
Ad Schellevis committed
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
		foreach ($config['vlans']['vlan'] as $vlan) {
			if (does_interface_exist($vlan['if']) == false)
				$input_errors[] = "Vlan parent interface {$vlan['if']} does not exist anymore so vlan id {$vlan['tag']} cannot be created please fix the issue before continuing.";
		}
	}

	if (!$input_errors) {
		/* No errors detected, so update the config */
		foreach ($_POST as $ifname => $ifport) {

			if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt')) {

				if (!is_array($ifport)) {
					$reloadif = false;
					if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] <> $ifport) {
						interface_bring_down($ifname);
						/* Mark this to be reconfigured in any case. */
						$reloadif = true;
					}
					$config['interfaces'][$ifname]['if'] = $ifport;
					if (isset($portlist[$ifport]['isppp']))
						$config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type'];

					if (substr($ifport, 0, 3) == 'gre' || substr($ifport, 0, 3) == 'gif') {
						unset($config['interfaces'][$ifname]['ipaddr']);
						unset($config['interfaces'][$ifname]['subnet']);
						unset($config['interfaces'][$ifname]['ipaddrv6']);
						unset($config['interfaces'][$ifname]['subnetv6']);
					}

					/* check for wireless interfaces, set or clear ['wireless'] */
328
					if (match_wireless_interface($ifport)) {
Ad Schellevis's avatar
Ad Schellevis committed
329 330 331 332 333 334 335 336 337 338 339
						if (!is_array($config['interfaces'][$ifname]['wireless']))
							$config['interfaces'][$ifname]['wireless'] = array();
					} else {
						unset($config['interfaces'][$ifname]['wireless']);
					}

					/* make sure there is a descr for all interfaces */
					if (!isset($config['interfaces'][$ifname]['descr']))
						$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);

					if ($reloadif == true) {
340
						if (match_wireless_interface($ifport)) {
Ad Schellevis's avatar
Ad Schellevis committed
341
							interface_sync_wireless_clones($config['interfaces'][$ifname], false);
342
						}
Ad Schellevis's avatar
Ad Schellevis committed
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
						/* Reload all for the interface. */
						interface_configure($ifname, true);
					}
				}
			}
		}

		write_config();

		enable_rrd_graphing();
	}
} else {
	/* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
	unset($delbtn);
	foreach ($_POST as $pn => $pd) {
		if (preg_match("/del_(.+)_x/", $pn, $matches))
			$delbtn = $matches[1];
	}

Ad Schellevis's avatar
Ad Schellevis committed
362

Ad Schellevis's avatar
Ad Schellevis committed
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
	if (isset($delbtn)) {
		$id = $delbtn;

		if (link_interface_to_group($id))
			$input_errors[] = gettext("The interface is part of a group. Please remove it from the group to continue");
		else if (link_interface_to_bridge($id))
			$input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue");
		else if (link_interface_to_gre($id))
			$input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue");
		else if (link_interface_to_gif($id))
			$input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue");
		else {
			unset($config['interfaces'][$id]['enable']);
			$realid = get_real_interface($id);
			interface_bring_down($id);   /* down the interface */

			unset($config['interfaces'][$id]);	/* delete the specified OPTn or LAN*/

			if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
				unset($config['dhcpd'][$id]);
				services_dhcpd_configure();
			}

			if (count($config['filter']['rule']) > 0) {
				foreach ($config['filter']['rule'] as $x => $rule) {
					if($rule['interface'] == $id)
						unset($config['filter']['rule'][$x]);
				}
			}
			if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
				foreach ($config['nat']['rule'] as $x => $rule) {
					if($rule['interface'] == $id)
						unset($config['nat']['rule'][$x]['interface']);
				}
			}

			write_config();

			/* If we are in firewall/routing mode (not single interface)
			 * then ensure that we are not running DHCP on the wan which
			 * will make a lot of ISP's unhappy.
			 */
			if($config['interfaces']['lan'] && $config['dhcpd']['wan']) {
				unset($config['dhcpd']['wan']);
			}

			link_interface_to_vlans($realid, "update");

			$savemsg = gettext("Interface has been deleted.");
		}
	}
}

/* Create a list of unused ports */
$unused_portlist = array();
foreach ($portlist as $portname => $portinfo) {
	$portused = false;
	foreach ($config['interfaces'] as $ifname => $ifdata) {
		if ($ifdata['if'] == $portname) {
			$portused = true;
			break;
		}
	}
	if ($portused === false)
		$unused_portlist[$portname] = $portinfo;
}

include("head.inc");

?>

Ad Schellevis's avatar
Ad Schellevis committed
434
<body>
Ad Schellevis's avatar
Ad Schellevis committed
435 436
<?php include("fbegin.inc"); ?>

Ad Schellevis's avatar
Ad Schellevis committed
437
	<section class="page-content-main">
438 439 440 441
	<div class="container-fluid">
		<div class="row">

			<?php
442
			if (isset($savemsg)) {
443
				print_info_box($savemsg);
444
			}
445

446
			if (isset($input_errors) && count($input_errors) > 0) {
447
				print_input_errors($input_errors);
448
			}
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
			?>

		    <section class="col-xs-12">


					<?php
						$tab_array = array();
						$tab_array[0] = array(gettext("Interface assignments"), true, "interfaces_assign.php");
						$tab_array[1] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
						$tab_array[2] = array(gettext("Wireless"), false, "interfaces_wireless.php");
						$tab_array[3] = array(gettext("VLANs"), false, "interfaces_vlan.php");
						$tab_array[4] = array(gettext("QinQs"), false, "interfaces_qinq.php");
						$tab_array[5] = array(gettext("PPPs"), false, "interfaces_ppps.php");
						$tab_array[7] = array(gettext("GRE"), false, "interfaces_gre.php");
						$tab_array[8] = array(gettext("GIF"), false, "interfaces_gif.php");
						$tab_array[9] = array(gettext("Bridges"), false, "interfaces_bridge.php");
						$tab_array[10] = array(gettext("LAGG"), false, "interfaces_lagg.php");
						display_top_tabs($tab_array);
					?>


					<div class="tab-content content-box col-xs-12">

	                        <form action="interfaces_assign.php" method="post" name="iform" id="iform">

	                        <div class="table-responsive">
		                        <table class="table table-striped table-sort">

Ad Schellevis's avatar
Ad Schellevis committed
477 478
                                        <thead>
                                            <tr>
479 480
								<th colspan="2" class="listtopic"><?=gettext("Interface"); ?></th>
								<th colspan="2" class="listtopic"><?=gettext("Network port"); ?></th>
Ad Schellevis's avatar
Ad Schellevis committed
481 482
                                            </tr>
                                        </thead>
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545

									<tbody>
									<?php
												foreach ($config['interfaces'] as $ifname => $iface):
													if ($iface['descr'])
														$ifdescr = $iface['descr'];
													else
														$ifdescr = strtoupper($ifname);
									?>
													<tr>
														<td class="listlr" valign="middle"><strong><u><span onclick="location.href='/interfaces.php?if=<?=$ifname;?>'" style="cursor: pointer;"><?=$ifdescr;?></span></u></strong></td>
														<td valign="middle" class="listr">
															<select onchange="javascript:jQuery('#savediv').show();" name="<?=$ifname;?>" id="<?=$ifname;?>">
									<?php
															foreach ($portlist as $portname => $portinfo):
									?>
																<option  value="<?=$portname;?>"  <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
																	<?=interface_assign_description($portinfo, $portname);?>
																</option>
									<?php
															endforeach;
									?>
															</select>
														</td>
														<td valign="middle" class="list">
									<?php
														if ($ifname != 'wan'):
									?>
															<button name="del_<?=$ifname;?>_x"
																title="<?=gettext("delete interface");?>"
																class="btn btn-default"
																type="submit"
																value="<?=$ifname;?>"
																onclick="return confirm('<?=gettext("Do you really want to delete this interface?"); ?>')">
																<span class=" glyphicon glyphicon-remove"></span>
															</button>
									<?php
														endif;
									?>
														</td>
													</tr>
									<?php
												endforeach;
												if (count($config['interfaces']) < count($portlist)):
									?>
													<tr>
														<td class="list">
															<strong><?=gettext("Available network ports:");?></strong>
														</td>
														<td class="list">
															<select name="if_add" id="if_add">
									<?php
															foreach ($unused_portlist as $portname => $portinfo):
									?>
																<option  value="<?=$portname;?>"  <?php if ($portname == $iface['if']) echo " selected=\"selected\"";?>>
																	<?=interface_assign_description($portinfo, $portname);?>
																</option>
									<?php
															endforeach;
									?>
															</select>
														</td>
														<td class="list">
546
															<button name="add_x" type="submit" value="<?=$portname;?>" class="btn btn-primary" title="<?=gettext("add selected interface");?>"><span class="glyphicon glyphicon-plus"></span></button>
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
														</td>
													</tr>
									<?php
												endif;
									?>
									</tbody>
								</table>
	                        </div>

	                        <div class="container-fluid">
		                        <div id='savediv' style='display:none'>
									<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /><br /><br />
								</div>
								<ul>
									<li><span class="vexpl"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown."); ?></span></li>
								</ul>
	                        </div>

	                        </form>

					</div>
		    </section>
		</div>
Ad Schellevis's avatar
Ad Schellevis committed
570
		</div>
Ad Schellevis's avatar
Ad Schellevis committed
571 572 573
	</section>

<?php include("foot.inc"); ?>