Project

General

Profile

Download (32.3 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php
2 e2cd32df Scott Ullrich
<?php
3 5b237745 Scott Ullrich
/*
4
	interfaces_wan.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6 e2cd32df Scott Ullrich
7 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9 e2cd32df Scott Ullrich
10 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12 e2cd32df Scott Ullrich
13 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15 e2cd32df Scott Ullrich
16 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19 e2cd32df Scott Ullrich
20 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
32
require("guiconfig.inc");
33
34
$wancfg = &$config['interfaces']['wan'];
35
$optcfg = &$config['interfaces']['wan'];
36
37
$pconfig['username'] = $config['pppoe']['username'];
38
$pconfig['password'] = $config['pppoe']['password'];
39
$pconfig['provider'] = $config['pppoe']['provider'];
40 a23d7248 Scott Ullrich
$pconfig['pppoe_dialondemand'] = isset($config['pppoe']['ondemand']);
41 5b237745 Scott Ullrich
$pconfig['pppoe_idletimeout'] = $config['pppoe']['timeout'];
42
43
$pconfig['pptp_username'] = $config['pptp']['username'];
44
$pconfig['pptp_password'] = $config['pptp']['password'];
45
$pconfig['pptp_local'] = $config['pptp']['local'];
46
$pconfig['pptp_subnet'] = $config['pptp']['subnet'];
47
$pconfig['pptp_remote'] = $config['pptp']['remote'];
48 a23d7248 Scott Ullrich
$pconfig['pptp_dialondemand'] = isset($config['pptp']['ondemand']);
49 5b237745 Scott Ullrich
$pconfig['pptp_idletimeout'] = $config['pptp']['timeout'];
50
51
$pconfig['bigpond_username'] = $config['bigpond']['username'];
52
$pconfig['bigpond_password'] = $config['bigpond']['password'];
53
$pconfig['bigpond_authserver'] = $config['bigpond']['authserver'];
54
$pconfig['bigpond_authdomain'] = $config['bigpond']['authdomain'];
55
$pconfig['bigpond_minheartbeatinterval'] = $config['bigpond']['minheartbeatinterval'];
56
57
$pconfig['dhcphostname'] = $wancfg['dhcphostname'];
58
59
if ($wancfg['ipaddr'] == "dhcp") {
60
	$pconfig['type'] = "DHCP";
61
} else if ($wancfg['ipaddr'] == "pppoe") {
62
	$pconfig['type'] = "PPPoE";
63
} else if ($wancfg['ipaddr'] == "pptp") {
64
	$pconfig['type'] = "PPTP";
65
} else if ($wancfg['ipaddr'] == "bigpond") {
66
	$pconfig['type'] = "BigPond";
67
} else {
68
	$pconfig['type'] = "Static";
69
	$pconfig['ipaddr'] = $wancfg['ipaddr'];
70
	$pconfig['subnet'] = $wancfg['subnet'];
71
	$pconfig['gateway'] = $wancfg['gateway'];
72 a23d7248 Scott Ullrich
	$pconfig['pointtopoint'] = $wancfg['pointtopoint'];
73 5b237745 Scott Ullrich
}
74
75
$pconfig['blockpriv'] = isset($wancfg['blockpriv']);
76
$pconfig['spoofmac'] = $wancfg['spoofmac'];
77
$pconfig['mtu'] = $wancfg['mtu'];
78
79
/* Wireless interface? */
80
if (isset($optcfg['wireless'])) {
81
	require("interfaces_wlan.inc");
82
	wireless_config_init();
83
}
84
85
if ($_POST) {
86
87
	unset($input_errors);
88
	$pconfig = $_POST;
89
90
	/* input validation */
91
	if ($_POST['type'] == "Static") {
92
		$reqdfields = explode(" ", "ipaddr subnet gateway");
93
		$reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway");
94
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
95
	} else if ($_POST['type'] == "PPPoE") {
96
		if ($_POST['pppoe_dialondemand']) {
97
			$reqdfields = explode(" ", "username password pppoe_dialondemand pppoe_idletimeout");
98
			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password,Dial on demand,Idle timeout value");
99
		} else {
100
			$reqdfields = explode(" ", "username password");
101
			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password");
102
		}
103
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
104
	} else if ($_POST['type'] == "PPTP") {
105
		if ($_POST['pptp_dialondemand']) {
106
			$reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote pptp_dialondemand pptp_idletimeout");
107
			$reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address,Dial on demand,Idle timeout value");
108
		} else {
109
			$reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote");
110
			$reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address");
111
		}
112
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
113
	} else if ($_POST['type'] == "BigPond") {
114
		$reqdfields = explode(" ", "bigpond_username bigpond_password");
115
		$reqdfieldsn = explode(",", "BigPond username,BigPond password");
116
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
117
	}
118 e2cd32df Scott Ullrich
119 5b237745 Scott Ullrich
	if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
120
		$input_errors[] = "A valid IP address must be specified.";
121
	}
122
	if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) {
123
		$input_errors[] = "A valid subnet bit count must be specified.";
124
	}
125
	if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) {
126
		$input_errors[] = "A valid gateway must be specified.";
127
	}
128 a23d7248 Scott Ullrich
	if (($_POST['pointtopoint'] && !is_ipaddr($_POST['pointtopoint']))) {
129
		$input_errors[] = "A valid point-to-point IP address must be specified.";
130
	}
131 5b237745 Scott Ullrich
	if (($_POST['provider'] && !is_domain($_POST['provider']))) {
132
		$input_errors[] = "The service name contains invalid characters.";
133
	}
134 a23d7248 Scott Ullrich
	if (($_POST['pppoe_idletimeout'] != "") && !is_numericint($_POST['pppoe_idletimeout'])) {
135 5b237745 Scott Ullrich
		$input_errors[] = "The idle timeout value must be an integer.";
136
	}
137
	if (($_POST['pptp_local'] && !is_ipaddr($_POST['pptp_local']))) {
138
		$input_errors[] = "A valid PPTP local IP address must be specified.";
139
	}
140
	if (($_POST['pptp_subnet'] && !is_numeric($_POST['pptp_subnet']))) {
141
		$input_errors[] = "A valid PPTP subnet bit count must be specified.";
142
	}
143
	if (($_POST['pptp_remote'] && !is_ipaddr($_POST['pptp_remote']))) {
144
		$input_errors[] = "A valid PPTP remote IP address must be specified.";
145
	}
146 a23d7248 Scott Ullrich
	if (($_POST['pptp_idletimeout'] != "") && !is_numericint($_POST['pptp_idletimeout'])) {
147 5b237745 Scott Ullrich
		$input_errors[] = "The idle timeout value must be an integer.";
148
	}
149
	if (($_POST['bigpond_authserver'] && !is_domain($_POST['bigpond_authserver']))) {
150
		$input_errors[] = "The authentication server name contains invalid characters.";
151
	}
152
	if (($_POST['bigpond_authdomain'] && !is_domain($_POST['bigpond_authdomain']))) {
153
		$input_errors[] = "The authentication domain name contains invalid characters.";
154
	}
155
	if ($_POST['bigpond_minheartbeatinterval'] && !is_numericint($_POST['bigpond_minheartbeatinterval'])) {
156
		$input_errors[] = "The minimum heartbeat interval must be an integer.";
157
	}
158
	if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) {
159
		$input_errors[] = "A valid MAC address must be specified.";
160
	}
161
	if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) {
162
		$input_errors[] = "The MTU must be between 576 and 1500 bytes.";
163
	}
164 e2cd32df Scott Ullrich
165 5b237745 Scott Ullrich
	/* Wireless interface? */
166
	if (isset($optcfg['wireless'])) {
167
		$wi_input_errors = wireless_config_post();
168
		if ($wi_input_errors) {
169
			$input_errors = array_merge($input_errors, $wi_input_errors);
170
		}
171
	}
172
173
	if (!$input_errors) {
174 e2cd32df Scott Ullrich
175 5b237745 Scott Ullrich
		unset($wancfg['ipaddr']);
176
		unset($wancfg['subnet']);
177
		unset($wancfg['gateway']);
178 a23d7248 Scott Ullrich
		unset($wancfg['pointtopoint']);
179 5b237745 Scott Ullrich
		unset($wancfg['dhcphostname']);
180
		unset($config['pppoe']['username']);
181
		unset($config['pppoe']['password']);
182
		unset($config['pppoe']['provider']);
183
		unset($config['pppoe']['ondemand']);
184
		unset($config['pppoe']['timeout']);
185
		unset($config['pptp']['username']);
186
		unset($config['pptp']['password']);
187
		unset($config['pptp']['local']);
188
		unset($config['pptp']['subnet']);
189
		unset($config['pptp']['remote']);
190
		unset($config['pptp']['ondemand']);
191
		unset($config['pptp']['timeout']);
192
		unset($config['bigpond']['username']);
193
		unset($config['bigpond']['password']);
194
		unset($config['bigpond']['authserver']);
195
		unset($config['bigpond']['authdomain']);
196
		unset($config['bigpond']['minheartbeatinterval']);
197 e2cd32df Scott Ullrich
198 5b237745 Scott Ullrich
		if ($_POST['type'] == "Static") {
199
			$wancfg['ipaddr'] = $_POST['ipaddr'];
200
			$wancfg['subnet'] = $_POST['subnet'];
201
			$wancfg['gateway'] = $_POST['gateway'];
202 a23d7248 Scott Ullrich
			if (isset($wancfg['ispointtopoint']))
203
				$wancfg['pointtopoint'] = $_POST['pointtopoint'];
204 5b237745 Scott Ullrich
		} else if ($_POST['type'] == "DHCP") {
205
			$wancfg['ipaddr'] = "dhcp";
206
			$wancfg['dhcphostname'] = $_POST['dhcphostname'];
207
		} else if ($_POST['type'] == "PPPoE") {
208
			$wancfg['ipaddr'] = "pppoe";
209
			$config['pppoe']['username'] = $_POST['username'];
210
			$config['pppoe']['password'] = $_POST['password'];
211
			$config['pppoe']['provider'] = $_POST['provider'];
212 a23d7248 Scott Ullrich
			$config['pppoe']['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
213 5b237745 Scott Ullrich
			$config['pppoe']['timeout'] = $_POST['pppoe_idletimeout'];
214
		} else if ($_POST['type'] == "PPTP") {
215
			$wancfg['ipaddr'] = "pptp";
216
			$config['pptp']['username'] = $_POST['pptp_username'];
217
			$config['pptp']['password'] = $_POST['pptp_password'];
218
			$config['pptp']['local'] = $_POST['pptp_local'];
219
			$config['pptp']['subnet'] = $_POST['pptp_subnet'];
220
			$config['pptp']['remote'] = $_POST['pptp_remote'];
221 a23d7248 Scott Ullrich
			$config['pptp']['ondemand'] = $_POST['pptp_dialondemand'] ? true : false;
222 5b237745 Scott Ullrich
			$config['pptp']['timeout'] = $_POST['pptp_idletimeout'];
223
		} else if ($_POST['type'] == "BigPond") {
224
			$wancfg['ipaddr'] = "bigpond";
225
			$config['bigpond']['username'] = $_POST['bigpond_username'];
226
			$config['bigpond']['password'] = $_POST['bigpond_password'];
227
			$config['bigpond']['authserver'] = $_POST['bigpond_authserver'];
228
			$config['bigpond']['authdomain'] = $_POST['bigpond_authdomain'];
229
			$config['bigpond']['minheartbeatinterval'] = $_POST['bigpond_minheartbeatinterval'];
230
		}
231 e2cd32df Scott Ullrich
232 9ce0cacc Scott Ullrich
		$wancfg['schedulertype'] = $_POST['schedulertype'];
233
		$wancfg['bandwidth'] = $_POST['bandwidth'];
234
		$wancfg['bandwidthtype'] = $_POST['bandwidthtype'];
235
236 5b237745 Scott Ullrich
		$wancfg['blockpriv'] = $_POST['blockpriv'] ? true : false;
237
		$wancfg['spoofmac'] = $_POST['spoofmac'];
238
		$wancfg['mtu'] = $_POST['mtu'];
239 e2cd32df Scott Ullrich
240 5b237745 Scott Ullrich
		write_config();
241 e2cd32df Scott Ullrich
242 5b237745 Scott Ullrich
		$retval = 0;
243
		if (!file_exists($d_sysrebootreqd_path)) {
244
			config_lock();
245
			$retval = interfaces_wan_configure();
246
			config_unlock();
247
		}
248
		$savemsg = get_std_save_message($retval);
249
	}
250
}
251
?>
252
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
253
<html>
254
<head>
255
<title><?=gentitle("Interfaces: WAN");?></title>
256
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
257
<link href="gui.css" rel="stylesheet" type="text/css">
258
<script language="JavaScript">
259
<!--
260
function enable_change(enable_change) {
261
	if (document.iform.pppoe_dialondemand.checked || enable_change) {
262
		document.iform.pppoe_idletimeout.disabled = 0;
263
	} else {
264
		document.iform.pppoe_idletimeout.disabled = 1;
265
	}
266
}
267
268
function enable_change_pptp(enable_change_pptp) {
269
	if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
270
		document.iform.pptp_idletimeout.disabled = 0;
271
		document.iform.pptp_local.disabled = 0;
272
		document.iform.pptp_remote.disabled = 0;
273
	} else {
274
		document.iform.pptp_idletimeout.disabled = 1;
275
	}
276
}
277
278
function type_change(enable_change,enable_change_pptp) {
279
	switch (document.iform.type.selectedIndex) {
280
		case 0:
281
			document.iform.username.disabled = 1;
282
			document.iform.password.disabled = 1;
283
			document.iform.provider.disabled = 1;
284
			document.iform.pppoe_dialondemand.disabled = 1;
285
			document.iform.pppoe_idletimeout.disabled = 1;
286
			document.iform.ipaddr.disabled = 0;
287
			document.iform.subnet.disabled = 0;
288
			document.iform.gateway.disabled = 0;
289
			document.iform.pptp_username.disabled = 1;
290
			document.iform.pptp_password.disabled = 1;
291
			document.iform.pptp_local.disabled = 1;
292
			document.iform.pptp_subnet.disabled = 1;
293
			document.iform.pptp_remote.disabled = 1;
294
			document.iform.pptp_dialondemand.disabled = 1;
295
			document.iform.pptp_idletimeout.disabled = 1;
296
			document.iform.bigpond_username.disabled = 1;
297
			document.iform.bigpond_password.disabled = 1;
298
			document.iform.bigpond_authserver.disabled = 1;
299
			document.iform.bigpond_authdomain.disabled = 1;
300
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
301
			document.iform.dhcphostname.disabled = 1;
302
			break;
303
		case 1:
304
			document.iform.username.disabled = 1;
305
			document.iform.password.disabled = 1;
306
			document.iform.provider.disabled = 1;
307
			document.iform.pppoe_dialondemand.disabled = 1;
308
			document.iform.pppoe_idletimeout.disabled = 1;
309
			document.iform.ipaddr.disabled = 1;
310
			document.iform.subnet.disabled = 1;
311
			document.iform.gateway.disabled = 1;
312
			document.iform.pptp_username.disabled = 1;
313
			document.iform.pptp_password.disabled = 1;
314
			document.iform.pptp_local.disabled = 1;
315
			document.iform.pptp_subnet.disabled = 1;
316
			document.iform.pptp_remote.disabled = 1;
317
			document.iform.pptp_dialondemand.disabled = 1;
318
			document.iform.pptp_idletimeout.disabled = 1;
319
			document.iform.bigpond_username.disabled = 1;
320
			document.iform.bigpond_password.disabled = 1;
321
			document.iform.bigpond_authserver.disabled = 1;
322
			document.iform.bigpond_authdomain.disabled = 1;
323
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
324
			document.iform.dhcphostname.disabled = 0;
325
			break;
326
		case 2:
327
			document.iform.username.disabled = 0;
328
			document.iform.password.disabled = 0;
329
			document.iform.provider.disabled = 0;
330
			document.iform.pppoe_dialondemand.disabled = 0;
331
			if (document.iform.pppoe_dialondemand.checked || enable_change) {
332
				document.iform.pppoe_idletimeout.disabled = 0;
333
			} else {
334
				document.iform.pppoe_idletimeout.disabled = 1;
335
			}
336
			document.iform.ipaddr.disabled = 1;
337
			document.iform.subnet.disabled = 1;
338
			document.iform.gateway.disabled = 1;
339
			document.iform.pptp_username.disabled = 1;
340
			document.iform.pptp_password.disabled = 1;
341
			document.iform.pptp_local.disabled = 1;
342
			document.iform.pptp_subnet.disabled = 1;
343
			document.iform.pptp_remote.disabled = 1;
344
			document.iform.pptp_dialondemand.disabled = 1;
345
			document.iform.pptp_idletimeout.disabled = 1;
346
			document.iform.bigpond_username.disabled = 1;
347
			document.iform.bigpond_password.disabled = 1;
348
			document.iform.bigpond_authserver.disabled = 1;
349
			document.iform.bigpond_authdomain.disabled = 1;
350
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
351
			document.iform.dhcphostname.disabled = 1;
352
			break;
353
		case 3:
354
			document.iform.username.disabled = 1;
355
			document.iform.password.disabled = 1;
356
			document.iform.provider.disabled = 1;
357
			document.iform.pppoe_dialondemand.disabled = 1;
358
			document.iform.pppoe_idletimeout.disabled = 1;
359
			document.iform.ipaddr.disabled = 1;
360
			document.iform.subnet.disabled = 1;
361
			document.iform.gateway.disabled = 1;
362
			document.iform.pptp_username.disabled = 0;
363
			document.iform.pptp_password.disabled = 0;
364
			document.iform.pptp_local.disabled = 0;
365
			document.iform.pptp_subnet.disabled = 0;
366
			document.iform.pptp_remote.disabled = 0;
367
			document.iform.pptp_dialondemand.disabled = 0;
368
			if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
369
				document.iform.pptp_idletimeout.disabled = 0;
370
			} else {
371
				document.iform.pptp_idletimeout.disabled = 1;
372
			}
373
			document.iform.bigpond_username.disabled = 1;
374
			document.iform.bigpond_password.disabled = 1;
375
			document.iform.bigpond_authserver.disabled = 1;
376
			document.iform.bigpond_authdomain.disabled = 1;
377
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
378
			document.iform.dhcphostname.disabled = 1;
379
			break;
380
		case 4:
381
			document.iform.username.disabled = 1;
382
			document.iform.password.disabled = 1;
383
			document.iform.provider.disabled = 1;
384
			document.iform.pppoe_dialondemand.disabled = 1;
385
			document.iform.pppoe_idletimeout.disabled = 1;
386
			document.iform.ipaddr.disabled = 1;
387
			document.iform.subnet.disabled = 1;
388
			document.iform.gateway.disabled = 1;
389
			document.iform.pptp_username.disabled = 1;
390
			document.iform.pptp_password.disabled = 1;
391
			document.iform.pptp_local.disabled = 1;
392
			document.iform.pptp_subnet.disabled = 1;
393
			document.iform.pptp_remote.disabled = 1;
394
			document.iform.pptp_dialondemand.disabled = 1;
395
			document.iform.pptp_idletimeout.disabled = 1;
396
			document.iform.bigpond_username.disabled = 0;
397
			document.iform.bigpond_password.disabled = 0;
398
			document.iform.bigpond_authserver.disabled = 0;
399
			document.iform.bigpond_authdomain.disabled = 0;
400
			document.iform.bigpond_minheartbeatinterval.disabled = 0;
401
			document.iform.dhcphostname.disabled = 1;
402
			break;
403
	}
404
}
405
//-->
406
</script>
407
</head>
408
409
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
410
<?php include("fbegin.inc"); ?>
411
<p class="pgtitle">Interfaces: WAN</p>
412
<?php if ($input_errors) print_input_errors($input_errors); ?>
413
<?php if ($savemsg) print_info_box($savemsg); ?>
414
            <form action="interfaces_wan.php" method="post" name="iform" id="iform">
415
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
416 e2cd32df Scott Ullrich
                <tr>
417 5b237745 Scott Ullrich
                  <td valign="middle"><strong>Type</strong></td>
418
                  <td> <select name="type" class="formfld" id="type" onchange="type_change()">
419
                      <?php $opts = split(" ", "Static DHCP PPPoE PPTP BigPond");
420
				foreach ($opts as $opt): ?>
421 e2cd32df Scott Ullrich
                      <option <?php if ($opt == $pconfig['type']) echo "selected";?>>
422 5b237745 Scott Ullrich
                      <?=htmlspecialchars($opt);?>
423
                      </option>
424
                      <?php endforeach; ?>
425
                    </select></td>
426
                </tr>
427 e2cd32df Scott Ullrich
                <tr>
428 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="4"></td>
429
                </tr>
430 e2cd32df Scott Ullrich
                <tr>
431 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">General configuration</td>
432 5b237745 Scott Ullrich
                </tr>
433 e2cd32df Scott Ullrich
                <tr>
434 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">MAC address</td>
435 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
436 5b237745 Scott Ullrich
                    <br>
437 e2cd32df Scott Ullrich
                    This field can be used to modify (&quot;spoof&quot;) the MAC
438 5b237745 Scott Ullrich
                    address of the WAN interface<br>
439
                    (may be required with some cable connections)<br>
440 e2cd32df Scott Ullrich
                    Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
441 5b237745 Scott Ullrich
                    or leave blank</td>
442
                </tr>
443 e2cd32df Scott Ullrich
                <tr>
444 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">MTU</td>
445 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="mtu" type="text" class="formfld" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
446 5b237745 Scott Ullrich
                    <br>
447 e2cd32df Scott Ullrich
                    If you enter a value in this field, then MSS clamping for
448
                    TCP connections to the value entered above minus 40 (TCP/IP
449
                    header size) will be in effect. If you leave this field blank,
450
                    an MTU of 1492 bytes for PPPoE and 1500 bytes for all other
451 5b237745 Scott Ullrich
                    connection types will be assumed.</td>
452
                </tr>
453 e2cd32df Scott Ullrich
                <tr>
454 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
455
                </tr>
456 e2cd32df Scott Ullrich
                <tr>
457 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">Static IP configuration</td>
458 5b237745 Scott Ullrich
                </tr>
459 e2cd32df Scott Ullrich
                <tr>
460 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">IP address</td>
461
                  <td class="vtable"> <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
462 e2cd32df Scott Ullrich
                    /
463 5b237745 Scott Ullrich
                    <select name="subnet" class="formfld" id="subnet">
464 a23d7248 Scott Ullrich
                    <?php
465
                      if (isset($wancfg['ispointtopoint']))
466
                      	$snmax = 32;
467
                      else
468
                      	$snmax = 31;
469
                      for ($i = $snmax; $i > 0; $i--): ?>
470 e2cd32df Scott Ullrich
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>>
471 5b237745 Scott Ullrich
                      <?=$i;?>
472
                      </option>
473
                      <?php endfor; ?>
474
                    </select></td>
475 a23d7248 Scott Ullrich
                </tr><?php if (isset($wancfg['ispointtopoint'])): ?>
476 7f5b4824 Scott Ullrich
                <tr>
477 a23d7248 Scott Ullrich
                  <td valign="top" class="vncellreq">Point-to-point IP address </td>
478
                  <td class="vtable">
479
                    <input name="pointtopoint" type="text" class="formfld" id="pointtopoint" size="20" value="<?=htmlspecialchars($pconfig['pointtopoint']);?>">
480
                  </td>
481
                </tr><?php endif; ?>
482 e2cd32df Scott Ullrich
                <tr>
483 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Gateway</td>
484 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
485 5b237745 Scott Ullrich
                  </td>
486
                </tr>
487 e2cd32df Scott Ullrich
                <tr>
488 73c38fa2 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
489
                </tr>
490
                <tr>
491 e2cd32df Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">Bandwidth Management (Traffic Shaping)</td>
492 73c38fa2 Scott Ullrich
                </tr>
493
		<tr>
494
		  <td width="22%" valign="top" class="vncell"><b>Scheduler</b> </td>
495
		  <td width="78%" class="vtable">
496
		    <select id="schedulertype" name="schedulertype">
497
		    <?php
498
			    if($schedulertype == 'priq')
499
				    echo "<option value=\"priq\">Priority based queueing</option>";
500
			    if($schedulertype == 'cbq')
501
				    echo "<option value=\"cbq\">Class based queueing</option>";
502
			    if($schedulertype == 'hfsc')
503
				    echo "<option value=\"hfsc\">Hierarchical Fair Service Curve queueing</option>";
504
		    ?>
505
			    <option value="priq">Priority based queueing</option>
506
			    <option value="cbq">Class based queueing</option>
507
			    <option value="hfsc">Hierarchical Fair Service Curve queueing</option>
508
		    </select>
509
		    <br> <span class="vexpl">Select which type of queueing you would like to use
510
		    </span></td>
511
		</tr>
512
                <tr>
513
                  <td valign="top" class="vncell">Interface Bandwidth Speed</td>
514
                  <td class="vtable"> <input name="bandwidth" type="text" class="formfld" id="bandwidth" size="30" value="<?=htmlspecialchars($pconfig['bandwidth']);?>">
515
			<select name="bandwidthtype">
516
				<option value="<?=htmlspecialchars($pconfig['bandwidthtype']);?>"><?=htmlspecialchars($pconfig['bandwidthtype']);?></option>
517
				<option value="b">bit/s</option>
518
				<option value="Kb">Kilobit/s</option>
519
				<option value="Mb">Megabit/s</option>
520
				<option value="Gb">Gigabit/s</option>
521
			</select>
522
			<br> The bandwidth setting will define the speed of the interface for traffic shaping.
523
		  </td>
524
                </tr>
525 e2cd32df Scott Ullrich
                <tr>
526 9ce0cacc Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
527 e2cd32df Scott Ullrich
                </tr>
528
                <tr>
529 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
530 5b237745 Scott Ullrich
                </tr>
531 e2cd32df Scott Ullrich
                <tr>
532 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Hostname</td>
533
                  <td class="vtable"> <input name="dhcphostname" type="text" class="formfld" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
534
                    <br>
535 e2cd32df Scott Ullrich
                    The value in this field is sent as the DHCP client identifier
536
                    and hostname when requesting a DHCP lease. Some ISPs may require
537 5b237745 Scott Ullrich
                    this (for client identification).</td>
538
                </tr>
539 e2cd32df Scott Ullrich
                <tr>
540 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
541
                </tr>
542 e2cd32df Scott Ullrich
                <tr>
543 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">PPPoE configuration</td>
544 5b237745 Scott Ullrich
                </tr>
545 e2cd32df Scott Ullrich
                <tr>
546 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
547 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
548 5b237745 Scott Ullrich
                  </td>
549
                </tr>
550 e2cd32df Scott Ullrich
                <tr>
551 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
552 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
553 5b237745 Scott Ullrich
                  </td>
554
                </tr>
555 e2cd32df Scott Ullrich
                <tr>
556 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Service name</td>
557 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="provider" type="text" class="formfld" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
558
                    <br> <span class="vexpl">Hint: this field can usually be left
559 5b237745 Scott Ullrich
                    empty</span></td>
560
                </tr>
561 e2cd32df Scott Ullrich
                <tr>
562 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Dial on demand</td>
563 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pppoe_dialondemand" type="checkbox" id="pppoe_dialondemand" value="enable" <?php if ($pconfig['pppoe_dialondemand']) echo "checked"; ?> onClick="enable_change(false)" >
564 5b237745 Scott Ullrich
                    <strong>Enable Dial-On-Demand mode</strong><br>
565
		    This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</td>
566
                </tr>
567
                <tr>
568
                  <td valign="top" class="vncell">Idle timeout</td>
569
                  <td class="vtable">
570
                    <input name="pppoe_idletimeout" type="text" class="formfld" id="pppoe_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pppoe_idletimeout']);?>">
571
                    seconds<br>
572
    If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</td>
573
                </tr>
574 e2cd32df Scott Ullrich
                <tr>
575 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
576
                </tr>
577 e2cd32df Scott Ullrich
                <tr>
578 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">PPTP configuration</td>
579 5b237745 Scott Ullrich
                </tr>
580 e2cd32df Scott Ullrich
                <tr>
581 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
582 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pptp_username" type="text" class="formfld" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
583 5b237745 Scott Ullrich
                  </td>
584
                </tr>
585 e2cd32df Scott Ullrich
                <tr>
586 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
587 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pptp_password" type="text" class="formfld" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
588 5b237745 Scott Ullrich
                  </td>
589
                </tr>
590 e2cd32df Scott Ullrich
                <tr>
591 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">Local IP address</td>
592
                  <td class="vtable"> <input name="pptp_local" type="text" class="formfld" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
593 e2cd32df Scott Ullrich
                    /
594 5b237745 Scott Ullrich
                    <select name="pptp_subnet" class="formfld" id="pptp_subnet">
595 a23d7248 Scott Ullrich
                      <?php for ($i = 31; $i > 0; $i--): ?>
596 e2cd32df Scott Ullrich
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>>
597 5b237745 Scott Ullrich
                      <?=$i;?>
598
                      </option>
599
                      <?php endfor; ?>
600
                    </select></td>
601
                </tr>
602 e2cd32df Scott Ullrich
                <tr>
603 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">Remote IP address</td>
604 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="pptp_remote" type="text" class="formfld" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
605 5b237745 Scott Ullrich
                  </td>
606
                </tr>
607 e2cd32df Scott Ullrich
                <tr>
608 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Dial on demand</td>
609 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pptp_dialondemand" type="checkbox" id="pptp_dialondemand" value="enable" <?php if ($pconfig['pptp_dialondemand']) echo "checked"; ?> onClick="enable_change_pptp(false)" >
610 5b237745 Scott Ullrich
                    <strong>Enable Dial-On-Demand mode</strong><br>
611
		    This option causes the interface to operate in dial-on-demand mode, allowing you to have a <i>virtual full time</i> connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</td>
612
                </tr>
613
                <tr>
614
                  <td valign="top" class="vncell">Idle timeout</td>
615
                  <td class="vtable">
616
                    <input name="pptp_idletimeout" type="text" class="formfld" id="pptp_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pptp_idletimeout']);?>">
617
                    seconds<br>
618
    If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. An idle timeout of zero disables this feature.</td>
619
                </tr>
620 e2cd32df Scott Ullrich
                <tr>
621 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
622
                </tr>
623 e2cd32df Scott Ullrich
                <tr>
624 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">BigPond Cable configuration</td>
625 5b237745 Scott Ullrich
                </tr>
626 e2cd32df Scott Ullrich
                <tr>
627 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
628 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="bigpond_username" type="text" class="formfld" id="bigpond_username" size="20" value="<?=htmlspecialchars($pconfig['bigpond_username']);?>">
629 5b237745 Scott Ullrich
                  </td>
630
                </tr>
631 e2cd32df Scott Ullrich
                <tr>
632 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
633 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="bigpond_password" type="text" class="formfld" id="bigpond_password" size="20" value="<?=htmlspecialchars($pconfig['bigpond_password']);?>">
634 5b237745 Scott Ullrich
                  </td>
635
                </tr>
636 e2cd32df Scott Ullrich
                <tr>
637 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Authentication server</td>
638
                  <td class="vtable"><input name="bigpond_authserver" type="text" class="formfld" id="bigpond_authserver" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authserver']);?>">
639
                    <br>
640
                  <span class="vexpl">If this field is left empty, the default (&quot;dce-server&quot;) is used. </span></td>
641
                </tr>
642 e2cd32df Scott Ullrich
                <tr>
643 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Authentication domain</td>
644
                  <td class="vtable"><input name="bigpond_authdomain" type="text" class="formfld" id="bigpond_authdomain" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authdomain']);?>">
645
                    <br>
646
                  <span class="vexpl">If this field is left empty, the domain name assigned via DHCP will be used.<br>
647
                  <br>
648
                  Note: the BigPond client implicitly sets the &quot;Allow DNS server list to be overridden by DHCP/PPP on WAN&quot; on the System: General setup page.            </span></td>
649
                </tr>
650
                <tr>
651
                  <td valign="top" class="vncell">Min. heartbeat interval</td>
652
                  <td class="vtable">
653
                    <input name="bigpond_minheartbeatinterval" type="text" class="formfld" id="bigpond_minheartbeatinterval" size="8" value="<?=htmlspecialchars($pconfig['bigpond_minheartbeatinterval']);?>">
654
                    seconds<br>
655
    Setting this to a sensible value (e.g. 60 seconds) can protect against DoS attacks. </td>
656
                </tr>
657
                <?php /* Wireless interface? */
658
				if (isset($optcfg['wireless']))
659
					wireless_config_print();
660
				?>
661 e2cd32df Scott Ullrich
                <tr>
662 5b237745 Scott Ullrich
                  <td height="16" colspan="2" valign="top"></td>
663
                </tr>
664 e2cd32df Scott Ullrich
                <tr>
665 5b237745 Scott Ullrich
                  <td valign="middle">&nbsp;</td>
666 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv']) echo "checked"; ?>>
667 5b237745 Scott Ullrich
                    <strong>Block private networks</strong><br>
668 e2cd32df Scott Ullrich
                    When set, this option blocks traffic from IP addresses that
669 5b237745 Scott Ullrich
                    are reserved for private<br>
670 e2cd32df Scott Ullrich
                    networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as
671 5b237745 Scott Ullrich
                    well as loopback addresses<br>
672 e2cd32df Scott Ullrich
                    (127/8). You should generally leave this option turned on,
673 5b237745 Scott Ullrich
                    unless your WAN network<br>
674
                    lies in such a private address space, too.</td>
675
                </tr>
676 e2cd32df Scott Ullrich
                <tr>
677 5b237745 Scott Ullrich
                  <td width="100" valign="top">&nbsp;</td>
678 e2cd32df Scott Ullrich
                  <td> &nbsp;<br> <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change_pptp(true)&&enable_change(true)">
679 5b237745 Scott Ullrich
                  </td>
680
                </tr>
681
              </table>
682
</form>
683
<script language="JavaScript">
684
<!--
685
type_change();
686
//-->
687
</script>
688
<?php include("fend.inc"); ?>
689
</body>
690
</html>