Projet

Général

Profil

Télécharger (22,2 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / firewall_virtual_ip_edit.php @ 2d1e985d

1
<?php
2
/* $Id$ */
3
/*
4

    
5
    firewall_virtual_ip_edit.php
6
    part of pfSense (https://www.pfsense.org/)
7

    
8
    Copyright (C) 2005 Bill Marquette <bill.marquette@gmail.com>.
9
    All rights reserved.
10

    
11
    Includes code from m0n0wall which is:
12
    Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
13
    All rights reserved.
14

    
15
    Includes code from pfSense which is:
16
    Copyright (C) 2004-2005 Scott Ullrich <geekgod@pfsense.com>.
17
    All rights reserved.
18

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

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

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

    
29
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
30
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
31
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
33
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
    POSSIBILITY OF SUCH DAMAGE.
39
*/
40
/*
41
	pfSense_BUILDER_BINARIES:	/sbin/ifconfig
42
	pfSense_MODULE:	interfaces
43
*/
44

    
45
##|+PRIV
46
##|*IDENT=page-firewall-virtualipaddress-edit
47
##|*NAME=Firewall: Virtual IP Address: Edit page
48
##|*DESCR=Allow access to the 'Firewall: Virtual IP Address: Edit' page.
49
##|*MATCH=firewall_virtual_ip_edit.php*
50
##|-PRIV
51

    
52
require("guiconfig.inc");
53
require_once("filter.inc");
54
require("shaper.inc");
55

    
56
if (!is_array($config['virtualip']['vip'])) {
57
        $config['virtualip']['vip'] = array();
58
}
59
$a_vip = &$config['virtualip']['vip'];
60

    
61
if (is_numericint($_GET['id']))
62
	$id = $_GET['id'];
63
if (isset($_POST['id']) && is_numericint($_POST['id']))
64
	$id = $_POST['id'];
65

    
66
function return_first_two_octets($ip) {
67
	$ip_split = explode(".", $ip);
68
	return $ip_split[0] . "." . $ip_split[1];
69
}
70

    
71
function find_last_used_vhid() {
72
	global $config, $g;
73
	$vhid = 0;
74
	foreach($config['virtualip']['vip'] as $vip) {
75
		if($vip['vhid'] > $vhid) 
76
			$vhid = $vip['vhid'];
77
	}
78
	return $vhid;
79
}
80

    
81
if (isset($id) && $a_vip[$id]) {
82
	$pconfig['mode'] = $a_vip[$id]['mode'];
83
	$pconfig['vhid'] = $a_vip[$id]['vhid'];
84
	$pconfig['advskew'] = $a_vip[$id]['advskew'];
85
	$pconfig['advbase'] = $a_vip[$id]['advbase'];
86
	$pconfig['password'] = $a_vip[$id]['password'];
87
	$pconfig['range'] = $a_vip[$id]['range'];
88
	$pconfig['subnet'] = $a_vip[$id]['subnet'];
89
	$pconfig['subnet_bits'] = $a_vip[$id]['subnet_bits'];
90
	$pconfig['noexpand'] = $a_vip[$id]['noexpand'];
91
	$pconfig['descr'] = $a_vip[$id]['descr'];
92
	$pconfig['type'] = $a_vip[$id]['type'];
93
	$pconfig['interface'] = $a_vip[$id]['interface'];
94
} else {
95
	$lastvhid = find_last_used_vhid();
96
	$lastvhid++;
97
	$pconfig['vhid'] = $lastvhid;
98
}
99

    
100
if ($_POST) {
101
	unset($input_errors);
102
	$pconfig = $_POST;
103

    
104
	/* input validation */
105
	$reqdfields = explode(" ", "mode");
106
	$reqdfieldsn = array(gettext("Type"));
107

    
108
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
109

    
110
	if ($_POST['subnet'])
111
		$_POST['subnet'] = trim($_POST['subnet']);
112

    
113
	if ($_POST['subnet']) {
114
		if (!is_ipaddr($_POST['subnet']))
115
			$input_errors[] = gettext("A valid IP address must be specified.");
116
		else if (is_ipaddr_configured($_POST['subnet'], "vip_" . $id))
117
			$input_errors[] = gettext("This IP address is being used by another interface or VIP.");
118
	}
119

    
120
	$natiflist = get_configured_interface_with_descr();
121
	foreach ($natiflist as $natif => $natdescr) {
122
		if ($_POST['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6'])))
123
			$input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
124
	}
125

    
126
	if(is_ipaddrv4($_POST['subnet'])) {
127
		if(($_POST['subnet_bits'] == "31" or $_POST['subnet_bits'] == "32") and $_POST['mode'] == "carp")
128
		 	$input_errors[] = gettext("The /31 and /32 subnet mask are invalid for CARP IPs.");
129
	}
130
	if(is_ipaddrv6($_POST['subnet'])) {
131
		if(($_POST['subnet_bits'] == "127" or $_POST['subnet_bits'] == "128")  and $_POST['mode'] == "carp")
132
		 	$input_errors[] = gettext("The /127 and /128 subnet mask are invalid for CARP IPs.");
133
	}
134

    
135
	/* ipalias and carp should not use network or broadcast address */
136
	if ($_POST['mode'] == "ipalias" || $_POST['mode'] == "carp") {
137
		if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32") {
138
			$network_addr = gen_subnet($_POST['subnet'], $_POST['subnet_bits']);
139
			$broadcast_addr = gen_subnet_max($_POST['subnet'], $_POST['subnet_bits']);
140
		} else if (is_ipaddrv6($_POST['subnet']) && $_POST['subnet_bits'] != "128" ) {
141
			$network_addr = gen_subnetv6($_POST['subnet'], $_POST['subnet_bits']);
142
			$broadcast_addr = gen_subnetv6_max($_POST['subnet'], $_POST['subnet_bits']);
143
		}
144

    
145
		if (isset($network_addr) && $_POST['subnet'] == $network_addr)
146
			$input_errors[] = gettext("You cannot use the network address for this VIP");
147
		else if (isset($broadcast_addr) && $_POST['subnet'] == $broadcast_addr)
148
			$input_errors[] = gettext("You cannot use the broadcast address for this VIP");
149
	}
150

    
151
	/* make sure new ip is within the subnet of a valid ip
152
	 * on one of our interfaces (wan, lan optX)
153
	 */
154
	switch ($_POST['mode']) {
155
	case "carp":
156
		/* verify against reusage of vhids */
157
		$idtracker = 0;
158
		foreach($config['virtualip']['vip'] as $vip) {
159
			if($vip['vhid'] == $_POST['vhid'] && $vip['interface'] == $_POST['interface'] && $idtracker <> $id)
160
				$input_errors[] = sprintf(gettext("VHID %s is already in use on interface %s. Pick a unique number on this interface."),$_POST['vhid'], convert_friendly_interface_to_friendly_descr($_POST['interface']));
161
			$idtracker++;
162
		}
163
		if (empty($_POST['password']))
164
			$input_errors[] = gettext("You must specify a CARP password that is shared between the two VHID members.");
165

    
166
		if (is_ipaddrv4($_POST['subnet'])) {
167
			$parent_ip = get_interface_ip($_POST['interface']);
168
			$parent_sn = get_interface_subnet($_POST['interface']);
169
			$subnet = gen_subnet($parent_ip, $parent_sn);
170
		} else if (is_ipaddrv6($_POST['subnet'])) {
171
			$parent_ip = get_interface_ipv6($_POST['interface']);
172
			$parent_sn = get_interface_subnetv6($_POST['interface']);
173
			$subnet = gen_subnetv6($parent_ip, $parent_sn);
174
		}
175

    
176
		if (isset($parent_ip) && !ip_in_subnet($_POST['subnet'], "{$subnet}/{$parent_sn}") && !ip_in_interface_alias_subnet($_POST['interface'], $_POST['subnet'])) {
177
			$cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ;
178
			$input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s.  Please add an IP alias in this subnet on this interface."),$cannot_find);
179
		}
180

    
181
		if ($_POST['interface'] == "lo0")
182
			$input_errors[] = gettext("For this type of vip localhost is not allowed.");
183
		if (strstr($_POST['interface'], "_vip"))
184
                        $input_errors[] = gettext("For this type of vip a carp parent is not allowed.");
185
		break;
186
	case "ipalias":
187
		if (strstr($_POST['interface'], "_vip")) {
188
			if (is_ipaddrv4($_POST['subnet'])) {
189
				$parent_ip = get_interface_ip($_POST['interface']);
190
				$parent_sn = get_interface_subnet($_POST['interface']);
191
				$subnet = gen_subnet($parent_ip, $parent_sn);
192
			} else if (is_ipaddrv6($_POST['subnet'])) {
193
				$parent_ip = get_interface_ipv6($_POST['interface']);
194
				$parent_sn = get_interface_subnetv6($_POST['interface']);
195
				$subnet = gen_subnetv6($parent_ip, $parent_sn);
196
			}
197
			if (isset($parent_ip) && !ip_in_subnet($_POST['subnet'], "{$subnet}/{$parent_sn}") &&
198
			    !ip_in_interface_alias_subnet(link_carp_interface_to_parent($_POST['interface']), $_POST['subnet'])) {
199
				$cannot_find = $_POST['subnet'] . "/" . $_POST['subnet_bits'] ;
200
				$input_errors[] = sprintf(gettext("Sorry, we could not locate an interface with a matching subnet for %s.  Please add an IP alias in this subnet on this interface."),$cannot_find);
201
			}
202
		}
203
		break;
204
	default:
205
		if ($_POST['interface'] == "lo0")
206
			$input_errors[] = gettext("For this type of vip localhost is not allowed.");
207
		if (strstr($_POST['interface'], "_vip"))
208
			$input_errors[] = gettext("For this type of VIP, a CARP parent is not allowed.");
209
		break;
210
	}
211

    
212
	if (!$input_errors) {
213
		$vipent = array();
214

    
215
		$vipent['mode'] = $_POST['mode'];
216
		$vipent['interface'] = $_POST['interface'];
217

    
218
		/* ProxyARP specific fields */
219
		if ($_POST['mode'] === "proxyarp") {
220
			if ($_POST['type'] == "range") {
221
				$vipent['range']['from'] = $_POST['range_from'];
222
				$vipent['range']['to'] = $_POST['range_to'];
223

    
224
			}
225
			$vipent['noexpand'] = isset($_POST['noexpand']);
226
		}
227

    
228
		/* CARP specific fields */
229
		if ($_POST['mode'] === "carp") {
230
			$vipent['vhid'] = $_POST['vhid'];
231
			$vipent['advskew'] = $_POST['advskew'];
232
			$vipent['advbase'] = $_POST['advbase'];
233
			$vipent['password'] = $_POST['password'];
234
		}
235

    
236
		/* Common fields */
237
		$vipent['descr'] = $_POST['descr'];
238
		if (isset($_POST['type']))
239
			$vipent['type'] = $_POST['type'];
240
		else
241
			$vipent['type'] = "single";
242

    
243
		if ($vipent['type'] == "single" || $vipent['type'] == "network") {
244
			if (!isset($_POST['subnet_bits'])) {
245
				$vipent['subnet_bits'] = "32";
246
			} else {
247
				$vipent['subnet_bits'] = $_POST['subnet_bits'];
248
			}
249
			$vipent['subnet'] = $_POST['subnet'];
250
		}
251

    
252
		if (!isset($id))
253
			$id = count($a_vip);
254
		if (file_exists("{$g['tmp_path']}/.firewall_virtual_ip.apply"))
255
			$toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.firewall_virtual_ip.apply"));
256
		else
257
			$toapplylist = array();
258

    
259
		$toapplylist[$id] = $a_vip[$id];
260
		if (!empty($a_vip[$id])) {
261
			/* modify all virtual IP rules with this address */
262
			for ($i = 0; isset($config['nat']['rule'][$i]); $i++) {
263
				if ($config['nat']['rule'][$i]['destination']['address'] == $a_vip[$id]['subnet'])
264
					$config['nat']['rule'][$i]['destination']['address'] = $vipent['subnet'];
265
			}
266
		}
267
		$a_vip[$id] = $vipent;
268

    
269
		if (write_config()) {
270
			mark_subsystem_dirty('vip');
271
			file_put_contents("{$g['tmp_path']}/.firewall_virtual_ip.apply", serialize($toapplylist));
272
		}
273
		header("Location: firewall_virtual_ip.php");
274
		exit;
275
	}
276
}
277

    
278
$pgtitle = array(gettext("Firewall"),gettext("Virtual IP Address"),gettext("Edit"));
279
include("head.inc");
280

    
281
?>
282

    
283
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
284
<script type="text/javascript" src="/javascript/jquery.ipv4v6ify.js"></script>
285
<?php include("fbegin.inc"); ?>
286
<script type="text/javascript">
287
//<![CDATA[
288
function get_radio_value(obj)
289
{
290
        for (i = 0; i < obj.length; i++) {
291
                if (obj[i].checked)
292
                        return obj[i].value;
293
        }
294
        return null;
295
}
296
function set_note(noteMessage){
297
	var note = document.getElementById("typenote");
298
	if (note.firstChild != null)
299
		note.removeChild(note.firstChild);
300
	if (noteMessage)
301
		note.appendChild(noteMessage);
302
}
303
function enable_change() {
304
	var carpnote     = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
305
	var proxyarpnote = document.createTextNode("<?=gettext("This is a CIDR block of proxy ARP addresses.");?>");
306
	var ipaliasnote  = document.createTextNode("<?=gettext("This must be the network's subnet mask. It does not specify a CIDR range.");?>");
307
	
308
	$mode = get_radio_value(document.iform.mode);
309
	
310
	document.iform.password.disabled = $mode != "carp";
311
	document.iform.vhid.disabled     = $mode != "carp";
312
	document.iform.advskew.disabled  = $mode != "carp";
313
	document.iform.advbase.disabled  = $mode != "carp";
314
	document.iform.type.disabled     = $mode in {"carp":1,"ipalias":1};
315
	
316
	if ($mode in {"carp":1,"ipalias":1})
317
		document.iform.type.selectedIndex = 0;// single-adress
318
	switch($mode)
319
	{
320
		case "carp"    : set_note(carpnote);		break;
321
		case "ipalias" : set_note(ipaliasnote);		break;
322
		case "proxyarp": set_note(proxyarpnote);	break;
323
		default: set_note(undefined);
324
	}
325
	typesel_change();
326
}
327

    
328
function typesel_change() {
329
	switch (document.iform.type.selectedIndex) {
330
	case 0: // single
331
		document.iform.subnet.disabled = 0;
332
		document.iform.subnet_bits.disabled = (get_radio_value(document.iform.mode) == "proxyarp") || (get_radio_value(document.iform.mode) == "other");
333
		document.iform.noexpand.disabled = 1;
334
		jQuery('#noexpandrow').css('display','none');
335
		break;
336
	case 1: // network
337
		document.iform.subnet.disabled = 0;
338
		document.iform.subnet_bits.disabled = 0;
339
		document.iform.noexpand.disabled = 0;
340
		jQuery('#noexpandrow').css('display','');
341
		//document.iform.range_from.disabled = 1;
342
		//document.iform.range_to.disabled = 1;
343
		break;
344
	case 2: // range
345
		document.iform.subnet.disabled = 1;
346
		document.iform.subnet_bits.disabled = 1;
347
		document.iform.noexpand.disabled = 1;
348
		jQuery('#noexpandrow').css('display','none');
349
		//document.iform.range_from.disabled = 0;
350
		//document.iform.range_to.disabled = 0;
351
		break;
352
	case 3: // IP alias
353
		document.iform.subnet.disabled = 1;
354
		document.iform.subnet_bits.disabled = 0;
355
		document.iform.noexpand.disabled = 1;
356
		jQuery('#noexpandrow').css('display','none');
357
		//document.iform.range_from.disabled = 0;
358
		//document.iform.range_to.disabled = 0;
359
		break;
360
	}
361
}
362
//]]>
363
</script>
364

    
365
<?php if ($input_errors) print_input_errors($input_errors); ?>
366
            <form action="firewall_virtual_ip_edit.php" method="post" name="iform" id="iform">
367
              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="virtual IP edit">
368
				<tr>
369
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Virtual IP");?></td>
370
				</tr>	
371
                <tr>
372
		  		  <td width="22%" valign="top" class="vncellreq"><?=gettext("Type");?></td>
373
                  <td width="78%" class="vtable">
374
					<input name="mode" type="radio" onclick="enable_change()" value="ipalias"
375
					<?php if ($pconfig['mode'] == "ipalias") echo "checked=\"checked\"";?> /> <?=gettext("IP Alias");?>
376
					<input name="mode" type="radio" onclick="enable_change()" value="carp"
377
					<?php if ($pconfig['mode'] == "carp") echo "checked=\"checked\"";?> /> <?=gettext("CARP"); ?>
378
                    <input name="mode" type="radio" onclick="enable_change()" value="proxyarp"
379
					<?php if ($pconfig['mode'] == "proxyarp") echo "checked=\"checked\"";?> /> <?=gettext("Proxy ARP"); ?>
380
					<input name="mode" type="radio" onclick="enable_change()" value="other"
381
					<?php if ($pconfig['mode'] == "other") echo "checked=\"checked\"";?> /> <?=gettext("Other");?>
382
				  </td>
383
				</tr>
384
				<tr>
385
				  <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
386
				  <td width="78%" class="vtable">
387
					<select name="interface" class="formselect">
388
					<?php 
389
					$interfaces = get_configured_interface_with_descr(false, true);
390
					$carplist = get_configured_carp_interface_list();
391
					foreach ($carplist as $cif => $carpip)
392
						if ($carpip != $pconfig['subnet'])
393
							$interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
394
					$interfaces['lo0'] = "Localhost";
395
					foreach ($interfaces as $iface => $ifacename): ?>
396
						<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
397
						<?=htmlspecialchars($ifacename);?>
398
						</option>
399
					  <?php endforeach; ?>
400
					</select>
401
				  </td>
402
                </tr>
403
                <tr>
404
                  <td valign="top" class="vncellreq"><?=gettext("IP Address(es)");?></td>
405
                  <td class="vtable">
406
                    <table border="0" cellspacing="0" cellpadding="0" summary="ip addresses">
407
                      <tr>
408
                        <td><?=gettext("Type:");?>&nbsp;&nbsp;</td>
409
                        <td><select name="type" class="formselect" onchange="typesel_change()">
410
                            <option value="single" <?php if ((!$pconfig['range'] && $pconfig['subnet_bits'] == 32) || (!isset($pconfig['subnet']))) echo "selected=\"selected\""; ?>>
411
                            <?=gettext("Single address");?></option>
412
                            <option value="network" <?php if (!$pconfig['range'] && $pconfig['subnet_bits'] != 32 && isset($pconfig['subnet'])) echo "selected=\"selected\""; ?>>
413
                            <?=gettext("Network");?></option>
414
                            <!-- XXX: Billm, don't let anyone choose this until NAT configuration screens are ready for it <option value="range" <?php if ($pconfig['range']) echo "selected=\"selected\""; ?>>
415
                            Range</option> -->
416
                          </select></td>
417
                      </tr>
418
                      <tr>
419
                        <td><?=gettext("Address:");?>&nbsp;&nbsp;</td>
420
                        <td><input name="subnet" type="text" class="formfld unknown ipv4v6" id="subnet" size="28" value="<?=htmlspecialchars($pconfig['subnet']);?>" />
421
                          /<select name="subnet_bits" class="formselect ipv4v6" id="select">
422
                            <?php for ($i = 128; $i >= 1; $i--): ?>
423
                            <option value="<?=$i;?>" <?php if ($i == $pconfig['subnet_bits']) echo "selected=\"selected\""; ?>>
424
                            <?=$i;?>
425
                      </option>
426
                            <?php endfor; ?>
427
                      </select> <i id="typenote"></i>
428
 						</td>
429
                      </tr>
430
                      <tr id="noexpandrow">
431
                        <td><?=gettext("Expansion:");?>&nbsp;&nbsp;</td>
432
                        <td><input name="noexpand" type="checkbox" class="formfld unknown" id="noexpand" <?php echo (isset($pconfig['noexpand'])) ? "checked=\"checked\"" : "" ; ?> />
433
                        	Disable expansion of this entry into IPs on NAT lists (e.g. 192.168.1.0/24 expands to 256 entries.)
434
                        	</td>
435
                      </tr>
436
		      <?php
437
		      /*
438
                        <tr>
439
                         <td>Range:&nbsp;&nbsp;</td>
440
                          <td><input name="range_from" type="text" class="formfld unknown" id="range_from" size="28" value="<?=htmlspecialchars($pconfig['range']['from']);?>" />
441
-
442
                          <input name="range_to" type="text" class="formfld unknown" id="range_to" size="28" value="<?=htmlspecialchars($pconfig['range']['to']);?>" />
443
                          </td>
444
			 </tr>
445
  		       */
446
			?>
447
                    </table>
448
                  </td>
449
                </tr>
450
				<tr valign="top">
451
				  <td width="22%" class="vncellreq"><?=gettext("Virtual IP Password");?></td>
452
				  <td class="vtable"><input type='password'  name='password' value="<?=htmlspecialchars($pconfig['password']);?>" />
453
					<br/><?=gettext("Enter the VHID group password.");?>
454
				  </td>
455
				</tr>
456
				<tr valign="top">
457
				  <td width="22%" class="vncellreq"><?=gettext("VHID Group");?></td>
458
				  <td class="vtable"><select id='vhid' name='vhid'>
459
                            <?php for ($i = 1; $i <= 255; $i++): ?>
460
                            <option value="<?=$i;?>" <?php if ($i == $pconfig['vhid']) echo "selected=\"selected\""; ?>>
461
                            <?=$i;?>
462
                      </option>
463
                            <?php endfor; ?>
464
                      </select>
465
					<br/><?=gettext("Enter the VHID group that the machines will share");?>
466
				  </td>
467
				</tr>
468
				<tr valign="top">
469
				  <td width="22%" class="vncellreq"><?=gettext("Advertising Frequency");?></td>
470
				  <td class="vtable">
471
					 Base: <select id='advbase' name='advbase'>
472
                            <?php for ($i = 1; $i <= 254; $i++): ?>
473
                            	<option value="<?=$i;?>" <?php if ($i == $pconfig['advbase']) echo "selected=\"selected\""; ?>>
474
                            <?=$i;?>
475
                      			</option>
476
                            <?php endfor; ?>
477
                      		</select>
478
					Skew: <select id='advskew' name='advskew'>
479
                            <?php for ($i = 0; $i <= 254; $i++): ?>
480
                            	<option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected=\"selected\""; ?>>
481
                            <?=$i;?>
482
                      			</option>
483
                            <?php endfor; ?>
484
                      		</select>
485
				<br/><br/>
486
				<?=gettext("The frequency that this machine will advertise.  0 means usually master. Otherwise the lowest combination of both values in the cluster determines the master.");?>
487
				  </td>
488
				</tr>
489
                <tr>
490
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
491
                  <td width="78%" class="vtable">
492
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
493
                    <br/> <span class="vexpl"><?=gettext("You may enter a description here for your reference (not parsed).");?></span></td>
494
                </tr>
495
                <tr>
496
                  <td width="22%" valign="top">&nbsp;</td>
497
                  <td width="78%">
498
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
499
                    <?php if (isset($id) && $a_vip[$id]): ?>
500
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
501
                    <?php endif; ?>
502
                  </td>
503
                </tr>
504
				<tr>
505
				  <td colspan="4">
506
				      	<span class="vexpl">
507
				      		<span class="red">
508
							<b><?=gettext("Note:");?><br/></b>
509
				      		</span>&nbsp;&nbsp;
510
				      		<?=gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc.  Use a CARP or IP Alias type address for these cases.");?>
511
				      		<br/><br/>&nbsp;&nbsp;&nbsp;<?=gettext("For more information on CARP and the above values, visit the OpenBSD ");?><a href='http://www.openbsd.org/faq/pf/carp.html'> <?=gettext("CARP FAQ"); ?></a>.
512
						</span>
513
				  </td>
514
				</tr>
515

    
516
              </table>
517
</form>
518
<script type="text/javascript">
519
//<![CDATA[
520
enable_change();
521
//]]>
522
</script>
523
<?php include("fend.inc"); ?>
524
</body>
525
</html>
(79-79/246)