Project

General

Profile

Download (32.2 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 5b237745 Scott Ullrich
		$wancfg['blockpriv'] = $_POST['blockpriv'] ? true : false;
233
		$wancfg['spoofmac'] = $_POST['spoofmac'];
234
		$wancfg['mtu'] = $_POST['mtu'];
235 e2cd32df Scott Ullrich
236 5b237745 Scott Ullrich
		write_config();
237 e2cd32df Scott Ullrich
238 5b237745 Scott Ullrich
		$retval = 0;
239
		if (!file_exists($d_sysrebootreqd_path)) {
240
			config_lock();
241
			$retval = interfaces_wan_configure();
242
			config_unlock();
243
		}
244
		$savemsg = get_std_save_message($retval);
245
	}
246
}
247
?>
248
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
249
<html>
250
<head>
251
<title><?=gentitle("Interfaces: WAN");?></title>
252
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
253
<link href="gui.css" rel="stylesheet" type="text/css">
254
<script language="JavaScript">
255
<!--
256
function enable_change(enable_change) {
257
	if (document.iform.pppoe_dialondemand.checked || enable_change) {
258
		document.iform.pppoe_idletimeout.disabled = 0;
259
	} else {
260
		document.iform.pppoe_idletimeout.disabled = 1;
261
	}
262
}
263
264
function enable_change_pptp(enable_change_pptp) {
265
	if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
266
		document.iform.pptp_idletimeout.disabled = 0;
267
		document.iform.pptp_local.disabled = 0;
268
		document.iform.pptp_remote.disabled = 0;
269
	} else {
270
		document.iform.pptp_idletimeout.disabled = 1;
271
	}
272
}
273
274
function type_change(enable_change,enable_change_pptp) {
275
	switch (document.iform.type.selectedIndex) {
276
		case 0:
277
			document.iform.username.disabled = 1;
278
			document.iform.password.disabled = 1;
279
			document.iform.provider.disabled = 1;
280
			document.iform.pppoe_dialondemand.disabled = 1;
281
			document.iform.pppoe_idletimeout.disabled = 1;
282
			document.iform.ipaddr.disabled = 0;
283
			document.iform.subnet.disabled = 0;
284
			document.iform.gateway.disabled = 0;
285
			document.iform.pptp_username.disabled = 1;
286
			document.iform.pptp_password.disabled = 1;
287
			document.iform.pptp_local.disabled = 1;
288
			document.iform.pptp_subnet.disabled = 1;
289
			document.iform.pptp_remote.disabled = 1;
290
			document.iform.pptp_dialondemand.disabled = 1;
291
			document.iform.pptp_idletimeout.disabled = 1;
292
			document.iform.bigpond_username.disabled = 1;
293
			document.iform.bigpond_password.disabled = 1;
294
			document.iform.bigpond_authserver.disabled = 1;
295
			document.iform.bigpond_authdomain.disabled = 1;
296
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
297
			document.iform.dhcphostname.disabled = 1;
298
			break;
299
		case 1:
300
			document.iform.username.disabled = 1;
301
			document.iform.password.disabled = 1;
302
			document.iform.provider.disabled = 1;
303
			document.iform.pppoe_dialondemand.disabled = 1;
304
			document.iform.pppoe_idletimeout.disabled = 1;
305
			document.iform.ipaddr.disabled = 1;
306
			document.iform.subnet.disabled = 1;
307
			document.iform.gateway.disabled = 1;
308
			document.iform.pptp_username.disabled = 1;
309
			document.iform.pptp_password.disabled = 1;
310
			document.iform.pptp_local.disabled = 1;
311
			document.iform.pptp_subnet.disabled = 1;
312
			document.iform.pptp_remote.disabled = 1;
313
			document.iform.pptp_dialondemand.disabled = 1;
314
			document.iform.pptp_idletimeout.disabled = 1;
315
			document.iform.bigpond_username.disabled = 1;
316
			document.iform.bigpond_password.disabled = 1;
317
			document.iform.bigpond_authserver.disabled = 1;
318
			document.iform.bigpond_authdomain.disabled = 1;
319
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
320
			document.iform.dhcphostname.disabled = 0;
321
			break;
322
		case 2:
323
			document.iform.username.disabled = 0;
324
			document.iform.password.disabled = 0;
325
			document.iform.provider.disabled = 0;
326
			document.iform.pppoe_dialondemand.disabled = 0;
327
			if (document.iform.pppoe_dialondemand.checked || enable_change) {
328
				document.iform.pppoe_idletimeout.disabled = 0;
329
			} else {
330
				document.iform.pppoe_idletimeout.disabled = 1;
331
			}
332
			document.iform.ipaddr.disabled = 1;
333
			document.iform.subnet.disabled = 1;
334
			document.iform.gateway.disabled = 1;
335
			document.iform.pptp_username.disabled = 1;
336
			document.iform.pptp_password.disabled = 1;
337
			document.iform.pptp_local.disabled = 1;
338
			document.iform.pptp_subnet.disabled = 1;
339
			document.iform.pptp_remote.disabled = 1;
340
			document.iform.pptp_dialondemand.disabled = 1;
341
			document.iform.pptp_idletimeout.disabled = 1;
342
			document.iform.bigpond_username.disabled = 1;
343
			document.iform.bigpond_password.disabled = 1;
344
			document.iform.bigpond_authserver.disabled = 1;
345
			document.iform.bigpond_authdomain.disabled = 1;
346
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
347
			document.iform.dhcphostname.disabled = 1;
348
			break;
349
		case 3:
350
			document.iform.username.disabled = 1;
351
			document.iform.password.disabled = 1;
352
			document.iform.provider.disabled = 1;
353
			document.iform.pppoe_dialondemand.disabled = 1;
354
			document.iform.pppoe_idletimeout.disabled = 1;
355
			document.iform.ipaddr.disabled = 1;
356
			document.iform.subnet.disabled = 1;
357
			document.iform.gateway.disabled = 1;
358
			document.iform.pptp_username.disabled = 0;
359
			document.iform.pptp_password.disabled = 0;
360
			document.iform.pptp_local.disabled = 0;
361
			document.iform.pptp_subnet.disabled = 0;
362
			document.iform.pptp_remote.disabled = 0;
363
			document.iform.pptp_dialondemand.disabled = 0;
364
			if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
365
				document.iform.pptp_idletimeout.disabled = 0;
366
			} else {
367
				document.iform.pptp_idletimeout.disabled = 1;
368
			}
369
			document.iform.bigpond_username.disabled = 1;
370
			document.iform.bigpond_password.disabled = 1;
371
			document.iform.bigpond_authserver.disabled = 1;
372
			document.iform.bigpond_authdomain.disabled = 1;
373
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
374
			document.iform.dhcphostname.disabled = 1;
375
			break;
376
		case 4:
377
			document.iform.username.disabled = 1;
378
			document.iform.password.disabled = 1;
379
			document.iform.provider.disabled = 1;
380
			document.iform.pppoe_dialondemand.disabled = 1;
381
			document.iform.pppoe_idletimeout.disabled = 1;
382
			document.iform.ipaddr.disabled = 1;
383
			document.iform.subnet.disabled = 1;
384
			document.iform.gateway.disabled = 1;
385
			document.iform.pptp_username.disabled = 1;
386
			document.iform.pptp_password.disabled = 1;
387
			document.iform.pptp_local.disabled = 1;
388
			document.iform.pptp_subnet.disabled = 1;
389
			document.iform.pptp_remote.disabled = 1;
390
			document.iform.pptp_dialondemand.disabled = 1;
391
			document.iform.pptp_idletimeout.disabled = 1;
392
			document.iform.bigpond_username.disabled = 0;
393
			document.iform.bigpond_password.disabled = 0;
394
			document.iform.bigpond_authserver.disabled = 0;
395
			document.iform.bigpond_authdomain.disabled = 0;
396
			document.iform.bigpond_minheartbeatinterval.disabled = 0;
397
			document.iform.dhcphostname.disabled = 1;
398
			break;
399
	}
400
}
401
//-->
402
</script>
403
</head>
404
405
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
406
<?php include("fbegin.inc"); ?>
407
<p class="pgtitle">Interfaces: WAN</p>
408
<?php if ($input_errors) print_input_errors($input_errors); ?>
409
<?php if ($savemsg) print_info_box($savemsg); ?>
410
            <form action="interfaces_wan.php" method="post" name="iform" id="iform">
411
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
412 e2cd32df Scott Ullrich
                <tr>
413 5b237745 Scott Ullrich
                  <td valign="middle"><strong>Type</strong></td>
414
                  <td> <select name="type" class="formfld" id="type" onchange="type_change()">
415
                      <?php $opts = split(" ", "Static DHCP PPPoE PPTP BigPond");
416
				foreach ($opts as $opt): ?>
417 e2cd32df Scott Ullrich
                      <option <?php if ($opt == $pconfig['type']) echo "selected";?>>
418 5b237745 Scott Ullrich
                      <?=htmlspecialchars($opt);?>
419
                      </option>
420
                      <?php endforeach; ?>
421
                    </select></td>
422
                </tr>
423 e2cd32df Scott Ullrich
                <tr>
424 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="4"></td>
425
                </tr>
426 e2cd32df Scott Ullrich
                <tr>
427 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">General configuration</td>
428 5b237745 Scott Ullrich
                </tr>
429 e2cd32df Scott Ullrich
                <tr>
430 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">MAC address</td>
431 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>">
432 5b237745 Scott Ullrich
                    <br>
433 e2cd32df Scott Ullrich
                    This field can be used to modify (&quot;spoof&quot;) the MAC
434 5b237745 Scott Ullrich
                    address of the WAN interface<br>
435
                    (may be required with some cable connections)<br>
436 e2cd32df Scott Ullrich
                    Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx
437 5b237745 Scott Ullrich
                    or leave blank</td>
438
                </tr>
439 e2cd32df Scott Ullrich
                <tr>
440 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">MTU</td>
441 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="mtu" type="text" class="formfld" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
442 5b237745 Scott Ullrich
                    <br>
443 e2cd32df Scott Ullrich
                    If you enter a value in this field, then MSS clamping for
444
                    TCP connections to the value entered above minus 40 (TCP/IP
445
                    header size) will be in effect. If you leave this field blank,
446
                    an MTU of 1492 bytes for PPPoE and 1500 bytes for all other
447 5b237745 Scott Ullrich
                    connection types will be assumed.</td>
448
                </tr>
449 e2cd32df Scott Ullrich
                <tr>
450 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
451
                </tr>
452 e2cd32df Scott Ullrich
                <tr>
453 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">Static IP configuration</td>
454 5b237745 Scott Ullrich
                </tr>
455 e2cd32df Scott Ullrich
                <tr>
456 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">IP address</td>
457
                  <td class="vtable"> <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
458 e2cd32df Scott Ullrich
                    /
459 5b237745 Scott Ullrich
                    <select name="subnet" class="formfld" id="subnet">
460 a23d7248 Scott Ullrich
                    <?php
461
                      if (isset($wancfg['ispointtopoint']))
462
                      	$snmax = 32;
463
                      else
464
                      	$snmax = 31;
465
                      for ($i = $snmax; $i > 0; $i--): ?>
466 e2cd32df Scott Ullrich
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>>
467 5b237745 Scott Ullrich
                      <?=$i;?>
468
                      </option>
469
                      <?php endfor; ?>
470
                    </select></td>
471 a23d7248 Scott Ullrich
                </tr><?php if (isset($wancfg['ispointtopoint'])): ?>
472 7f5b4824 Scott Ullrich
                <tr>
473 a23d7248 Scott Ullrich
                  <td valign="top" class="vncellreq">Point-to-point IP address </td>
474
                  <td class="vtable">
475
                    <input name="pointtopoint" type="text" class="formfld" id="pointtopoint" size="20" value="<?=htmlspecialchars($pconfig['pointtopoint']);?>">
476
                  </td>
477
                </tr><?php endif; ?>
478 e2cd32df Scott Ullrich
                <tr>
479 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Gateway</td>
480 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
481 5b237745 Scott Ullrich
                  </td>
482
                </tr>
483 e2cd32df Scott Ullrich
                <tr>
484 73c38fa2 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
485
                </tr>
486
                <tr>
487 e2cd32df Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">Bandwidth Management (Traffic Shaping)</td>
488 73c38fa2 Scott Ullrich
                </tr>
489
		<tr>
490
		  <td width="22%" valign="top" class="vncell"><b>Scheduler</b> </td>
491
		  <td width="78%" class="vtable">
492
		    <select id="schedulertype" name="schedulertype">
493
		    <?php
494
			    if($schedulertype == 'priq')
495
				    echo "<option value=\"priq\">Priority based queueing</option>";
496
			    if($schedulertype == 'cbq')
497
				    echo "<option value=\"cbq\">Class based queueing</option>";
498
			    if($schedulertype == 'hfsc')
499
				    echo "<option value=\"hfsc\">Hierarchical Fair Service Curve queueing</option>";
500
		    ?>
501
			    <option value="priq">Priority based queueing</option>
502
			    <option value="cbq">Class based queueing</option>
503
			    <option value="hfsc">Hierarchical Fair Service Curve queueing</option>
504
		    </select>
505
		    <br> <span class="vexpl">Select which type of queueing you would like to use
506
		    </span></td>
507
		</tr>
508
                <tr>
509
                  <td valign="top" class="vncell">Interface Bandwidth Speed</td>
510
                  <td class="vtable"> <input name="bandwidth" type="text" class="formfld" id="bandwidth" size="30" value="<?=htmlspecialchars($pconfig['bandwidth']);?>">
511
			<select name="bandwidthtype">
512
				<option value="<?=htmlspecialchars($pconfig['bandwidthtype']);?>"><?=htmlspecialchars($pconfig['bandwidthtype']);?></option>
513
				<option value="b">bit/s</option>
514
				<option value="Kb">Kilobit/s</option>
515
				<option value="Mb">Megabit/s</option>
516
				<option value="Gb">Gigabit/s</option>
517
			</select>
518
			<br> The bandwidth setting will define the speed of the interface for traffic shaping.
519
		  </td>
520
                </tr>
521 e2cd32df Scott Ullrich
                <tr>
522
                  <td colspan="2" valign="top" class="listtopic">Bandwidth Management (Traffic Shaping)</td>
523
                </tr>
524
                <tr>
525 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">DHCP client configuration</td>
526 5b237745 Scott Ullrich
                </tr>
527 e2cd32df Scott Ullrich
                <tr>
528 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Hostname</td>
529
                  <td class="vtable"> <input name="dhcphostname" type="text" class="formfld" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
530
                    <br>
531 e2cd32df Scott Ullrich
                    The value in this field is sent as the DHCP client identifier
532
                    and hostname when requesting a DHCP lease. Some ISPs may require
533 5b237745 Scott Ullrich
                    this (for client identification).</td>
534
                </tr>
535 e2cd32df Scott Ullrich
                <tr>
536 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
537
                </tr>
538 e2cd32df Scott Ullrich
                <tr>
539 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">PPPoE configuration</td>
540 5b237745 Scott Ullrich
                </tr>
541 e2cd32df Scott Ullrich
                <tr>
542 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
543 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
544 5b237745 Scott Ullrich
                  </td>
545
                </tr>
546 e2cd32df Scott Ullrich
                <tr>
547 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
548 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
549 5b237745 Scott Ullrich
                  </td>
550
                </tr>
551 e2cd32df Scott Ullrich
                <tr>
552 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Service name</td>
553 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="provider" type="text" class="formfld" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
554
                    <br> <span class="vexpl">Hint: this field can usually be left
555 5b237745 Scott Ullrich
                    empty</span></td>
556
                </tr>
557 e2cd32df Scott Ullrich
                <tr>
558 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Dial on demand</td>
559 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)" >
560 5b237745 Scott Ullrich
                    <strong>Enable Dial-On-Demand mode</strong><br>
561
		    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>
562
                </tr>
563
                <tr>
564
                  <td valign="top" class="vncell">Idle timeout</td>
565
                  <td class="vtable">
566
                    <input name="pppoe_idletimeout" type="text" class="formfld" id="pppoe_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pppoe_idletimeout']);?>">
567
                    seconds<br>
568
    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>
569
                </tr>
570 e2cd32df Scott Ullrich
                <tr>
571 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
572
                </tr>
573 e2cd32df Scott Ullrich
                <tr>
574 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">PPTP configuration</td>
575 5b237745 Scott Ullrich
                </tr>
576 e2cd32df Scott Ullrich
                <tr>
577 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
578 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pptp_username" type="text" class="formfld" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>">
579 5b237745 Scott Ullrich
                  </td>
580
                </tr>
581 e2cd32df Scott Ullrich
                <tr>
582 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
583 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="pptp_password" type="text" class="formfld" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>">
584 5b237745 Scott Ullrich
                  </td>
585
                </tr>
586 e2cd32df Scott Ullrich
                <tr>
587 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">Local IP address</td>
588
                  <td class="vtable"> <input name="pptp_local" type="text" class="formfld" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
589 e2cd32df Scott Ullrich
                    /
590 5b237745 Scott Ullrich
                    <select name="pptp_subnet" class="formfld" id="pptp_subnet">
591 a23d7248 Scott Ullrich
                      <?php for ($i = 31; $i > 0; $i--): ?>
592 e2cd32df Scott Ullrich
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>>
593 5b237745 Scott Ullrich
                      <?=$i;?>
594
                      </option>
595
                      <?php endfor; ?>
596
                    </select></td>
597
                </tr>
598 e2cd32df Scott Ullrich
                <tr>
599 5b237745 Scott Ullrich
                  <td width="100" valign="top" class="vncellreq">Remote IP address</td>
600 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="pptp_remote" type="text" class="formfld" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>">
601 5b237745 Scott Ullrich
                  </td>
602
                </tr>
603 e2cd32df Scott Ullrich
                <tr>
604 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Dial on demand</td>
605 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)" >
606 5b237745 Scott Ullrich
                    <strong>Enable Dial-On-Demand mode</strong><br>
607
		    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>
608
                </tr>
609
                <tr>
610
                  <td valign="top" class="vncell">Idle timeout</td>
611
                  <td class="vtable">
612
                    <input name="pptp_idletimeout" type="text" class="formfld" id="pptp_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pptp_idletimeout']);?>">
613
                    seconds<br>
614
    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>
615
                </tr>
616 e2cd32df Scott Ullrich
                <tr>
617 5b237745 Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
618
                </tr>
619 e2cd32df Scott Ullrich
                <tr>
620 a23d7248 Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">BigPond Cable configuration</td>
621 5b237745 Scott Ullrich
                </tr>
622 e2cd32df Scott Ullrich
                <tr>
623 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Username</td>
624 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="bigpond_username" type="text" class="formfld" id="bigpond_username" size="20" value="<?=htmlspecialchars($pconfig['bigpond_username']);?>">
625 5b237745 Scott Ullrich
                  </td>
626
                </tr>
627 e2cd32df Scott Ullrich
                <tr>
628 5b237745 Scott Ullrich
                  <td valign="top" class="vncellreq">Password</td>
629 e2cd32df Scott Ullrich
                  <td class="vtable"><input name="bigpond_password" type="text" class="formfld" id="bigpond_password" size="20" value="<?=htmlspecialchars($pconfig['bigpond_password']);?>">
630 5b237745 Scott Ullrich
                  </td>
631
                </tr>
632 e2cd32df Scott Ullrich
                <tr>
633 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Authentication server</td>
634
                  <td class="vtable"><input name="bigpond_authserver" type="text" class="formfld" id="bigpond_authserver" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authserver']);?>">
635
                    <br>
636
                  <span class="vexpl">If this field is left empty, the default (&quot;dce-server&quot;) is used. </span></td>
637
                </tr>
638 e2cd32df Scott Ullrich
                <tr>
639 5b237745 Scott Ullrich
                  <td valign="top" class="vncell">Authentication domain</td>
640
                  <td class="vtable"><input name="bigpond_authdomain" type="text" class="formfld" id="bigpond_authdomain" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authdomain']);?>">
641
                    <br>
642
                  <span class="vexpl">If this field is left empty, the domain name assigned via DHCP will be used.<br>
643
                  <br>
644
                  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>
645
                </tr>
646
                <tr>
647
                  <td valign="top" class="vncell">Min. heartbeat interval</td>
648
                  <td class="vtable">
649
                    <input name="bigpond_minheartbeatinterval" type="text" class="formfld" id="bigpond_minheartbeatinterval" size="8" value="<?=htmlspecialchars($pconfig['bigpond_minheartbeatinterval']);?>">
650
                    seconds<br>
651
    Setting this to a sensible value (e.g. 60 seconds) can protect against DoS attacks. </td>
652
                </tr>
653
                <?php /* Wireless interface? */
654
				if (isset($optcfg['wireless']))
655
					wireless_config_print();
656
				?>
657 e2cd32df Scott Ullrich
                <tr>
658 5b237745 Scott Ullrich
                  <td height="16" colspan="2" valign="top"></td>
659
                </tr>
660 e2cd32df Scott Ullrich
                <tr>
661 5b237745 Scott Ullrich
                  <td valign="middle">&nbsp;</td>
662 e2cd32df Scott Ullrich
                  <td class="vtable"> <input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv']) echo "checked"; ?>>
663 5b237745 Scott Ullrich
                    <strong>Block private networks</strong><br>
664 e2cd32df Scott Ullrich
                    When set, this option blocks traffic from IP addresses that
665 5b237745 Scott Ullrich
                    are reserved for private<br>
666 e2cd32df Scott Ullrich
                    networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as
667 5b237745 Scott Ullrich
                    well as loopback addresses<br>
668 e2cd32df Scott Ullrich
                    (127/8). You should generally leave this option turned on,
669 5b237745 Scott Ullrich
                    unless your WAN network<br>
670
                    lies in such a private address space, too.</td>
671
                </tr>
672 e2cd32df Scott Ullrich
                <tr>
673 5b237745 Scott Ullrich
                  <td width="100" valign="top">&nbsp;</td>
674 e2cd32df Scott Ullrich
                  <td> &nbsp;<br> <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change_pptp(true)&&enable_change(true)">
675 5b237745 Scott Ullrich
                  </td>
676
                </tr>
677
              </table>
678
</form>
679
<script language="JavaScript">
680
<!--
681
type_change();
682
//-->
683
</script>
684
<?php include("fend.inc"); ?>
685
</body>
686
</html>