Project

General

Profile

Download (19.5 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
##|+PRIV
61
##|*IDENT=page-interfaces-assignnetworkports
62
##|*NAME=Interfaces: Assign network ports
63
##|*DESCR=Allow access to the 'Interfaces: Assign network ports' page.
64
##|*MATCH=interfaces_assign.php*
65
##|-PRIV
66

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

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

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

    
121
	return htmlspecialchars($descr);
122
}
123

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
274
		write_config();
275

    
276
		$savemsg = gettext("Interface has been added.");
277
		$class = "success";
278
	}
279

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

    
287
		$retval = filter_configure();
288

    
289
		if (stristr($retval, "error") <> true) {
290
			$savemsg = get_std_save_message($retval);
291
			$class = "success";
292
		} else {
293
			$savemsg = $retval;
294
			$class = "danger";
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

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

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

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

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

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

    
453
			write_config();
454

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

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

    
465
			$savemsg = gettext("Interface has been deleted.");
466
			$class = "success";
467
		}
468
	}
469
}
470

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

    
486
include("head.inc");
487

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

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

    
511
pfSense_handle_custom_code("/usr/local/pkg/interfaces_assign/pre_input_errors");
512

    
513
if ($input_errors) {
514
	print_input_errors($input_errors);
515
}
516

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

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

    
602
<?php include("foot.inc")?>
(70-70/229)