Project

General

Profile

Download (19.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	interfaces_assign.php
4
*/
5
/* ====================================================================
6
 *	Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *	Copyright (c)  2004, 2005 Scott Ullrich
8
 *	Written by Jim McBeath based on existing m0n0wall files
9
 *
10
 *	Redistribution and use in source and binary forms, with or without modification,
11
 *	are permitted provided that the following conditions are met:
12
 *
13
 *	1. Redistributions of source code must retain the above copyright notice,
14
 *		this list of conditions and the following disclaimer.
15
 *
16
 *	2. Redistributions in binary form must reproduce the above copyright
17
 *		notice, this list of conditions and the following disclaimer in
18
 *		the documentation and/or other materials provided with the
19
 *		distribution.
20
 *
21
 *	3. All advertising materials mentioning features or use of this software
22
 *		must display the following acknowledgment:
23
 *		"This product includes software developed by the pfSense Project
24
 *		 for use in the pfSense software distribution. (http://www.pfsense.org/).
25
 *
26
 *	4. The names "pfSense" and "pfSense Project" must not be used to
27
 *		 endorse or promote products derived from this software without
28
 *		 prior written permission. For written permission, please contact
29
 *		 coreteam@pfsense.org.
30
 *
31
 *	5. Products derived from this software may not be called "pfSense"
32
 *		nor may "pfSense" appear in their names without prior written
33
 *		permission of the Electric Sheep Fencing, LLC.
34
 *
35
 *	6. Redistributions of any form whatsoever must retain the following
36
 *		acknowledgment:
37
 *
38
 *	"This product includes software developed by the pfSense Project
39
 *	for use in the pfSense software distribution (http://www.pfsense.org/).
40
 *
41
 *	THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
42
 *	EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43
 *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44
 *	PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
45
 *	ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
46
 *	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
47
 *	NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48
 *	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49
 *	HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
50
 *	STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
51
 *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52
 *	OF THE POSSIBILITY OF SUCH DAMAGE.
53
 *
54
 *	====================================================================
55
 *
56
 */
57
/*
58
	pfSense_BUILDER_BINARIES:	/bin/rm
59
	pfSense_MODULE:	interfaces
60
*/
61

    
62
##|+PRIV
63
##|*IDENT=page-interfaces-assignnetworkports
64
##|*NAME=Interfaces: Assign network ports page
65
##|*DESCR=Allow access to the 'Interfaces: Assign network ports' page.
66
##|*MATCH=interfaces_assign.php*
67
##|-PRIV
68

    
69
$pgtitle = array(gettext("Interfaces"), gettext("Assign network ports"));
70
$shortcut_section = "interfaces";
71

    
72
require("guiconfig.inc");
73
require("functions.inc");
74
require_once("filter.inc");
75
require("shaper.inc");
76
require("ipsec.inc");
77
require("vpn.inc");
78
require("captiveportal.inc");
79
require_once("rrd.inc");
80

    
81
function interface_assign_description($portinfo, $portname) {
82
	global $ovpn_descrs;
83
	if ($portinfo['isvlan']) {
84
		$descr = sprintf(gettext('VLAN %1$s on %2$s'), $portinfo['tag'], $portinfo['if']);
85
		if ($portinfo['descr']) {
86
			$descr .= " (" . $portinfo['descr'] . ")";
87
		}
88
	} elseif ($portinfo['iswlclone']) {
89
		$descr = $portinfo['cloneif'];
90
		if ($portinfo['descr']) {
91
			$descr .= " (" . $portinfo['descr'] . ")";
92
		}
93
	} elseif ($portinfo['isppp']) {
94
		$descr = $portinfo['descr'];
95
	} elseif ($portinfo['isbridge']) {
96
		$descr = strtoupper($portinfo['bridgeif']);
97
		if ($portinfo['descr']) {
98
			$descr .= " (" . $portinfo['descr'] . ")";
99
		}
100
	} elseif ($portinfo['isgre']) {
101
		$descr = "GRE {$portinfo['remote-addr']}";
102
		if ($portinfo['descr']) {
103
			$descr .= " (" . $portinfo['descr'] . ")";
104
		}
105
	} elseif ($portinfo['isgif']) {
106
		$descr = "GIF {$portinfo['remote-addr']}";
107
		if ($portinfo['descr']) {
108
			$descr .= " (" . $portinfo['descr'] . ")";
109
		}
110
	} elseif ($portinfo['islagg']) {
111
		$descr = strtoupper($portinfo['laggif']);
112
		if ($portinfo['descr']) {
113
			$descr .= " (" . $portinfo['descr'] . ")";
114
		}
115
	} elseif ($portinfo['isqinq']) {
116
		$descr = $portinfo['descr'];
117
	} elseif (substr($portname, 0, 4) == 'ovpn') {
118
		$descr = $portname . " (" . $ovpn_descrs[substr($portname, 5)] . ")";
119
	} else {
120
		$descr = $portname . " (" . $portinfo['mac'] . ")";
121
	}
122

    
123
	return htmlspecialchars($descr);
124
}
125

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

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

    
134
/* add wireless clone interfaces */
135
if (is_array($config['wireless']['clone']) && count($config['wireless']['clone'])) {
136
	foreach ($config['wireless']['clone'] as $clone) {
137
		$portlist[$clone['cloneif']] = $clone;
138
		$portlist[$clone['cloneif']]['iswlclone'] = true;
139
	}
140
}
141

    
142
/* add VLAN interfaces */
143
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
144
	foreach ($config['vlans']['vlan'] as $vlan) {
145
		$portlist[$vlan['vlanif']] = $vlan;
146
		$portlist[$vlan['vlanif']]['isvlan'] = true;
147
	}
148
}
149

    
150
/* add Bridge interfaces */
151
if (is_array($config['bridges']['bridged']) && count($config['bridges']['bridged'])) {
152
	foreach ($config['bridges']['bridged'] as $bridge) {
153
		$portlist[$bridge['bridgeif']] = $bridge;
154
		$portlist[$bridge['bridgeif']]['isbridge'] = true;
155
	}
156
}
157

    
158
/* add GIF interfaces */
159
if (is_array($config['gifs']['gif']) && count($config['gifs']['gif'])) {
160
	foreach ($config['gifs']['gif'] as $gif) {
161
		$portlist[$gif['gifif']] = $gif;
162
		$portlist[$gif['gifif']]['isgif'] = true;
163
	}
164
}
165

    
166
/* add GRE interfaces */
167
if (is_array($config['gres']['gre']) && count($config['gres']['gre'])) {
168
	foreach ($config['gres']['gre'] as $gre) {
169
		$portlist[$gre['greif']] = $gre;
170
		$portlist[$gre['greif']]['isgre'] = true;
171
	}
172
}
173

    
174
/* add LAGG interfaces */
175
if (is_array($config['laggs']['lagg']) && count($config['laggs']['lagg'])) {
176
	foreach ($config['laggs']['lagg'] as $lagg) {
177
		$portlist[$lagg['laggif']] = $lagg;
178
		$portlist[$lagg['laggif']]['islagg'] = true;
179
		/* LAGG members cannot be assigned */
180
		$lagifs = explode(',', $lagg['members']);
181
		foreach ($lagifs as $lagif) {
182
			if (isset($portlist[$lagif])) {
183
				unset($portlist[$lagif]);
184
			}
185
		}
186
	}
187
}
188

    
189
/* add QinQ interfaces */
190
if (is_array($config['qinqs']['qinqentry']) && count($config['qinqs']['qinqentry'])) {
191
	foreach ($config['qinqs']['qinqentry'] as $qinq) {
192
		$portlist["vlan{$qinq['tag']}"]['descr'] = "VLAN {$qinq['tag']}";
193
		$portlist["vlan{$qinq['tag']}"]['isqinq'] = true;
194
		/* QinQ members */
195
		$qinqifs = explode(' ', $qinq['members']);
196
		foreach ($qinqifs as $qinqif) {
197
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['descr'] = "QinQ {$qinqif}";
198
			$portlist["vlan{$qinq['tag']}_{$qinqif}"]['isqinq'] = true;
199
		}
200
	}
201
}
202

    
203
/* add PPP interfaces */
204
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
205
	foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
206
		$portname = $ppp['if'];
207
		$portlist[$portname] = $ppp;
208
		$portlist[$portname]['isppp'] = true;
209
		$ports_base = basename($ppp['ports']);
210
		if (isset($ppp['descr'])) {
211
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['descr']}";
212
		} else if (isset($ppp['username'])) {
213
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base}) - {$ppp['username']}";
214
		} else {
215
			$portlist[$portname]['descr'] = strtoupper($ppp['if']). "({$ports_base})";
216
		}
217
	}
218
}
219

    
220
$ovpn_descrs = array();
221
if (is_array($config['openvpn'])) {
222
	if (is_array($config['openvpn']['openvpn-server'])) {
223
		foreach ($config['openvpn']['openvpn-server'] as $s) {
224
			$portname = "ovpns{$s['vpnid']}";
225
			$portlist[$portname] = $s;
226
			$ovpn_descrs[$s['vpnid']] = $s['description'];
227
		}
228
	}
229
	if (is_array($config['openvpn']['openvpn-client'])) {
230
		foreach ($config['openvpn']['openvpn-client'] as $c) {
231
			$portname = "ovpnc{$c['vpnid']}";
232
			$portlist[$portname] = $c;
233
			$ovpn_descrs[$c['vpnid']] = $c['description'];
234
		}
235
	}
236
}
237

    
238
if (isset($_POST['add']) && isset($_POST['if_add'])) {
239
	/* Be sure this port is not being used */
240
	$portused = false;
241
	foreach ($config['interfaces'] as $ifname => $ifdata) {
242
		if ($ifdata['if'] == $_POST['if_add']) {
243
			$portused = true;
244
			break;
245
		}
246
	}
247

    
248
	if ($portused === false) {
249
		/* find next free optional interface number */
250
		if (!$config['interfaces']['lan']) {
251
			$newifname = gettext("lan");
252
			$descr = gettext("LAN");
253
		} else {
254
			for ($i = 1; $i <= count($config['interfaces']); $i++) {
255
				if (!$config['interfaces']["opt{$i}"]) {
256
					break;
257
				}
258
			}
259
			$newifname = 'opt' . $i;
260
			$descr = "OPT" . $i;
261
		}
262

    
263
		$config['interfaces'][$newifname] = array();
264
		$config['interfaces'][$newifname]['descr'] = $descr;
265
		$config['interfaces'][$newifname]['if'] = $_POST['if_add'];
266
		if (preg_match($g['wireless_regex'], $_POST['if_add'])) {
267
			$config['interfaces'][$newifname]['wireless'] = array();
268
			interface_sync_wireless_clones($config['interfaces'][$newifname], false);
269
		}
270

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

    
273
		/* XXX: Do not remove this. */
274
		unlink_if_exists("{$g['tmp_path']}/config.cache");
275

    
276
		write_config();
277

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

    
281
} else if (isset($_POST['apply'])) {
282
	if (file_exists("/var/run/interface_mismatch_reboot_needed")) {
283
		system_reboot();
284
		$rebootingnow = true;
285
	} else {
286
		write_config();
287

    
288
		$retval = filter_configure();
289
		$savemsg = get_std_save_message($retval);
290

    
291
		if (stristr($retval, "error") <> true) {
292
			$savemsg = get_std_save_message($retval);
293
		} else {
294
			$savemsg = $retval;
295
		}
296
	}
297

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

    
300
	unset($input_errors);
301

    
302
	/* input validation */
303

    
304
	/* Build a list of the port names so we can see how the interfaces map */
305
	$portifmap = array();
306
	foreach ($portlist as $portname => $portinfo) {
307
		$portifmap[$portname] = array();
308
	}
309

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

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

    
325
			foreach ($portifmap[$portname] as $ifn) {
326
				$errstr .= " " . convert_friendly_interface_to_friendly_descr(strtolower($ifn)) . " (" . $ifn . ")";
327
			}
328

    
329
			$input_errors[] = $errstr;
330
		} else if (count($ifnames) == 1 && preg_match('/^bridge[0-9]/', $portname) && is_array($config['bridges']['bridged']) && count($config['bridges']['bridged'])) {
331
			foreach ($config['bridges']['bridged'] as $bridge) {
332
				if ($bridge['bridgeif'] != $portname) {
333
					continue;
334
				}
335

    
336
				$members = explode(",", strtoupper($bridge['members']));
337
				foreach ($members as $member) {
338
					if ($member == $ifnames[0]) {
339
						$input_errors[] = sprintf(gettext("You cannot set port %s to interface %s because this interface is a member of %s."), $portname, $member, $portname);
340
						break;
341
					}
342
				}
343
			}
344
		}
345
	}
346

    
347
	if (is_array($config['vlans']['vlan'])) {
348
		foreach ($config['vlans']['vlan'] as $vlan) {
349
			if (does_interface_exist($vlan['if']) == false) {
350
				$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.";
351
			}
352
		}
353
	}
354

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

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

    
361
				if (!is_array($ifport)) {
362
					$reloadif = false;
363
					if (!empty($config['interfaces'][$ifname]['if']) && $config['interfaces'][$ifname]['if'] <> $ifport) {
364
						interface_bring_down($ifname);
365
						/* Mark this to be reconfigured in any case. */
366
						$reloadif = true;
367
					}
368
					$config['interfaces'][$ifname]['if'] = $ifport;
369
					if (isset($portlist[$ifport]['isppp'])) {
370
						$config['interfaces'][$ifname]['ipaddr'] = $portlist[$ifport]['type'];
371
					}
372

    
373
					if (substr($ifport, 0, 3) == 'gre' || substr($ifport, 0, 3) == 'gif') {
374
						unset($config['interfaces'][$ifname]['ipaddr']);
375
						unset($config['interfaces'][$ifname]['subnet']);
376
						unset($config['interfaces'][$ifname]['ipaddrv6']);
377
						unset($config['interfaces'][$ifname]['subnetv6']);
378
					}
379

    
380
					/* check for wireless interfaces, set or clear ['wireless'] */
381
					if (preg_match($g['wireless_regex'], $ifport)) {
382
						if (!is_array($config['interfaces'][$ifname]['wireless'])) {
383
							$config['interfaces'][$ifname]['wireless'] = array();
384
						}
385
					} else {
386
						unset($config['interfaces'][$ifname]['wireless']);
387
					}
388

    
389
					/* make sure there is a descr for all interfaces */
390
					if (!isset($config['interfaces'][$ifname]['descr'])) {
391
						$config['interfaces'][$ifname]['descr'] = strtoupper($ifname);
392
					}
393

    
394
					if ($reloadif == true) {
395
						if (preg_match($g['wireless_regex'], $ifport)) {
396
							interface_sync_wireless_clones($config['interfaces'][$ifname], false);
397
						}
398
						/* Reload all for the interface. */
399
						interface_configure($ifname, true);
400
					}
401
				}
402
			}
403
		}
404

    
405
		write_config();
406

    
407
		enable_rrd_graphing();
408
	}
409
} else {
410
	unset($delbtn);
411
	if (!empty($_POST['del']))
412
		$delbtn = key($_POST['del']);
413

    
414
	if (isset($delbtn)) {
415
		$id = $delbtn;
416

    
417
		if (link_interface_to_group($id)) {
418
			$input_errors[] = gettext("The interface is part of a group. Please remove it from the group to continue");
419
		} else if (link_interface_to_bridge($id)) {
420
			$input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue");
421
		} else if (link_interface_to_gre($id)) {
422
			$input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue");
423
		} else if (link_interface_to_gif($id)) {
424
			$input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue");
425
		} else {
426
			unset($config['interfaces'][$id]['enable']);
427
			$realid = get_real_interface($id);
428
			interface_bring_down($id);   /* down the interface */
429

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

    
432
			if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
433
				unset($config['dhcpd'][$id]);
434
				services_dhcpd_configure();
435
			}
436

    
437
			if (count($config['filter']['rule']) > 0) {
438
				foreach ($config['filter']['rule'] as $x => $rule) {
439
					if ($rule['interface'] == $id) {
440
						unset($config['filter']['rule'][$x]);
441
					}
442
				}
443
			}
444
			if (is_array($config['nat']['rule']) && count($config['nat']['rule']) > 0) {
445
				foreach ($config['nat']['rule'] as $x => $rule) {
446
					if ($rule['interface'] == $id) {
447
						unset($config['nat']['rule'][$x]['interface']);
448
					}
449
				}
450
			}
451

    
452
			write_config();
453

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

    
462
			link_interface_to_vlans($realid, "update");
463

    
464
			$savemsg = gettext("Interface has been deleted.");
465
		}
466
	}
467
}
468

    
469
/* Create a list of unused ports */
470
$unused_portlist = array();
471
foreach ($portlist as $portname => $portinfo) {
472
	$portused = false;
473
	foreach ($config['interfaces'] as $ifname => $ifdata) {
474
		if ($ifdata['if'] == $portname) {
475
			$portused = true;
476
			break;
477
		}
478
	}
479
	if ($portused === false) {
480
		$unused_portlist[$portname] = $portinfo;
481
	}
482
}
483

    
484
include("head.inc");
485

    
486
if (file_exists("/var/run/interface_mismatch_reboot_needed")) {
487
	if ($_POST) {
488
		if ($rebootingnow) {
489
			$savemsg = gettext("The system is now rebooting.  Please wait.");
490
		} else {
491
			$savemsg = gettext("Reboot is needed. Please apply the settings in order to reboot.");
492
		}
493
	} else {
494
		$savemsg = gettext("Interface mismatch detected.  Please resolve the mismatch and click 'Apply changes'.  The firewall will reboot afterwards.");
495
	}
496
}
497

    
498
if (file_exists("/tmp/reload_interfaces")) {
499
	echo "<p>\n";
500
	print_info_box_np(gettext("The interface configuration has been changed.<br />You must apply the changes in order for them to take effect."));
501
	echo "<br /></p>\n";
502
} elseif ($savemsg) {
503
	print_info_box($savemsg);
504
}
505

    
506
pfSense_handle_custom_code("/usr/local/pkg/interfaces_assign/pre_input_errors");
507

    
508
if ($input_errors)
509
	print_input_errors($input_errors);
510

    
511
$tab_array = array();
512
$tab_array[] = array(gettext("Interface assignments"), true, "interfaces_assign.php");
513
$tab_array[] = array(gettext("Interface Groups"), false, "interfaces_groups.php");
514
$tab_array[] = array(gettext("Wireless"), false, "interfaces_wireless.php");
515
$tab_array[] = array(gettext("VLANs"), false, "interfaces_vlan.php");
516
$tab_array[] = array(gettext("QinQs"), false, "interfaces_qinq.php");
517
$tab_array[] = array(gettext("PPPs"), false, "interfaces_ppps.php");
518
$tab_array[] = array(gettext("GRE"), false, "interfaces_gre.php");
519
$tab_array[] = array(gettext("GIF"), false, "interfaces_gif.php");
520
$tab_array[] = array(gettext("Bridges"), false, "interfaces_bridge.php");
521
$tab_array[] = array(gettext("LAGG"), false, "interfaces_lagg.php");
522
display_top_tabs($tab_array);
523
?>
524
<form action="interfaces_assign.php" method="post">
525
	<div class="table-responsive">
526
	<table class="table table-striped table-hover">
527
	<thead>
528
		<tr>
529
			<th><?=gettext("Interface")?></th>
530
			<th><?=gettext("Network port")?></th>
531
		</tr>
532
	</thead>
533
	<tbody>
534
<?php
535
	foreach ($config['interfaces'] as $ifname => $iface):
536
		if ($iface['descr'])
537
			$ifdescr = $iface['descr'];
538
		else
539
			$ifdescr = strtoupper($ifname);
540
?>
541
		<tr>
542
			<td><a href="/interfaces.php?if=<?=$ifname?>"><?=$ifdescr?></a></td>
543
			<td>
544
				<select name="<?=$ifname?>" id="<?=$ifname?>" class="form-control">
545
<?php foreach ($portlist as $portname => $portinfo):?>
546
					<option value="<?=$portname?>" <?=($portname == $iface['if']) ? ' selected="selected"': ''?>>
547
						<?=interface_assign_description($portinfo, $portname)?>
548
					</option>
549
<?php endforeach;?>
550
				</select>
551
			</td>
552
			<td>
553
<?php if ($ifname != 'wan'):?>
554
				<input type="submit" name="del[<?=$ifname?>]" class="btn btn-danger" value="<?=gettext("delete interface")?>"/>
555
<?php endif;?>
556
			</td>
557
		</tr>
558
<?php endforeach;
559
	if (count($config['interfaces']) < count($portlist)):
560
?>
561
		<tr>
562
			<th>
563
				<?=gettext("Available network ports:")?>
564
			</th>
565
			<td>
566
				<select name="if_add" id="if_add" class="form-control">
567
<?php foreach ($unused_portlist as $portname => $portinfo):?>
568
					<option value="<?=$portname?>" <?=($portname == $iface['if']) ? ' selected="selected"': ''?>>
569
						<?=interface_assign_description($portinfo, $portname)?>
570
					</option>
571
<?php endforeach;?>
572
				</select>
573
			</td>
574
			<td>
575
				<input type="submit" name="add" title="<?=gettext("add selected interface")?>" value="add interface" class="btn btn-success" />
576
			</td>
577
		</tr>
578
<?php endif;?>
579
		</tbody>
580
	</table>
581
	</div>
582

    
583
	<input name="Submit" type="submit" class="btn btn-default" value="<?=gettext("Save")?>" /><br /><br />
584
</form>
585

    
586
<p class="alert alert-info"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown.")?></p>
587

    
588
<?php include("foot.inc")?>
(83-83/233)