Project

General

Profile

Download (18.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?xml version="1.0" encoding="utf-8" ?>
2
<pfsensewizard>
3
<copyright>
4
/* $Id$ */
5
/*
6
	setup.xml
7
        part of pfSense (http://www.pfsense.org/)
8

    
9
	Copyright (C) 2004, 2005 Scott Ullrich
10
        All rights reserved.
11

    
12
        Redistribution and use in source and binary forms, with or without
13
        modification, are permitted provided that the following conditions are met:
14

    
15
        1. Redistributions of source code must retain the above copyright notice,
16
           this list of conditions and the following disclaimer.
17

    
18
        2. Redistributions in binary form must reproduce the above copyright
19
           notice, this list of conditions and the following disclaimer in the
20
           documentation and/or other materials provided with the distribution.
21

    
22
        THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
        INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
        AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
        AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
        OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
        SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
        INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
        ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
        POSSIBILITY OF SUCH DAMAGE.
32
*/
33
</copyright>
34
<totalsteps>8</totalsteps>
35
<step>
36
	<id>1</id>
37
	<title>pfSense Setup Wizard</title>
38
	<disableheader>true</disableheader>
39
	<description>This wizard will guide you through the initial configuration of pfSense.</description>
40
	<fields>
41
		<field>
42
			<name>Next</name>
43
			<type>submit</type>
44
		</field>
45
	</fields>
46
	<stepbeforeformdisplay>
47
		conf_mount_rw();
48
		unlink_if_exists('/conf/trigger_initial_wizard');
49
		conf_mount_ro();
50
	</stepbeforeformdisplay>
51
</step>
52
<step>
53
	<id>2</id>
54
	<title>General Information</title>
55
	<description>On this screen you will set the general pfSense parameters.</description>
56
	<fields>
57
		<field>
58
			<name>Hostname</name>
59
			<type>input</type>
60
			<bindstofield>system->hostname</bindstofield>
61
			<description>EXAMPLE: myserver</description>
62
			<validate>^[a-z0-9.|-]+$</validate>
63
			<message>Invalid Hostname</message>
64
		</field>
65
		<field>
66
			<name>Domain</name>
67
			<type>input</type>
68
			<bindstofield>system->domain</bindstofield>
69
			<description>EXAMPLE: mydomain.com</description>
70
			<validate>^[a-z0-9.|-]+$</validate>
71
			<message>Domain name field is invalid</message>
72
		</field>
73
		<field>
74
			<name>Primary DNS Server</name>
75
			<type>input</type>
76
			<bindstofield>system->dnsserver</bindstofield>
77
			<!-- we must unset the fields because this is an array. -->
78
			<unsetfield>yes</unsetfield>
79
			<arraynum>0</arraynum>
80
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
81
			<message>Primary DNS Server field is invalid</message>
82
		</field>
83
		<field>
84
			<name>Secondary DNS Server</name>
85
			<type>input</type>
86
			<bindstofield>system->dnsserver</bindstofield>
87
			<arraynum>1</arraynum>
88
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
89
			<message>Secondary DNS Server field is invalid</message>
90
		</field>
91
		<field>
92
			<name>Override DNS</name>
93
			<description>Allow DNS servers to be overridden by DHCP/PPP on WAN</description>
94
			<type>checkbox</type>
95
			<bindstofield>system->dnsallowoverride</bindstofield>
96
		</field>
97
		<field>
98
			<name>Next</name>
99
			<type>submit</type>
100
		</field>
101
	</fields>
102
	<stepsubmitphpaction>
103
		<![CDATA[
104
		if(empty($_POST['hostname']) || !is_hostname($_POST['hostname'])) {
105
			print_info_box_np("Hostname is invalid. Please press back in your browser window and correct.");
106
			die;
107
		}
108
		if(empty($_POST['domain']) || !is_domain($_POST['domain'])) {
109
			print_info_box_np("Domain is invalid. Please press back in your browser window and correct.");
110
			die;
111
		}
112
		if(!empty($_POST['primarydnsserver']) && !is_ipaddr($_POST['primarydnsserver'])) {
113
			print_info_box_np("Primary DNS server is invalid. Please press back in your browser window and correct.");
114
			die;
115
		}
116
		if(!empty($_POST['secondarydnsserver']) && !is_ipaddr($_POST['secondarydnsserver'])) {
117
			print_info_box_np("Second DNS server is invalid. Please press back in your browser window and correct.");
118
			die;
119
		}
120
		]]>
121
	</stepsubmitphpaction>
122
</step>
123
<step>
124
	<id>3</id>
125
	<title>Time Server Information</title>
126
	<description>Please enter the time, date and time zone.</description>
127
	<fields>
128
		<field>
129
			<name>Time server hostname</name>
130
			<description>Enter the hostname (FQDN) of the time server.</description>
131
			<type>input</type>
132
			<bindstofield>system->timeservers</bindstofield>
133
			<validate>^[a-z0-9.|-]+$</validate>
134
			<message>Invalid Time Server Field</message>
135
		</field>
136
		<field>
137
			<name>Timezone</name>
138
			<type>timezone_select</type>
139
			<bindstofield>system->timezone</bindstofield>
140
		</field>
141
		<field>
142
			<name>Next</name>
143
			<type>submit</type>
144
		</field>
145
	</fields>
146
	<stepsubmitphpaction>
147
		<![CDATA[
148
		if(!empty($_POST['timeserverhostname']) && !(is_hostname($_POST['timeserverhostname']) || is_ipaddr($_POST['timeserverhostname']))) {
149
			print_info_box_np("Invalid Time Server. Please press back in your browser window and correct.");
150
			die;
151
		}
152
		]]>
153
	</stepsubmitphpaction>
154
</step>
155
<step>
156
	<id>4</id>
157
	<disableallfieldsbydefault>true</disableallfieldsbydefault>
158
	<title>Configure WAN Interface</title>
159
	<description>On this screen we will configure the Wide Area Network information.</description>
160
	<javascriptafterformdisplay>
161
		var selectedItem = 0;
162
		if(document.forms[0].ipaddress.value == 'dhcp') {
163
			selectedItem = 1;
164
			document.forms[0].ipaddress.value = '';
165
		} else if(document.forms[0].ipaddress.value == 'PPPoE') {
166
			selectedItem = 2;
167
			document.forms[0].ipaddress.value = '';
168
		} else if(document.forms[0].ipaddress.value == 'PPTP') {
169
			selectedItem = 3;
170
			document.forms[0].ipaddress.value = '';
171
		} else if(document.forms[0].ipaddress.value == 'BigPond') {
172
			selectedItem = 4;
173
			document.forms[0].ipaddress.value = '';
174
		} else {
175
			selectedItem = 0;
176
		}
177
		document.forms[0].selectedtype.selectedIndex = selectedItem;
178
		enableitems(selectedItem);
179
	</javascriptafterformdisplay>
180
	<fields>
181
		<field>
182
			<name>SelectedType</name>
183
			<type>select</type>
184
			<donotdisable>true</donotdisable>
185
			<options>
186
				<option>
187
					<name>Static</name>
188
					<value>Static</value>
189
					<enablefields>ipaddress,subnetmask,gateway</enablefields>
190
				</option>
191
				<option>
192
					<name>DHCP</name>
193
					<value>dhcp</value>
194
					<enablefields>dhcphostname</enablefields>
195
				</option>
196
				<option>
197
					<name>PPPoE</name>
198
					<value>pppoe</value>
199
					<enablefields>pppoeusername,pppoepassword,pppoeservicename,pppoedialondemand,pppoeidletimeout</enablefields>
200
				</option>
201
				<option>
202
					<name>PPTP</name>
203
					<value>pptp</value>
204
					<enablefields>pptpusername,pptppassword,pptplocalipaddress,pptplocalsubnet,pptpremoteipaddress,pptpdialondemand,pptpidletimeout
205
					</enablefields>
206
				</option>
207
			</options>
208
		</field>
209
		<field>
210
			<name>General configuration</name>
211
			<type>listtopic</type>
212
		</field>
213
		<field>
214
			<donotdisable>true</donotdisable>
215
			<name>MAC Address</name>
216
			<bindstofield>interfaces->wan->spoofmac</bindstofield>
217
			<type>input</type>
218
			<description> This field can be used to modify ("spoof") the MAC address of the WAN interface (may be required with some cable connections). Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx or leave blank.</description>
219
			<validate>^([0-9a-f]{2}([:-]||$)){6}$</validate>
220
			<message>MAC Address field is invalid</message>
221
		</field>
222
		<field>
223
			<donotdisable>true</donotdisable>
224
			<name>MTU</name>
225
			<type>input</type>
226
			<bindstofield>interfaces->wan->mtu</bindstofield>
227
			<description> If you enter a value in this field, then MSS clamping for TCP connections to the value entered above minus 40 (TCP/IP header size) will be in effect. If you leave this field blank, an MTU of 1492 bytes for PPPoE and 1500 bytes for all other connection types will be assumed.</description>
228
		</field>
229
		<field>
230
			<name>Static IP Configuration</name>
231
			<type>listtopic</type>
232
		</field>
233
		<field>
234
			<name>IP Address</name>
235
			<bindstofield>interfaces->wan->ipaddr</bindstofield>
236
			<type>input</type>
237
			<typehint> / </typehint>
238
			<combinefieldsbegin>true</combinefieldsbegin>
239
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
240
			<message>IP Address field is invalid</message>
241
		</field>
242
		<field>
243
			<combinefieldsend>true</combinefieldsend>
244
			<dontdisplayname>true</dontdisplayname>
245
			<dontcombinecells>true</dontcombinecells>
246
			<name>Subnet Mask</name>
247
			<bindstofield>interfaces->wan->subnet</bindstofield>
248
			<type>subnet_select</type>
249
		</field>
250
		<field>
251
			<name>Gateway</name>
252
			<bindstofield>interfaces->wan->gateway</bindstofield>
253
			<type>input</type>
254
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
255
			<message>Gateway IP Address field is invalid</message>
256
		</field>
257
		<field>
258
			<name>DHCP client configuration</name>
259
			<type>listtopic</type>
260
		</field>
261
		<field>
262
			<name>DHCP Hostname</name>
263
			<type>input</type>
264
			<bindstofield>interfaces->wan->dhcphostname</bindstofield>
265
			<description> The value in this field is sent as the DHCP client identifier and hostname when requesting a DHCP lease. Some ISPs may require this (for client identification).</description>
266
		</field>
267
		<field>
268
			<name>PPPoE configuration</name>
269
			<type>listtopic</type>
270
		</field>
271
		<field>
272
			<name>PPPoE Username</name>
273
			<type>input</type>
274
			<bindstofield>interfaces->wan->pppoe_username</bindstofield>
275
		</field>
276
		<field>
277
			<name>PPPoE Password</name>
278
			<type>input</type>
279
			<bindstofield>interfaces->wan->pppoe_password</bindstofield>
280
		</field>
281
		<field>
282
			<name>PPPoE Service name</name>
283
			<type>input</type>
284
			<description>Hint: this field can usually be left empty</description>
285
		</field>
286
		<field>
287
			<name>PPPoE Dial on demand</name>
288
			<typehint>Enable Dial-On-Demand mode</typehint>
289
			<type>checkbox</type>
290
			<description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
291
		</field>
292
		<field>
293
			<name>PPPoE Idle timeout</name>
294
			<type>input</type>
295
			<description>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.</description>
296
		</field>
297
		<field>
298
			<name>PPTP configuration</name>
299
			<type>listtopic</type>
300
		</field>
301
		<field>
302
			<name>PPTP Username</name>
303
			<type>input</type>
304
			<bindstofield>interfaces->wan->pptp_username</bindstofield>
305
		</field>
306
		<field>
307
			<name>PPTP Password</name>
308
			<type>input</type>
309
			<bindstofield>interfaces->wan->pptp_password</bindstofield>
310
		</field>
311
		<field>
312
			<combinefieldsbegin>true</combinefieldsbegin>
313
			<name>PPTP Local IP Address</name>
314
			<type>input</type>
315
			<typehint> / </typehint>
316
			<bindstofield>pptp->local</bindstofield>
317
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
318
			<message>PPTP Local IP Address field is invalid</message>
319
		</field>
320
		<field>
321
			<combinefieldsend>true</combinefieldsend>
322
			<dontdisplayname>true</dontdisplayname>
323
			<dontcombinecells>true</dontcombinecells>
324
			<name>pptplocalsubnet</name>
325
			<bindstofield>pptp->subnet</bindstofield>
326
			<type>subnet_select</type>
327
		</field>
328
		<field>
329
			<name>PPTP Remote IP Address</name>
330
			<bindstofield>pptp->remote</bindstofield>
331
			<type>input</type>
332
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
333
			<message>PPTP Remote IP Address field is invalid</message>
334
		</field>
335
		<field>
336
			<name>PPTP Dial on demand</name>
337
			<typehint>Enable Dial-On-Demand mode</typehint>
338
			<type>checkbox</type>
339
			<bindstofield>pptp->ondemand</bindstofield>			
340
			<description>This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection. The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.</description>
341
		</field>
342
		<field>
343
			<name>PPTP Idle timeout</name>
344
			<type>input</type>			
345
			<bindstofield>pptp->timeout</bindstofield>
346
			<description>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.</description>
347
		</field>
348
		<field>
349
			<name>RFC1918 Networks</name>
350
			<type>listtopic</type>
351
		</field>
352
		<field>
353
			<donotdisable>true</donotdisable>
354
			<name>Block RFC1918 Private Networks</name>
355
			<description> When set, this option blocks traffic from IP addresses that are reserved for private networks as per RFC 1918 (10/8, 172.16/12, 192.168/16) as well as loopback addresses (127/8). You should generally leave this option turned on, unless your WAN network lies in such a private address space, too.</description>
356
			<type>checkbox</type>
357
			<bindstofield>interfaces->wan->blockpriv</bindstofield>
358
			<typehint>Block private networks from entering via WAN</typehint>
359
		</field>
360
		<field>
361
			<name>Block bogon networks</name>
362
			<type>listtopic</type>
363
		</field>
364
		<field>
365
			<donotdisable>true</donotdisable>
366
			<name>Block bogon networks</name>
367
			<description>When set, this option blocks traffic from IP addresses that are reserved (but not RFC 1918) or not yet assigned by IANA. Bogons are prefixes that should never appear in the Internet routing table, and obviously should not appear as the source address in any packets you receive.</description>
368
			<type>checkbox</type>
369
			<bindstofield>interfaces->wan->blockbogons</bindstofield>
370
			<typehint>Block non-Internet routed networks from entering via WAN</typehint>
371
		</field>
372
		<field>
373
			<name>Next</name>
374
			<type>submit</type>
375
		</field>
376
	</fields>
377
	<stepsubmitphpaction>
378
		<![CDATA[
379
		if(!empty($_POST['mtu']) && ($_POST['mtu'] < 576)) {
380
			print_info_box_np("MTU Must be at least 576 (Per RFC 791). Please press back in your browser window and correct.");
381
			die;
382
		}
383
		if(!empty($_POST['macaddress']) && !is_macaddr($_POST['macaddress'])) {
384
			print_info_box_np("Invalid MAC Address. Please press back in your browser window and correct.");
385
			die;
386
		}
387
		if(!empty($_POST['ipaddress']) && ($_POST['selectedtype'] == "Static") && (!is_ipaddr($_POST['ipaddress']))) {
388
			print_info_box_np("Invalid WAN IP Address. Please press back in your browser window and correct.");
389
			die;
390
		}
391
		if(!empty($_POST['dhcphostname']) && !is_hostname($_POST['dhcphostname'])) {
392
			print_info_box_np("Invalid DHCP Hostname. Please press back in your browser window and correct.");
393
			die;
394
		}
395
		if(!empty($_POST['pptplocalipaddress']) && !is_ipaddr($_POST['pptplocalipaddress'])) {
396
			print_info_box_np("Invalid PPTP Local IP Address. Please press back in your browser window and correct.");
397
			die;
398
		}
399
		if(!empty($_POST['pptpremoteipaddress']) && !is_ipaddr($_POST['pptpremoteipaddress'])) {
400
			print_info_box_np("Invalid PPTP Remopte IP Address. Please press back in your browser window and correct.");
401
			die;
402
		}
403
		]]>
404
	</stepsubmitphpaction>
405
	<stepsubmitbeforesave>
406
		<![CDATA[
407
			if($_POST['selectedtype'] == "Static") { 
408
			
409
			} else {
410
				$_POST['ipaddress'] = $_POST['selectedtype'];
411
				$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
412
				write_config();
413
				if(!$config['interfaces']['lan']) 
414
					Header("Location: /wizard.php?xml=setup_wizard.xml&stepid=5&next=Next");
415
			}
416
		]]>
417
	</stepsubmitbeforesave>
418
</step>
419
<step>
420
	<id>5</id>
421
	<title>Configure LAN Interface</title>
422
	<description>On this screen we will configure the Local Area Network information.</description>
423
	<fields>
424
		<field>
425
			<name>LAN IP Address</name>
426
			<type>input</type>
427
			<bindstofield>interfaces->lan->ipaddr</bindstofield>
428
			<description>Type dhcp if this interface uses DHCP to obtain its IP address.</description>
429
			<validate>^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$</validate>
430
			<message>LAN IP Address field is invalid</message>
431
		</field>
432
				<field>
433
			<name>Subnet Mask</name>
434
			<type>subnet_select</type>
435
			<bindstofield>interfaces->lan->subnet</bindstofield>
436
		</field>
437
		<field>
438
			<name>Next</name>
439
			<type>submit</type>
440
		</field>
441
	</fields>
442
	<stepsubmitphpaction>
443
		<![CDATA[
444
		if(empty($_POST['lanipaddress']) || !is_ipaddr($_POST['lanipaddress'])) {
445
			print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
446
			die;
447
		}
448
		$ft = split("\.", $_POST['lanipaddress']);
449
		$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
450
		$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
451
		$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
452
		$hi = split("\.", $highestip);
453
		$highestip = $hi[3]-10;
454
		$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
455
		]]>
456
	</stepsubmitphpaction>
457
</step>
458
<step>
459
	<id>6</id>
460
	<title>Set Admin WebGUI Password</title>
461
	<description>On this screen we will set the admin password, which is used to access the WebGUI and also SSH services if you wish to enable them.</description>
462
	<fields>
463
		<field>
464
			<name>Admin Password</name>
465
			<type>password</type>
466
		</field>
467
		<field>
468
			<name>Admin Password AGAIN</name>
469
			<type>password</type>
470
		</field>
471
		<field>
472
			<name>Next</name>
473
			<type>submit</type>
474
		</field>
475
	</fields>
476
	<stepsubmitphpaction>
477
	if($_POST['adminpassword'] != "") {
478
		if($_POST['adminpassword'] == $_POST['adminpasswordagain']) {
479
			$admin_user =&amp; getUserEntryByUID(0);
480
			local_user_set_password($admin_user, $_POST['adminpassword']);
481
			local_user_set($admin_user);
482
			write_config();
483
		} else {
484
			print_info_box_np("Passwords do not match!  Please press back in your browser window and correct.");
485
			die;
486
		}
487
	}
488
	</stepsubmitphpaction>
489
</step>
490
<step>
491
	<id>7</id>
492
	<title>Reload configuration</title>
493
	<disableheader>true</disableheader>
494
	<description>Click 'Reload' to reload pfSense with new changes.  If you changed the password, pfSense will ask you to log in again.</description>
495
	<fields>
496
		<field>
497
			<name>Reload</name>
498
			<type>submit</type>
499
		</field>
500
	</fields>
501
</step>
502
<step>
503
	<id>8</id>
504
	<title>Reload in progress</title>
505
	<description>A reload is now in progress.  Please wait. &lt;p&gt; The system will automatically try to access $myurl in 120 seconds. &lt;p&gt; You can click on the icon above to access the site more quickly.
506
	&lt;meta http-equiv="refresh" content="60; url=$myurl" &gt;</description>
507
	<stepafterformdisplay>
508
		reload_all();
509
                mwexec_bg("/etc/rc.update_bogons.sh now");
510
	</stepafterformdisplay>
511
</step>
512
</pfsensewizard>
(3-3/11)