Project

General

Profile

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

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

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

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

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

    
125
	return htmlspecialchars($descr);
126
}
127

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
278
		write_config();
279

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

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

    
290
		$retval = filter_configure();
291
		$savemsg = get_std_save_message($retval);
292

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

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

    
302
	unset($input_errors);
303

    
304
	/* input validation */
305

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
407
		write_config();
408

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

    
417
	if (isset($delbtn)) {
418
		$id = $delbtn;
419

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

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

    
435
			if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
436
				unset($config['dhcpd'][$id]);
437
				services_dhcpd_configure();
438
			}
439

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

    
455
			write_config();
456

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

    
465
			link_interface_to_vlans($realid, "update");
466

    
467
			$savemsg = gettext("Interface has been deleted.");
468
		}
469
	}
470
}
471

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

    
487
include("head.inc");
488

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

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

    
509
pfSense_handle_custom_code("/usr/local/pkg/interfaces_assign/pre_input_errors");
510

    
511
if ($input_errors) {
512
	print_input_errors($input_errors);
513
}
514

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

    
594
	<button name="Submit" type="submit" class="btn btn-primary" value="<?=gettext('Save')?>"><?=gettext('Save')?></button>
595
</form>
596
<br />
597
<p class="alert alert-info"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown.")?></p>
598

    
599
<?php include("foot.inc")?>
(70-70/228)