Project

General

Profile

Download (3.67 KB) Statistics
| Branch: | Tag: | Revision:
1
# pfSense-dhcpv6-gui-leases-patch
2

    
3
The parser content consists of:
4
* Pattern matching for IPv6 addresses: *parser_ipv6.inc*<br/>
5
, found in /etc/inc/
6
* Unit testing of IPv6 addresses: *parser_ipv6_tester.php*<br/>
7
, found in /usr/local/bin/<br/>
8
Call:
9
<pre>php -f parser_ipv6_tester.php</pre>
10
, there should always be 0 fails. Amount of passes depends on the test content.<br/>
11
'php -f' is optional on a pfSense system.
12
* Tools for debugging purposes: *tools_for_debugging_n_testing.inc*
13
, found in /etc/inc/
14
* Parsing of ISC DHCPv6 lease file: *parser_dhcpv6_leases.inc*<br/>
15
, found in /etc/inc/<br/>
16
, which is used by the */usr/local/www/status_dhcpv6_leases.php* file<br/>
17
to present the Status of DHCPv6 leases.
18
* Lease tester: *parser_dhcpv6_leases_tester.php*<br/>
19
, found in /usr/local/bin/
20
, that when started from the command line initiates *parser_dhcpv6_leases.inc*<br/>
21
and prints out lease and debug information.
22

    
23
Main focus in this read me file will be on the leases tester.<br/>
24
The lease tester is good to have since it shows what the dhcpv6 leases file
25
contains before it is consumed by the status dhcpv6 leases page.<br/>
26
Especially for debugging this comes in handy as you some times might see some
27
leases that do not contain all the content you expect. Whether it be a defect
28
in ISC DHCP or something else it is nice to have some command line tool to
29
provide an overview of the content of the otherwise not so readable lease file.
30
Basically an overview that gets a little closer to what we know from the
31
DHCPv6 Status Leases page of pfSense.
32

    
33
## Intention of it all
34
Original intention was to provide a fix for the status_dhcpv6_leases.php file
35
to better handle lease content. But as can be seen a little extra got into it.
36

    
37
## Using the lease tester
38
To parse an ISC DHCPv6 lease file (as used by pfSense) call e.g.:<br/>
39
<pre>php -f parser_dhcpv6_leases_tester.php &lt;file&gt;</pre>
40

    
41
#### Running on a pfSense system
42
* 'php -f' is optional on a pfSense system.
43
* &lt;file&gt; is optional on a pfSense system.<br/>
44
When not provided the default lease file will be used<br/>
45
( /var/dhcpd/var/db/dhcpd6.leases )
46
* Real NDP data is used from the running system.
47

    
48
#### Running on a non-pfSense system
49
* &lt;file&gt; is required.
50
* No NDP data is used.
51

    
52
### The tester returns
53
* Evaluation of each individual lease.<br/>
54
If you really want to test the parser try modify the content of the lease file
55
or the arrangement of the curly braces {}.
56
* Evaluation of each failover entry.<br/>
57
Experimental as mentioned in the Failover section below.
58
* The set of *Leases* presented as array entries.
59
* The set of *Prefixes*, used for prefix delegation (PD), presented as array
60
entries.
61
* The set of *Mappings* in IA-NA leases between the DUID+IAID and the IA-NA address.
62
* The set of *Pools* when failover entries exists. Meaning each entry explain
63
own and peer status. That means there are two DHCP servers/pfSenses sharing a
64
common Failover Group name.
65

    
66
## Failover
67
Failover handling is currently experimental as no live configured system has
68
been tested. Only source code and other sources of information has been used
69
and the information gathered here has been tested/injected into a dhcpv6 leases
70
file:<br/>
71
<pre><code>failover peer "Failover-Pair-Name" state {
72
  my state recover-wait at 1 2017/03/03 20:20:12;
73
  partner state communications-interrupted at 1 2017/03/03 20:20:12;
74
  mclt 123;
75
}
76

    
77
failover peer "Failover-2GETHER" state {
78
  my state recover-done at 1 2017/12/03 21:24:12;
79
  partner state unknown-state at 1 2017/03/03 21:44:12;
80
  mclt 456;
81
}</code></pre>
82

    
83
## Defect reports
84
https://github.com/al-right/pfSense-dhcpv6-gui-leases-patch<br/>
85
https://redmine.pfsense.org/<br/>
86
, but if in doubt first try https://forum.pfsense.org
(11-11/14)