Project

General

Profile

Download (29.5 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php
2
<?php 
3
/*
4
	interfaces_wan.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
	
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
	
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
	
16
	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
	
20
	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
$pconfig['pppoe_dialondemand'] = $config['pppoe']['ondemand'];
41
$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
$pconfig['pptp_dialondemand'] = $config['pptp']['ondemand'];
49
$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
}
73

    
74
$pconfig['blockpriv'] = isset($wancfg['blockpriv']);
75
$pconfig['spoofmac'] = $wancfg['spoofmac'];
76
$pconfig['mtu'] = $wancfg['mtu'];
77

    
78
/* Wireless interface? */
79
if (isset($optcfg['wireless'])) {
80
	require("interfaces_wlan.inc");
81
	wireless_config_init();
82
}
83

    
84
if ($_POST) {
85

    
86
	unset($input_errors);
87
	$pconfig = $_POST;
88

    
89
	/* input validation */
90
	if ($_POST['type'] == "Static") {
91
		$reqdfields = explode(" ", "ipaddr subnet gateway");
92
		$reqdfieldsn = explode(",", "IP address,Subnet bit count,Gateway");
93
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
94
	} else if ($_POST['type'] == "PPPoE") {
95
		if ($_POST['pppoe_dialondemand']) {
96
			$reqdfields = explode(" ", "username password pppoe_dialondemand pppoe_idletimeout");
97
			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password,Dial on demand,Idle timeout value");
98
		} else {
99
			$reqdfields = explode(" ", "username password");
100
			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password");
101
		}
102
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
103
	} else if ($_POST['type'] == "PPTP") {
104
		if ($_POST['pptp_dialondemand']) {
105
			$reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote pptp_dialondemand pptp_idletimeout");
106
			$reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address,Dial on demand,Idle timeout value");
107
		} else {
108
			$reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote");
109
			$reqdfieldsn = explode(",", "PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address");
110
		}
111
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
112
	} else if ($_POST['type'] == "BigPond") {
113
		$reqdfields = explode(" ", "bigpond_username bigpond_password");
114
		$reqdfieldsn = explode(",", "BigPond username,BigPond password");
115
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
116
	}
117
	
118
	if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
119
		$input_errors[] = "A valid IP address must be specified.";
120
	}
121
	if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) {
122
		$input_errors[] = "A valid subnet bit count must be specified.";
123
	}
124
	if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) {
125
		$input_errors[] = "A valid gateway must be specified.";
126
	}
127
	if (($_POST['provider'] && !is_domain($_POST['provider']))) {
128
		$input_errors[] = "The service name contains invalid characters.";
129
	}
130
	if ($_POST['pppoe_idletimeout'] && !is_numericint($_POST['pppoe_idletimeout'])) {
131
		$input_errors[] = "The idle timeout value must be an integer.";
132
	}
133
	if (($_POST['pptp_local'] && !is_ipaddr($_POST['pptp_local']))) {
134
		$input_errors[] = "A valid PPTP local IP address must be specified.";
135
	}
136
	if (($_POST['pptp_subnet'] && !is_numeric($_POST['pptp_subnet']))) {
137
		$input_errors[] = "A valid PPTP subnet bit count must be specified.";
138
	}
139
	if (($_POST['pptp_remote'] && !is_ipaddr($_POST['pptp_remote']))) {
140
		$input_errors[] = "A valid PPTP remote IP address must be specified.";
141
	}
142
	if ($_POST['pptp_idletimeout'] && !is_numericint($_POST['pptp_idletimeout'])) {
143
		$input_errors[] = "The idle timeout value must be an integer.";
144
	}
145
	if (($_POST['bigpond_authserver'] && !is_domain($_POST['bigpond_authserver']))) {
146
		$input_errors[] = "The authentication server name contains invalid characters.";
147
	}
148
	if (($_POST['bigpond_authdomain'] && !is_domain($_POST['bigpond_authdomain']))) {
149
		$input_errors[] = "The authentication domain name contains invalid characters.";
150
	}
151
	if ($_POST['bigpond_minheartbeatinterval'] && !is_numericint($_POST['bigpond_minheartbeatinterval'])) {
152
		$input_errors[] = "The minimum heartbeat interval must be an integer.";
153
	}
154
	if (($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac']))) {
155
		$input_errors[] = "A valid MAC address must be specified.";
156
	}
157
	if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) {
158
		$input_errors[] = "The MTU must be between 576 and 1500 bytes.";
159
	}
160
	
161
	/* Wireless interface? */
162
	if (isset($optcfg['wireless'])) {
163
		$wi_input_errors = wireless_config_post();
164
		if ($wi_input_errors) {
165
			$input_errors = array_merge($input_errors, $wi_input_errors);
166
		}
167
	}
168

    
169
	if (!$input_errors) {
170
	
171
		unset($wancfg['ipaddr']);
172
		unset($wancfg['subnet']);
173
		unset($wancfg['gateway']);
174
		unset($wancfg['dhcphostname']);
175
		unset($config['pppoe']['username']);
176
		unset($config['pppoe']['password']);
177
		unset($config['pppoe']['provider']);
178
		unset($config['pppoe']['ondemand']);
179
		unset($config['pppoe']['timeout']);
180
		unset($config['pptp']['username']);
181
		unset($config['pptp']['password']);
182
		unset($config['pptp']['local']);
183
		unset($config['pptp']['subnet']);
184
		unset($config['pptp']['remote']);
185
		unset($config['pptp']['ondemand']);
186
		unset($config['pptp']['timeout']);
187
		unset($config['bigpond']['username']);
188
		unset($config['bigpond']['password']);
189
		unset($config['bigpond']['authserver']);
190
		unset($config['bigpond']['authdomain']);
191
		unset($config['bigpond']['minheartbeatinterval']);
192
	
193
		if ($_POST['type'] == "Static") {
194
			$wancfg['ipaddr'] = $_POST['ipaddr'];
195
			$wancfg['subnet'] = $_POST['subnet'];
196
			$wancfg['gateway'] = $_POST['gateway'];
197
		} else if ($_POST['type'] == "DHCP") {
198
			$wancfg['ipaddr'] = "dhcp";
199
			$wancfg['dhcphostname'] = $_POST['dhcphostname'];
200
		} else if ($_POST['type'] == "PPPoE") {
201
			$wancfg['ipaddr'] = "pppoe";
202
			$config['pppoe']['username'] = $_POST['username'];
203
			$config['pppoe']['password'] = $_POST['password'];
204
			$config['pppoe']['provider'] = $_POST['provider'];
205
			$config['pppoe']['ondemand'] = $_POST['pppoe_dialondemand'];
206
			$config['pppoe']['timeout'] = $_POST['pppoe_idletimeout'];
207
		} else if ($_POST['type'] == "PPTP") {
208
			$wancfg['ipaddr'] = "pptp";
209
			$config['pptp']['username'] = $_POST['pptp_username'];
210
			$config['pptp']['password'] = $_POST['pptp_password'];
211
			$config['pptp']['local'] = $_POST['pptp_local'];
212
			$config['pptp']['subnet'] = $_POST['pptp_subnet'];
213
			$config['pptp']['remote'] = $_POST['pptp_remote'];
214
			$config['pptp']['ondemand'] = $_POST['pptp_dialondemand'];
215
			$config['pptp']['timeout'] = $_POST['pptp_idletimeout'];
216
		} else if ($_POST['type'] == "BigPond") {
217
			$wancfg['ipaddr'] = "bigpond";
218
			$config['bigpond']['username'] = $_POST['bigpond_username'];
219
			$config['bigpond']['password'] = $_POST['bigpond_password'];
220
			$config['bigpond']['authserver'] = $_POST['bigpond_authserver'];
221
			$config['bigpond']['authdomain'] = $_POST['bigpond_authdomain'];
222
			$config['bigpond']['minheartbeatinterval'] = $_POST['bigpond_minheartbeatinterval'];
223
		}
224
		
225
		$wancfg['blockpriv'] = $_POST['blockpriv'] ? true : false;
226
		$wancfg['spoofmac'] = $_POST['spoofmac'];
227
		$wancfg['mtu'] = $_POST['mtu'];
228
			
229
		write_config();
230
		
231
		$retval = 0;
232
		if (!file_exists($d_sysrebootreqd_path)) {
233
			config_lock();
234
			$retval = interfaces_wan_configure();
235
			config_unlock();
236
		}
237
		$savemsg = get_std_save_message($retval);
238
	}
239
}
240
?>
241
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
242
<html>
243
<head>
244
<title><?=gentitle("Interfaces: WAN");?></title>
245
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
246
<link href="gui.css" rel="stylesheet" type="text/css">
247
<script language="JavaScript">
248
<!--
249
function enable_change(enable_change) {
250
	if (document.iform.pppoe_dialondemand.checked || enable_change) {
251
		document.iform.pppoe_idletimeout.disabled = 0;
252
	} else {
253
		document.iform.pppoe_idletimeout.disabled = 1;
254
	}
255
}
256

    
257
function enable_change_pptp(enable_change_pptp) {
258
	if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
259
		document.iform.pptp_idletimeout.disabled = 0;
260
		document.iform.pptp_local.disabled = 0;
261
		document.iform.pptp_remote.disabled = 0;
262
	} else {
263
		document.iform.pptp_idletimeout.disabled = 1;
264
	}
265
}
266

    
267
function type_change(enable_change,enable_change_pptp) {
268
	switch (document.iform.type.selectedIndex) {
269
		case 0:
270
			document.iform.username.disabled = 1;
271
			document.iform.password.disabled = 1;
272
			document.iform.provider.disabled = 1;
273
			document.iform.pppoe_dialondemand.disabled = 1;
274
			document.iform.pppoe_idletimeout.disabled = 1;
275
			document.iform.ipaddr.disabled = 0;
276
			document.iform.subnet.disabled = 0;
277
			document.iform.gateway.disabled = 0;
278
			document.iform.pptp_username.disabled = 1;
279
			document.iform.pptp_password.disabled = 1;
280
			document.iform.pptp_local.disabled = 1;
281
			document.iform.pptp_subnet.disabled = 1;
282
			document.iform.pptp_remote.disabled = 1;
283
			document.iform.pptp_dialondemand.disabled = 1;
284
			document.iform.pptp_idletimeout.disabled = 1;
285
			document.iform.bigpond_username.disabled = 1;
286
			document.iform.bigpond_password.disabled = 1;
287
			document.iform.bigpond_authserver.disabled = 1;
288
			document.iform.bigpond_authdomain.disabled = 1;
289
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
290
			document.iform.dhcphostname.disabled = 1;
291
			break;
292
		case 1:
293
			document.iform.username.disabled = 1;
294
			document.iform.password.disabled = 1;
295
			document.iform.provider.disabled = 1;
296
			document.iform.pppoe_dialondemand.disabled = 1;
297
			document.iform.pppoe_idletimeout.disabled = 1;
298
			document.iform.ipaddr.disabled = 1;
299
			document.iform.subnet.disabled = 1;
300
			document.iform.gateway.disabled = 1;
301
			document.iform.pptp_username.disabled = 1;
302
			document.iform.pptp_password.disabled = 1;
303
			document.iform.pptp_local.disabled = 1;
304
			document.iform.pptp_subnet.disabled = 1;
305
			document.iform.pptp_remote.disabled = 1;
306
			document.iform.pptp_dialondemand.disabled = 1;
307
			document.iform.pptp_idletimeout.disabled = 1;
308
			document.iform.bigpond_username.disabled = 1;
309
			document.iform.bigpond_password.disabled = 1;
310
			document.iform.bigpond_authserver.disabled = 1;
311
			document.iform.bigpond_authdomain.disabled = 1;
312
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
313
			document.iform.dhcphostname.disabled = 0;
314
			break;
315
		case 2:
316
			document.iform.username.disabled = 0;
317
			document.iform.password.disabled = 0;
318
			document.iform.provider.disabled = 0;
319
			document.iform.pppoe_dialondemand.disabled = 0;
320
			if (document.iform.pppoe_dialondemand.checked || enable_change) {
321
				document.iform.pppoe_idletimeout.disabled = 0;
322
			} else {
323
				document.iform.pppoe_idletimeout.disabled = 1;
324
			}
325
			document.iform.ipaddr.disabled = 1;
326
			document.iform.subnet.disabled = 1;
327
			document.iform.gateway.disabled = 1;
328
			document.iform.pptp_username.disabled = 1;
329
			document.iform.pptp_password.disabled = 1;
330
			document.iform.pptp_local.disabled = 1;
331
			document.iform.pptp_subnet.disabled = 1;
332
			document.iform.pptp_remote.disabled = 1;
333
			document.iform.pptp_dialondemand.disabled = 1;
334
			document.iform.pptp_idletimeout.disabled = 1;
335
			document.iform.bigpond_username.disabled = 1;
336
			document.iform.bigpond_password.disabled = 1;
337
			document.iform.bigpond_authserver.disabled = 1;
338
			document.iform.bigpond_authdomain.disabled = 1;
339
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
340
			document.iform.dhcphostname.disabled = 1;
341
			break;
342
		case 3:
343
			document.iform.username.disabled = 1;
344
			document.iform.password.disabled = 1;
345
			document.iform.provider.disabled = 1;
346
			document.iform.pppoe_dialondemand.disabled = 1;
347
			document.iform.pppoe_idletimeout.disabled = 1;
348
			document.iform.ipaddr.disabled = 1;
349
			document.iform.subnet.disabled = 1;
350
			document.iform.gateway.disabled = 1;
351
			document.iform.pptp_username.disabled = 0;
352
			document.iform.pptp_password.disabled = 0;
353
			document.iform.pptp_local.disabled = 0;
354
			document.iform.pptp_subnet.disabled = 0;
355
			document.iform.pptp_remote.disabled = 0;
356
			document.iform.pptp_dialondemand.disabled = 0;
357
			if (document.iform.pptp_dialondemand.checked || enable_change_pptp) {
358
				document.iform.pptp_idletimeout.disabled = 0;
359
			} else {
360
				document.iform.pptp_idletimeout.disabled = 1;
361
			}
362
			document.iform.bigpond_username.disabled = 1;
363
			document.iform.bigpond_password.disabled = 1;
364
			document.iform.bigpond_authserver.disabled = 1;
365
			document.iform.bigpond_authdomain.disabled = 1;
366
			document.iform.bigpond_minheartbeatinterval.disabled = 1;
367
			document.iform.dhcphostname.disabled = 1;
368
			break;
369
		case 4:
370
			document.iform.username.disabled = 1;
371
			document.iform.password.disabled = 1;
372
			document.iform.provider.disabled = 1;
373
			document.iform.pppoe_dialondemand.disabled = 1;
374
			document.iform.pppoe_idletimeout.disabled = 1;
375
			document.iform.ipaddr.disabled = 1;
376
			document.iform.subnet.disabled = 1;
377
			document.iform.gateway.disabled = 1;
378
			document.iform.pptp_username.disabled = 1;
379
			document.iform.pptp_password.disabled = 1;
380
			document.iform.pptp_local.disabled = 1;
381
			document.iform.pptp_subnet.disabled = 1;
382
			document.iform.pptp_remote.disabled = 1;
383
			document.iform.pptp_dialondemand.disabled = 1;
384
			document.iform.pptp_idletimeout.disabled = 1;
385
			document.iform.bigpond_username.disabled = 0;
386
			document.iform.bigpond_password.disabled = 0;
387
			document.iform.bigpond_authserver.disabled = 0;
388
			document.iform.bigpond_authdomain.disabled = 0;
389
			document.iform.bigpond_minheartbeatinterval.disabled = 0;
390
			document.iform.dhcphostname.disabled = 1;
391
			break;
392
	}
393
}
394
//-->
395
</script>
396
</head>
397

    
398
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
399
<?php include("fbegin.inc"); ?>
400
<p class="pgtitle">Interfaces: WAN</p>
401
<?php if ($input_errors) print_input_errors($input_errors); ?>
402
<?php if ($savemsg) print_info_box($savemsg); ?>
403
            <form action="interfaces_wan.php" method="post" name="iform" id="iform">
404
              <table width="100%" border="0" cellpadding="6" cellspacing="0">
405
                <tr> 
406
                  <td valign="middle"><strong>Type</strong></td>
407
                  <td> <select name="type" class="formfld" id="type" onchange="type_change()">
408
                      <?php $opts = split(" ", "Static DHCP PPPoE PPTP BigPond");
409
				foreach ($opts as $opt): ?>
410
                      <option <?php if ($opt == $pconfig['type']) echo "selected";?>> 
411
                      <?=htmlspecialchars($opt);?>
412
                      </option>
413
                      <?php endforeach; ?>
414
                    </select></td>
415
                </tr>
416
                <tr> 
417
                  <td colspan="2" valign="top" height="4"></td>
418
                </tr>
419
                <tr> 
420
                  <td colspan="2" valign="top" class="vnsepcell">General configuration</td>
421
                </tr>
422
                <tr> 
423
                  <td valign="top" class="vncell">MAC address</td>
424
                  <td class="vtable"> <input name="spoofmac" type="text" class="formfld" id="spoofmac" size="30" value="<?=htmlspecialchars($pconfig['spoofmac']);?>"> 
425
                    <br>
426
                    This field can be used to modify (&quot;spoof&quot;) the MAC 
427
                    address of the WAN interface<br>
428
                    (may be required with some cable connections)<br>
429
                    Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx 
430
                    or leave blank</td>
431
                </tr>
432
                <tr> 
433
                  <td valign="top" class="vncell">MTU</td>
434
                  <td class="vtable"> <input name="mtu" type="text" class="formfld" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>"> 
435
                    <br>
436
                    If you enter a value in this field, then MSS clamping for 
437
                    TCP connections to the value entered above minus 40 (TCP/IP 
438
                    header size) will be in effect. If you leave this field blank, 
439
                    an MTU of 1492 bytes for PPPoE and 1500 bytes for all other 
440
                    connection types will be assumed.</td>
441
                </tr>
442
                <tr> 
443
                  <td colspan="2" valign="top" height="16"></td>
444
                </tr>
445
                <tr> 
446
                  <td colspan="2" valign="top" class="vnsepcell">Static IP configuration</td>
447
                </tr>
448
                <tr> 
449
                  <td width="100" valign="top" class="vncellreq">IP address</td>
450
                  <td class="vtable"> <input name="ipaddr" type="text" class="formfld" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
451
                    / 
452
                    <select name="subnet" class="formfld" id="subnet">
453
                      <?php for ($i = 31; $i > 0; $i--): ?>
454
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['subnet']) echo "selected"; ?>> 
455
                      <?=$i;?>
456
                      </option>
457
                      <?php endfor; ?>
458
                    </select></td>
459
                </tr>
460
                <tr> 
461
                  <td valign="top" class="vncellreq">Gateway</td>
462
                  <td class="vtable"> <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"> 
463
                  </td>
464
                </tr>
465
                <tr> 
466
                  <td colspan="2" valign="top" height="16"></td>
467
                </tr>
468
                <tr> 
469
                  <td colspan="2" valign="top" class="vnsepcell">DHCP client configuration</td>
470
                </tr>
471
                <tr> 
472
                  <td valign="top" class="vncell">Hostname</td>
473
                  <td class="vtable"> <input name="dhcphostname" type="text" class="formfld" id="dhcphostname" size="40" value="<?=htmlspecialchars($pconfig['dhcphostname']);?>">
474
                    <br>
475
                    The value in this field is sent as the DHCP client identifier 
476
                    and hostname when requesting a DHCP lease. Some ISPs may require 
477
                    this (for client identification).</td>
478
                </tr>
479
                <tr> 
480
                  <td colspan="2" valign="top" height="16"></td>
481
                </tr>
482
                <tr> 
483
                  <td colspan="2" valign="top" class="vnsepcell">PPPoE configuration</td>
484
                </tr>
485
                <tr> 
486
                  <td valign="top" class="vncellreq">Username</td>
487
                  <td class="vtable"><input name="username" type="text" class="formfld" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>"> 
488
                  </td>
489
                </tr>
490
                <tr> 
491
                  <td valign="top" class="vncellreq">Password</td>
492
                  <td class="vtable"><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>"> 
493
                  </td>
494
                </tr>
495
                <tr> 
496
                  <td valign="top" class="vncell">Service name</td>
497
                  <td class="vtable"><input name="provider" type="text" class="formfld" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>"> 
498
                    <br> <span class="vexpl">Hint: this field can usually be left 
499
                    empty</span></td>
500
                </tr>
501
                <tr> 
502
                  <td valign="top" class="vncell">Dial on demand</td>
503
                  <td class="vtable"><input name="pppoe_dialondemand" type="checkbox" id="pppoe_dialondemand" value="enable" <?php if ($pconfig['pppoe_dialondemand'] == "enable") echo "checked"; ?> onClick="enable_change(false)" > 
504
                    <strong>Enable Dial-On-Demand mode</strong><br>
505
		    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>
506
                </tr>
507
                <tr>
508
                  <td valign="top" class="vncell">Idle timeout</td>
509
                  <td class="vtable">
510
                    <input name="pppoe_idletimeout" type="text" class="formfld" id="pppoe_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pppoe_idletimeout']);?>">
511
                    seconds<br>
512
    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>
513
                </tr>
514
                <tr> 
515
                  <td colspan="2" valign="top" height="16"></td>
516
                </tr>
517
                <tr> 
518
                  <td colspan="2" valign="top" class="vnsepcell">PPTP configuration</td>
519
                </tr>
520
                <tr> 
521
                  <td valign="top" class="vncellreq">Username</td>
522
                  <td class="vtable"><input name="pptp_username" type="text" class="formfld" id="pptp_username" size="20" value="<?=htmlspecialchars($pconfig['pptp_username']);?>"> 
523
                  </td>
524
                </tr>
525
                <tr> 
526
                  <td valign="top" class="vncellreq">Password</td>
527
                  <td class="vtable"><input name="pptp_password" type="text" class="formfld" id="pptp_password" size="20" value="<?=htmlspecialchars($pconfig['pptp_password']);?>"> 
528
                  </td>
529
                </tr>
530
                <tr> 
531
                  <td width="100" valign="top" class="vncellreq">Local IP address</td>
532
                  <td class="vtable"> <input name="pptp_local" type="text" class="formfld" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>">
533
                    / 
534
                    <select name="pptp_subnet" class="formfld" id="pptp_subnet">
535
                      <?php for ($i = 31; $i > 0; $i--): ?>
536
                      <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>> 
537
                      <?=$i;?>
538
                      </option>
539
                      <?php endfor; ?>
540
                    </select></td>
541
                </tr>
542
                <tr> 
543
                  <td width="100" valign="top" class="vncellreq">Remote IP address</td>
544
                  <td class="vtable"> <input name="pptp_remote" type="text" class="formfld" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>"> 
545
                  </td>
546
                </tr>
547
                <tr> 
548
                  <td valign="top" class="vncell">Dial on demand</td>
549
                  <td class="vtable"><input name="pptp_dialondemand" type="checkbox" id="pptp_dialondemand" value="enable" <?php if ($pconfig['pptp_dialondemand'] == "enable") echo "checked"; ?> onClick="enable_change_pptp(false)" > 
550
                    <strong>Enable Dial-On-Demand mode</strong><br>
551
		    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>
552
                </tr>
553
                <tr>
554
                  <td valign="top" class="vncell">Idle timeout</td>
555
                  <td class="vtable">
556
                    <input name="pptp_idletimeout" type="text" class="formfld" id="pptp_idletimeout" size="8" value="<?=htmlspecialchars($pconfig['pptp_idletimeout']);?>">
557
                    seconds<br>
558
    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>
559
                </tr>
560
                <tr> 
561
                  <td colspan="2" valign="top" height="16"></td>
562
                </tr>
563
                <tr> 
564
                  <td colspan="2" valign="top" class="vnsepcell">BigPond Cable configuration</td>
565
                </tr>
566
                <tr> 
567
                  <td valign="top" class="vncellreq">Username</td>
568
                  <td class="vtable"><input name="bigpond_username" type="text" class="formfld" id="bigpond_username" size="20" value="<?=htmlspecialchars($pconfig['bigpond_username']);?>"> 
569
                  </td>
570
                </tr>
571
                <tr> 
572
                  <td valign="top" class="vncellreq">Password</td>
573
                  <td class="vtable"><input name="bigpond_password" type="text" class="formfld" id="bigpond_password" size="20" value="<?=htmlspecialchars($pconfig['bigpond_password']);?>"> 
574
                  </td>
575
                </tr>
576
                <tr> 
577
                  <td valign="top" class="vncell">Authentication server</td>
578
                  <td class="vtable"><input name="bigpond_authserver" type="text" class="formfld" id="bigpond_authserver" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authserver']);?>">
579
                    <br>
580
                  <span class="vexpl">If this field is left empty, the default (&quot;dce-server&quot;) is used. </span></td>
581
                </tr>
582
                <tr> 
583
                  <td valign="top" class="vncell">Authentication domain</td>
584
                  <td class="vtable"><input name="bigpond_authdomain" type="text" class="formfld" id="bigpond_authdomain" size="20" value="<?=htmlspecialchars($pconfig['bigpond_authdomain']);?>">
585
                    <br>
586
                  <span class="vexpl">If this field is left empty, the domain name assigned via DHCP will be used.<br>
587
                  <br>
588
                  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>
589
                </tr>
590
                <tr>
591
                  <td valign="top" class="vncell">Min. heartbeat interval</td>
592
                  <td class="vtable">
593
                    <input name="bigpond_minheartbeatinterval" type="text" class="formfld" id="bigpond_minheartbeatinterval" size="8" value="<?=htmlspecialchars($pconfig['bigpond_minheartbeatinterval']);?>">
594
                    seconds<br>
595
    Setting this to a sensible value (e.g. 60 seconds) can protect against DoS attacks. </td>
596
                </tr>
597
                <?php /* Wireless interface? */
598
				if (isset($optcfg['wireless']))
599
					wireless_config_print();
600
				?>
601
                <tr> 
602
                  <td height="16" colspan="2" valign="top"></td>
603
                </tr>
604
                <tr> 
605
                  <td valign="middle">&nbsp;</td>
606
                  <td class="vtable"> <input name="blockpriv" type="checkbox" id="blockpriv" value="yes" <?php if ($pconfig['blockpriv'] == "yes") echo "checked"; ?>> 
607
                    <strong>Block private networks</strong><br>
608
                    When set, this option blocks traffic from IP addresses that 
609
                    are reserved for private<br>
610
                    networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as 
611
                    well as loopback addresses<br>
612
                    (127/8). You should generally leave this option turned on, 
613
                    unless your WAN network<br>
614
                    lies in such a private address space, too.</td>
615
                </tr>
616
                <tr> 
617
                  <td width="100" valign="top">&nbsp;</td>
618
                  <td> &nbsp;<br> <input name="Submit" type="submit" class="formbtn" value="Save" onClick="enable_change_pptp(true)&&enable_change(true)"> 
619
                  </td>
620
                </tr>
621
              </table>
622
</form>
623
<script language="JavaScript">
624
<!--
625
type_change();
626
//-->
627
</script>
628
<?php include("fend.inc"); ?>
629
</body>
630
</html>
(45-45/86)