msdhcpdump 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,92 @@
1
+ require 'msdhcpdump/reservation'
2
+ require 'msdhcpdump/scope'
3
+ require 'msdhcpdump/exclusion'
4
+
5
+
6
+ class Msdhcpdump < Hash
7
+
8
+ def initialize(dhcpdump)
9
+ super()
10
+ @debug=false
11
+ processdump(dhcpdump)
12
+ end
13
+ def add(matchobj)
14
+ newscope = Scope.new(matchobj)
15
+ self[newscope.net] = newscope
16
+ end
17
+
18
+ def list
19
+ self.keys
20
+ end
21
+
22
+ def getscopes
23
+ self.values
24
+ end
25
+ # def getactive
26
+ # activelist = []
27
+ # self.each_value do |sc|
28
+ # if sc.active?
29
+ # activelist += sc
30
+ # end
31
+ # end
32
+ # return activelist
33
+ # end
34
+ private
35
+ def processdump(dhcpdump)
36
+ linenumber=0
37
+ dhcpdump.each {|line|
38
+ linenumber+=1
39
+ # Ignore all comments that start with "#"
40
+ next if line.match(/^\#/)
41
+ # Ignore all scope set optionvalue
42
+ next if line.match(/.+Scope.+\ set\ optionvalue/i)
43
+ # Find scope
44
+ matchobj = line.match(/^Dhcp\ Server.+add scope\ (.*)/i)
45
+ # create a new scope class
46
+ if matchobj
47
+ puts "line: #{linenumber} adding scope #{matchobj[1].to_s}" if @debug
48
+ self.add(matchobj[1].to_s)
49
+ next
50
+ end
51
+ # find scope status and get scope net
52
+ matchobj = line.match(/^Dhcp\ Server\ .+\ Scope\ (\b(?:\d{1,3}\.){3}\d{1,3}\b)\ set\ state\ (\d)/i)
53
+ if matchobj
54
+ puts "line: #{linenumber} adding #{matchobj[1].to_s} state=#{matchobj[2].to_s}" if @debug
55
+ scopeip = matchobj[1]
56
+ self[scopeip].state = matchobj[2]
57
+ next
58
+ end
59
+ # find iprange and get scope net
60
+ matchobj = line.match(/^Dhcp\ Server\ .+\ Scope\ (\b(?:\d{1,3}\.){3}\d{1,3}\b)\ add iprange\ (.*)(BOTH|DHCP|BOOTP)?/i)
61
+ if matchobj
62
+ puts "line: #{linenumber} adding #{matchobj[1].to_s} range=#{matchobj[2].to_s}" if @debug
63
+ scopeip = matchobj[1]
64
+ self[scopeip].option = matchobj[3]
65
+ self[scopeip].startrange = matchobj[2].split(' ')[0]
66
+ self[scopeip].endrange = matchobj[2].split(' ')[1]
67
+ next
68
+ end
69
+ # Get the exclude range and scope
70
+ matchobj = line.match(/^Dhcp\ Server\ .+\ Scope\ (\b(?:\d{1,3}\.){3}\d{1,3}\b)\ add excluderange\ (.*)/i)
71
+ if matchobj
72
+ puts "line: #{linenumber} adding #{matchobj[1].to_s} excluderange=#{matchobj[2].to_s}" if @debug
73
+ scopeip = matchobj[1]
74
+ self[scopeip].addexclusion(matchobj[2].split(' '))
75
+ next
76
+ end
77
+ # get reserved Ip leases and scope ip
78
+ matchobj = line.match(/^Dhcp\ Server\ .+\ Scope\ (\b(?:\d{1,3}\.){3}\d{1,3}\b)\ add reservedip\ (.*)/i)
79
+ if matchobj
80
+ puts "line: #{linenumber} adding #{matchobj[1].to_s} reservedip=#{matchobj[2].to_s}" if @debug
81
+ scopeip = matchobj[1]
82
+ self[scopeip].addreservation(matchobj[2].split(' '))
83
+ next
84
+ end
85
+ }
86
+ end
87
+
88
+ end
89
+
90
+
91
+
92
+
@@ -0,0 +1,10 @@
1
+ class Exclusion
2
+ attr_accessor :startrange, :endrange
3
+ def initialize(range=[])
4
+ @startrange = range[0]
5
+ @endrange = range[1]
6
+ end
7
+ def to_s
8
+ return "#{@startrange} - #{@endrange}\n"
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ class Reservation
2
+ attr_accessor :ip, :mac, :hostname, :comment, :option
3
+ def initialize(reserve=[])
4
+ @ip = reserve[0]
5
+ @mac = reserve[1]
6
+ @hostname = reserve[2]
7
+ @comment = reserve[3]
8
+ @option = reserve[4]
9
+ end
10
+ def to_s
11
+ return "#{@ip} - #{@mac} - #{@hostname} - #{@comment} - #{@option}\n"
12
+ end
13
+ end
@@ -0,0 +1,52 @@
1
+ class Scope
2
+ attr_accessor :name, :net, :mask, :state, :desc, :option, :exclusions, :reserved, :reservations, :startrange, :endrange
3
+
4
+ def initialize(matchobj)
5
+ scopearray = matchobj.split(' ',3).to_a
6
+
7
+ @net = scopearray[0]
8
+ @mask = scopearray[1]
9
+ @name = scopearray[2].match(/([\w+\ ?]+)/i)[1]
10
+ # TODO Find out how to parse the description out
11
+ @desc = nil
12
+ @option = nil
13
+ @exclusions = Array.new
14
+ @reserved = Array.new
15
+ @reservations = Hash.new
16
+ end
17
+ def setstate value
18
+ @state = value
19
+ end
20
+ def addexclusion(range=[])
21
+ @exclusions << Exclusion.new(range)
22
+ end
23
+ def active?
24
+ return @state.to_i == 1
25
+ end
26
+ def listreservations
27
+ @reservations.keys
28
+ end
29
+ def getreservations
30
+ @reservations.values
31
+ end
32
+ def to_s
33
+ p= Array.new
34
+ p[0] = "Scope Network: #{@net}"
35
+ p[1] = "Scope Netmask: #{@mask}"
36
+ p[2] = "Scope Range: #{@startrange} - #{@endrange}"
37
+ p[3] = "Scope Name: #{@name}"
38
+ p[4] = "Scope option: #{@option}"
39
+ p[5] = "Scope desc: #{@desc}"
40
+ p[6] = "Scope active status: #{state}"
41
+ p[7] = "Scope IP exclusions: \n#{@exclusions}"
42
+ p[8] = "Scope current reservations: \n#{getreservations.to_s}"
43
+ p[9] = "\n"
44
+ return p
45
+
46
+ end
47
+ def addreservation(reservation=[])
48
+ newreservation = Reservation.new(reservation)
49
+ @reservations[newreservation.mac] = newreservation
50
+
51
+ end
52
+ end
@@ -0,0 +1,21 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{msdhcpdump}
3
+ s.author = "Corey Osman"
4
+ s.email = "corey@logicminds.biz"
5
+ s.homepage = "http://github.com/logicminds/msdhcpdump"
6
+ s.version = "0.1.1"
7
+ s.date = %q{2011-11-02}
8
+ s.summary = %q{Gem to parse Microsoft DHCP server dump}
9
+ s.description = "Easy way to parse a Microsoft DHCP dump of scopes"
10
+ s.files = [
11
+ "lib/msdhcpdump/exclusion.rb",
12
+ "lib/msdhcpdump/reservation.rb",
13
+ "lib/msdhcpdump/scope.rb",
14
+ "lib/msdhcpdump.rb",
15
+ "test.rb",
16
+ "sampledump.txt",
17
+ "msdhcpdump.gemspec",
18
+ ]
19
+ s.require_paths = ["lib"]
20
+ end
21
+
@@ -0,0 +1,917 @@
1
+
2
+
3
+ # ==============================================================
4
+ # Configuration Information for Server 192.168.20.54
5
+ # ==============================================================
6
+
7
+
8
+
9
+ # =====================================
10
+ # Add Classes
11
+ # =====================================
12
+
13
+ Dhcp Server 192.168.20.54 Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
14
+ Dhcp Server 192.168.20.54 Add Class "Default Network Access Protection Class" "Default special user class for Restricted Access clients" 4d534654205175610616e74696e65 0 b
15
+ Dhcp Server 192.168.20.54 Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
16
+ Dhcp Server 192.168.20.54 Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 and above Clients" 4d53465420352e30 1 b
17
+ Dhcp Server 192.168.20.54 Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
18
+ Dhcp Server 192.168.20.54 Add Class "Microsoft Options" "Microsoft vendor-specific options applicable to all Windows Clients" 4d534654 1 b
19
+ Dhcp Server 192.168.20.54 Add Class "Airespace" "Airespace Discovery Support" 4169726573706163652e415031323030 1 b
20
+ Dhcp Server 192.168.20.54 Add Class "Cisco Aironet 1251" "Vendor Class Identifier for Cisco Aironet 1251 AP" 436973636f204150206331323430 1 b
21
+
22
+ # =====================================
23
+ # Add Classes End
24
+ # =====================================
25
+
26
+
27
+ # =====================================
28
+ # Add Optiondef
29
+ # =====================================
30
+
31
+
32
+ Dhcp Server 192.168.20.54 Add Optiondef 121 "Classless Static Routes" BINARY 0 comment="Destination, mask and router IP addresses in priority order"
33
+ Dhcp Server 192.168.20.54 Add Optiondef 1 "Subnet Mask" IPADDRESS 0 comment="Subnet mask in network byte order" 0.0.0.0
34
+ Dhcp Server 192.168.20.54 Add Optiondef 2 "Time Offset" DWORD 0 comment="UCT offset in seconds" 0
35
+ Dhcp Server 192.168.20.54 Add Optiondef 3 "Router" IPADDRESS 1 comment="Array of router addresses ordered by preference" 0.0.0.0
36
+ Dhcp Server 192.168.20.54 Add Optiondef 4 "Time Server" IPADDRESS 1 comment="Array of time server addresses, by preference" 0.0.0.0
37
+ Dhcp Server 192.168.20.54 Add Optiondef 5 "Name Servers" IPADDRESS 1 comment="Array of name servers [IEN 116], by preference" 0.0.0.0
38
+ Dhcp Server 192.168.20.54 Add Optiondef 6 "DNS Servers" IPADDRESS 1 comment="Array of DNS servers, by preference" 0.0.0.0
39
+ Dhcp Server 192.168.20.54 Add Optiondef 7 "Log Servers" IPADDRESS 1 comment="Array of MIT_LCS UDP log servers on subnet" 0.0.0.0
40
+ Dhcp Server 192.168.20.54 Add Optiondef 8 "Cookie Servers" IPADDRESS 1 comment="Array of cookie servers, RFC 865" 0.0.0.0
41
+ Dhcp Server 192.168.20.54 Add Optiondef 9 "LPR Servers" IPADDRESS 1 comment="Array of RFC 1179 servers, by preference" 0.0.0.0
42
+ Dhcp Server 192.168.20.54 Add Optiondef 10 "Impress Servers" IPADDRESS 1 comment="Array of Imagen Impress Servers" 0.0.0.0
43
+ Dhcp Server 192.168.20.54 Add Optiondef 11 "Resource Location Servers" IPADDRESS 1 comment="Array of RFC 887 ResLoc Servers on subnet, by preference" 0.0.0.0
44
+ Dhcp Server 192.168.20.54 Add Optiondef 12 "Host Name" STRING 0 comment="Host name for client, RFC 1035 character set" ""
45
+ Dhcp Server 192.168.20.54 Add Optiondef 13 "Boot File Size" WORD 0 comment="Size of boot image file in 512-octet blocks" 0
46
+ Dhcp Server 192.168.20.54 Add Optiondef 14 "Merit Dump File" STRING 0 comment="Path name for crash dump file" ""
47
+ Dhcp Server 192.168.20.54 Add Optiondef 15 "DNS Domain Name" STRING 0 comment="DNS Domain name for client resolutions" ""
48
+ Dhcp Server 192.168.20.54 Add Optiondef 16 "Swap Server" IPADDRESS 0 comment="Address of client's swap server" 0.0.0.0
49
+ Dhcp Server 192.168.20.54 Add Optiondef 17 "Root Path" STRING 0 comment="Path name for client's root disk, char set NVT ASCII" ""
50
+ Dhcp Server 192.168.20.54 Add Optiondef 18 "Extensions Path" STRING 0 comment="tftp file for option extensions" ""
51
+ Dhcp Server 192.168.20.54 Add Optiondef 19 "IP Layer Forwarding" BYTE 0 comment="Disable/enable IP packet forwarding on this client" 0
52
+ Dhcp Server 192.168.20.54 Add Optiondef 20 "Nonlocal Source Routing" BYTE 0 comment="Disable/enable nonlocal datagrams" 0
53
+ Dhcp Server 192.168.20.54 Add Optiondef 21 "Policy Filter Masks" IPADDRESS 1 comment="Destination/mask IP address pairs to filter source routes" 0.0.0.0
54
+ Dhcp Server 192.168.20.54 Add Optiondef 22 "Max DG Reassembly Size" WORD 0 comment="Maximum size datagram for reassembly by client; max 576" 0
55
+ Dhcp Server 192.168.20.54 Add Optiondef 23 "Default IP Time-to-live" BYTE 0 comment="Default TTL for client's use on outgoing DGs" 0
56
+ Dhcp Server 192.168.20.54 Add Optiondef 24 "Path MTU Aging Timeout" DWORD 0 comment="Timeout in seconds for aging Path MTU values; RFC 1191" 0
57
+ Dhcp Server 192.168.20.54 Add Optiondef 25 "Path MTU Plateau Table" WORD 1 comment="MTU discovery sizes, sorted by size, all >= 68" 0
58
+ Dhcp Server 192.168.20.54 Add Optiondef 26 "MTU Option" WORD 0 comment="MTU discovery size, >= 68" 0
59
+ Dhcp Server 192.168.20.54 Add Optiondef 27 "All subnets are local" BYTE 0 comment="The client assumes that all subnets are local" 0
60
+ Dhcp Server 192.168.20.54 Add Optiondef 28 "Broadcast Address" IPADDRESS 0 comment="Broadcast address" 0.0.0.0
61
+ Dhcp Server 192.168.20.54 Add Optiondef 29 "Perform Mask Discovery" BYTE 0 comment="The client should use ICMP for subnet mask discovery." 0
62
+ Dhcp Server 192.168.20.54 Add Optiondef 30 "Mask Supplier Option" BYTE 0 comment="The client should respond to subnet mask requests via ICMP." 0
63
+ Dhcp Server 192.168.20.54 Add Optiondef 31 "Perform Router Discovery" BYTE 0 comment="The client should solicit routers using RFC 1256." 0
64
+ Dhcp Server 192.168.20.54 Add Optiondef 32 "Router Solicitation Address" IPADDRESS 0 comment="Address to use for router solicitation" 0.0.0.0
65
+ Dhcp Server 192.168.20.54 Add Optiondef 33 "Static Route Option" IPADDRESS 1 comment="Destination/router address pairs, in priority order" 0.0.0.0
66
+ Dhcp Server 192.168.20.54 Add Optiondef 34 "Trailer Encapsulation" BYTE 0 comment="The client should negotiate use of trailers (RFC 983)." 0
67
+ Dhcp Server 192.168.20.54 Add Optiondef 35 "ARP Cache Timeout" DWORD 0 comment="Timeout in seconds for ARP cache entries" 0
68
+ Dhcp Server 192.168.20.54 Add Optiondef 36 "Ethernet Encapsulation" BYTE 0 comment="0=>client should use ENet V2; 1=> IEEE 802.3" 0
69
+ Dhcp Server 192.168.20.54 Add Optiondef 37 "TCP Default Time-to-live" BYTE 0 comment="TTL that client uses when sending TCP segments" 0
70
+ Dhcp Server 192.168.20.54 Add Optiondef 38 "Keepalive Interval" DWORD 0 comment="Keepalive timeout in seconds" 0
71
+ Dhcp Server 192.168.20.54 Add Optiondef 39 "Keepalive Garbage" BYTE 0 comment="Send garbage octet" 0
72
+ Dhcp Server 192.168.20.54 Add Optiondef 40 "NIS Domain Name" STRING 0 comment="Name of Network Information Service domain" ""
73
+ Dhcp Server 192.168.20.54 Add Optiondef 41 "NIS Servers" IPADDRESS 1 comment="Addresses of NIS servers on client's subnet" 0.0.0.0
74
+ Dhcp Server 192.168.20.54 Add Optiondef 42 "NTP Servers" IPADDRESS 1 comment="Addresses of Network Time Protocol servers" 0.0.0.0
75
+ Dhcp Server 192.168.20.54 Add Optiondef 43 "Vendor Specific Info" BINARY 0 comment="Embedded vendor-specific options"
76
+ Dhcp Server 192.168.20.54 Add Optiondef 44 "WINS/NBNS Servers" IPADDRESS 1 comment="NBNS Address(es) in priority order" 0.0.0.0
77
+ Dhcp Server 192.168.20.54 Add Optiondef 45 "NetBIOS over TCP/IP NBDD" IPADDRESS 1 comment="NetBIOS over TCP/IP NBDD address(es) in priority order" 0.0.0.0
78
+ Dhcp Server 192.168.20.54 Add Optiondef 46 "WINS/NBT Node Type" BYTE 0 comment="0x1 = B-node, 0x2 = P-node, 0x4 = M-node, 0x8 = H-node" 0
79
+ Dhcp Server 192.168.20.54 Add Optiondef 47 "NetBIOS Scope ID" STRING 0 comment="NetBIOS over TCP/IP Scope ID" ""
80
+ Dhcp Server 192.168.20.54 Add Optiondef 48 "X Window System Font" IPADDRESS 1 comment="Array of X Windows font servers" 0.0.0.0
81
+ Dhcp Server 192.168.20.54 Add Optiondef 49 "X Window System Display" IPADDRESS 1 comment="Array of X Windows Display Mgr servers" 0.0.0.0
82
+ Dhcp Server 192.168.20.54 Add Optiondef 51 "Lease" DWORD 0 comment="Client IP address lease time in seconds" 0
83
+ Dhcp Server 192.168.20.54 Add Optiondef 58 "Renewal (T1) Time Value" DWORD 0 comment="Time between addr assignment to RENEWING state" 0
84
+ Dhcp Server 192.168.20.54 Add Optiondef 59 "Rebinding (T2) Time Value" DWORD 0 comment="Time from addr assignment to REBINDING state" 0
85
+ Dhcp Server 192.168.20.54 Add Optiondef 64 "NIS+ Domain Name" STRING 0 comment="The name of the client's NIS+ domain." ""
86
+ Dhcp Server 192.168.20.54 Add Optiondef 65 "NIS+ Servers" IPADDRESS 1 comment="A list of IP addresses indicating NIS+ servers" 0.0.0.0
87
+ Dhcp Server 192.168.20.54 Add Optiondef 66 "Boot Server Host Name" STRING 0 comment="TFTP boot server host name" ""
88
+ Dhcp Server 192.168.20.54 Add Optiondef 67 "Bootfile Name" STRING 0 comment="Bootfile Name" ""
89
+ Dhcp Server 192.168.20.54 Add Optiondef 68 "Mobile IP Home Agents" IPADDRESS 1 comment="Mobile IP home agents in priority order" 0.0.0.0
90
+ Dhcp Server 192.168.20.54 Add Optiondef 69 "Simple Mail Transport Protocol (SMTP) Servers" IPADDRESS 1 comment="List of SMTP servers available to the client" 0.0.0.0
91
+ Dhcp Server 192.168.20.54 Add Optiondef 70 "Post Office Protocol (POP3) Servers" IPADDRESS 1 comment="List of POP3 servers available to the client" 0.0.0.0
92
+ Dhcp Server 192.168.20.54 Add Optiondef 71 "Network News Transport Protocol (NNTP) Servers" IPADDRESS 1 comment="List of NNTP servers available to the client" 0.0.0.0
93
+ Dhcp Server 192.168.20.54 Add Optiondef 72 "World Wide Web (WWW) Servers" IPADDRESS 1 comment="List of WWW servers available to the client" 0.0.0.0
94
+ Dhcp Server 192.168.20.54 Add Optiondef 73 "Finger Servers" IPADDRESS 1 comment="List of Finger servers available to the client" 0.0.0.0
95
+ Dhcp Server 192.168.20.54 Add Optiondef 74 "Internet Relay Chat (IRC) Servers" IPADDRESS 1 comment="List of IRC servers available to the client" 0.0.0.0
96
+ Dhcp Server 192.168.20.54 Add Optiondef 75 "StreetTalk Servers" IPADDRESS 1 comment="List of StreetTalk servers available to the client" 0.0.0.0
97
+ Dhcp Server 192.168.20.54 Add Optiondef 76 "StreetTalk Directory Assistance (STDA) Servers" IPADDRESS 1 comment="List of STDA servers available to the client" 0.0.0.0
98
+ Dhcp Server 192.168.20.54 Add Optiondef 150 "TFTP Server IP Address" IPADDRESS 0 comment="" 0.0.0.0
99
+ Dhcp Server 192.168.20.54 Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1
100
+ Dhcp Server 192.168.20.54 Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 1
101
+ Dhcp Server 192.168.20.54 Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 1
102
+ Dhcp Server 192.168.20.54 Add Optiondef 1 "Microsoft Disable Netbios Option " DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Netbios for Microsoft Windows 2000 Clients" 1
103
+ Dhcp Server 192.168.20.54 Add Optiondef 2 "Microsoft Release DHCP Lease On Shutdown Option" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Option for enabling or disabling Windows 2000 Clients to release DHCP lease on shutdown" 1
104
+ Dhcp Server 192.168.20.54 Add Optiondef 3 "Microsoft Default Router Metric Base" DWORD 0 vendor="Microsoft Windows 2000 Options" comment="Default Router Base Metrics for Microsoft Windows 2000 Clients" 0
105
+ Dhcp Server 192.168.20.54 Add Optiondef 101 "Airespace IP Delivery" IPADDRESS 0 vendor="Airespace" comment="Deliver Appliance IP Address to AP" 0.0.0.0
106
+ Dhcp Server 192.168.20.54 Add Optiondef 241 "Option 43" IPADDRESS 1 vendor="Cisco Aironet 1251" comment="WLAN Controller IP Address" 0.0.0.0
107
+
108
+ # =====================================
109
+ # Add Optiondef End
110
+ # ====================================
111
+
112
+
113
+ # =====================================
114
+ # Set Optionvalue
115
+ # =====================================
116
+
117
+
118
+ # =====================================
119
+ # Set Optionvalue End
120
+ # =====================================
121
+
122
+
123
+ Dhcp Server 192.168.20.54 Set AuditLog "C:\Windows\system32\dhcp"
124
+ Dhcp Server 192.168.20.54 Set DatabaseBackupInterval 60
125
+ Dhcp Server 192.168.20.54 Set DatabaseBackupPath "C:\Windows\system32\dhcp\backup"
126
+ Dhcp Server 192.168.20.54 Set DatabaseCleanupInterval 60
127
+ Dhcp Server 192.168.20.54 Set DatabaseLoggingFlag 1
128
+ Dhcp Server 192.168.20.54 Set DatabaseName "dhcp.mdb"
129
+ Dhcp Server 192.168.20.54 Set DatabasePath "C:\Windows\system32\dhcp"
130
+ Dhcp Server 192.168.20.54 Set DatabaseRestoreFlag 0
131
+ Dhcp Server 192.168.20.54 Set DetectConflictRetry 2
132
+
133
+ # =====================================
134
+ # Add Scope
135
+ # =====================================
136
+
137
+ Dhcp Server 192.168.20.54 add scope 192.168.18.0 255.255.255.0 "Desktops" ""
138
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set state 1
139
+
140
+ # ======================================================================
141
+ # Start Add Ipranges to the Scope 192.168.18.0, Server 192.168.20.54
142
+ # ======================================================================
143
+
144
+
145
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 Add iprange 192.168.18.1 192.168.18.254 BOTH
146
+
147
+ # ======================================================================
148
+ # End Add Ipranges to the Scope 192.168.18.0, Server 192.168.20.54
149
+ # ======================================================================
150
+
151
+
152
+ # ======================================================================
153
+ # Start Add Excluderanges to the Scope : 192.168.18.0, Server : 192.168.20.54
154
+ # ======================================================================
155
+
156
+
157
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 add excluderange 192.168.18.220 192.168.18.254
158
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 add excluderange 192.168.18.1 192.168.18.39
159
+
160
+ # ======================================================================
161
+ # End Add Excluderanges to the Scope : 192.168.18.0, Server : 192.168.20.54
162
+ # ======================================================================
163
+
164
+
165
+ # ======================================================================
166
+ # Start Add OptionValues to the Scope : 192.168.18.0, Server : 192.168.20.54
167
+ # ======================================================================
168
+
169
+
170
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 51 DWORD "691200"
171
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 3 IPADDRESS "192.168.18.251"
172
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
173
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 15 STRING "sample.corp"
174
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
175
+ Dhcp Server 192.168.20.54 Scope 192.168.18.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
176
+
177
+ # ======================================================================
178
+ # End Add OptionValues to the Scope : 192.168.18.0, Server : 192.168.20.54
179
+ # ======================================================================
180
+
181
+
182
+ # ======================================================================
183
+ # Start Add ReservedIp to the Scope : 192.168.18.0, Server : 192.168.20.54
184
+ # ======================================================================
185
+
186
+
187
+
188
+ # ======================================================================
189
+ # End Add ReservedIp to the Scope : 192.168.18.0, Server : 192.168.20.54
190
+ # ======================================================================
191
+
192
+
193
+ Dhcp Server 192.168.20.54 add scope 192.168.19.0 255.255.255.0 "PDX IT" ""
194
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set state 1
195
+
196
+ # ======================================================================
197
+ # Start Add Ipranges to the Scope 192.168.19.0, Server 192.168.20.54
198
+ # ======================================================================
199
+
200
+
201
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add iprange 192.168.19.1 192.168.19.254 BOTH
202
+
203
+ # ======================================================================
204
+ # End Add Ipranges to the Scope 192.168.19.0, Server 192.168.20.54
205
+ # ======================================================================
206
+
207
+
208
+ # ======================================================================
209
+ # Start Add Excluderanges to the Scope : 192.168.19.0, Server : 192.168.20.54
210
+ # ======================================================================
211
+
212
+
213
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 add excluderange 192.168.19.1 192.168.19.39
214
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 add excluderange 192.168.19.220 192.168.19.254
215
+
216
+ # ======================================================================
217
+ # End Add Excluderanges to the Scope : 192.168.19.0, Server : 192.168.20.54
218
+ # ======================================================================
219
+
220
+
221
+ # ======================================================================
222
+ # Start Add OptionValues to the Scope : 192.168.19.0, Server : 192.168.20.54
223
+ # ======================================================================
224
+
225
+
226
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 51 DWORD "691200"
227
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 3 IPADDRESS "192.168.19.251"
228
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 15 STRING "SAMPLE.CORP"
229
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19"
230
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 66 STRING "192.168.20.130"
231
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 67 STRING "pxelinux.0"
232
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 101 IPADDRESS vendor="Airespace" "192.168.23.253"
233
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 241 IPADDRESS vendor="Cisco Aironet 1251" "192.168.23.252"
234
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
235
+
236
+ # ======================================================================
237
+ # End Add OptionValues to the Scope : 192.168.19.0, Server : 192.168.20.54
238
+ # ======================================================================
239
+
240
+
241
+ # ======================================================================
242
+ # Start Add ReservedIp to the Scope : 192.168.19.0, Server : 192.168.20.54
243
+ # ======================================================================
244
+
245
+
246
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add reservedip 192.168.19.118 001b78116561 "agent1.SAMPLE.CORP" "" "BOTH"
247
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add reservedip 192.168.19.53 001083b93d1b "agent2.SAMPLE.CORP" "" "DHCP"
248
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add reservedip 192.168.19.124 000e7fdeacab "agent3.sample.corp" "" "BOOTP"
249
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add reservedip 192.168.19.116 0000aacb1d58 "agent4.SAMPLE.CORP" "" "DHCP"
250
+ Dhcp Server 192.168.20.54 Scope 192.168.19.0 Add reservedip 192.168.19.126 0030c18cb7e0 "agent5.sample.corp" "" "BOOTP"
251
+
252
+ # ======================================================================
253
+ # End Add ReservedIp to the Scope : 192.168.19.0, Server : 192.168.20.54
254
+ # ======================================================================
255
+
256
+
257
+ Dhcp Server 192.168.20.54 add scope 192.168.20.0 255.255.255.0 "Servers Scope" ""
258
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set state 1
259
+
260
+ # ======================================================================
261
+ # Start Add Ipranges to the Scope 192.168.20.0, Server 192.168.20.54
262
+ # ======================================================================
263
+
264
+
265
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 Add iprange 192.168.20.1 192.168.20.254 BOTH
266
+
267
+ # ======================================================================
268
+ # End Add Ipranges to the Scope 192.168.20.0, Server 192.168.20.54
269
+ # ======================================================================
270
+
271
+
272
+ # ======================================================================
273
+ # Start Add Excluderanges to the Scope : 192.168.20.0, Server : 192.168.20.54
274
+ # ======================================================================
275
+
276
+
277
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 add excluderange 192.168.20.1 192.168.20.190
278
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 add excluderange 192.168.20.220 192.168.20.254
279
+
280
+ # ======================================================================
281
+ # End Add Excluderanges to the Scope : 192.168.20.0, Server : 192.168.20.54
282
+ # ======================================================================
283
+
284
+
285
+ # ======================================================================
286
+ # Start Add OptionValues to the Scope : 192.168.20.0, Server : 192.168.20.54
287
+ # ======================================================================
288
+
289
+
290
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 51 DWORD "691200"
291
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 3 IPADDRESS "192.168.20.251"
292
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 15 STRING "SAMPLE.CORP"
293
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
294
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
295
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 66 STRING "192.168.20.121"
296
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 67 STRING "pxelinux.0"
297
+ Dhcp Server 192.168.20.54 Scope 192.168.20.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
298
+
299
+ # ======================================================================
300
+ # End Add OptionValues to the Scope : 192.168.20.0, Server : 192.168.20.54
301
+ # ======================================================================
302
+
303
+
304
+ # ======================================================================
305
+ # Start Add ReservedIp to the Scope : 192.168.20.0, Server : 192.168.20.54
306
+ # ======================================================================
307
+
308
+
309
+
310
+ # ======================================================================
311
+ # End Add ReservedIp to the Scope : 192.168.20.0, Server : 192.168.20.54
312
+ # ======================================================================
313
+
314
+
315
+ Dhcp Server 192.168.20.54 add scope 192.168.23.0 255.255.255.0 "Wireless" ""
316
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set state 0
317
+
318
+ # ======================================================================
319
+ # Start Add Ipranges to the Scope 192.168.23.0, Server 192.168.20.54
320
+ # ======================================================================
321
+
322
+
323
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 Add iprange 192.168.23.1 192.168.23.254
324
+
325
+ # ======================================================================
326
+ # End Add Ipranges to the Scope 192.168.23.0, Server 192.168.20.54
327
+ # ======================================================================
328
+
329
+
330
+ # ======================================================================
331
+ # Start Add Excluderanges to the Scope : 192.168.23.0, Server : 192.168.20.54
332
+ # ======================================================================
333
+
334
+
335
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 add excluderange 192.168.23.1 192.168.23.39
336
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 add excluderange 192.168.23.220 192.168.23.254
337
+
338
+ # ======================================================================
339
+ # End Add Excluderanges to the Scope : 192.168.23.0, Server : 192.168.20.54
340
+ # ======================================================================
341
+
342
+
343
+ # ======================================================================
344
+ # Start Add OptionValues to the Scope : 192.168.23.0, Server : 192.168.20.54
345
+ # ======================================================================
346
+
347
+
348
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set optionvalue 51 DWORD "345600"
349
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set optionvalue 3 IPADDRESS "192.168.23.251"
350
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set optionvalue 15 STRING "SAMPLE.CORP"
351
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
352
+ Dhcp Server 192.168.20.54 Scope 192.168.23.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
353
+
354
+ # ======================================================================
355
+ # End Add OptionValues to the Scope : 192.168.23.0, Server : 192.168.20.54
356
+ # ======================================================================
357
+
358
+
359
+ # ======================================================================
360
+ # Start Add ReservedIp to the Scope : 192.168.23.0, Server : 192.168.20.54
361
+ # ======================================================================
362
+
363
+
364
+
365
+ # ======================================================================
366
+ # End Add ReservedIp to the Scope : 192.168.23.0, Server : 192.168.20.54
367
+ # ======================================================================
368
+
369
+
370
+ Dhcp Server 192.168.20.54 add scope 192.168.24.0 255.255.255.0 "Guest Network" ""
371
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 set state 1
372
+
373
+ # ======================================================================
374
+ # Start Add Ipranges to the Scope 192.168.24.0, Server 192.168.20.54
375
+ # ======================================================================
376
+
377
+
378
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 Add iprange 192.168.24.1 192.168.24.254
379
+
380
+ # ======================================================================
381
+ # End Add Ipranges to the Scope 192.168.24.0, Server 192.168.20.54
382
+ # ======================================================================
383
+
384
+
385
+ # ======================================================================
386
+ # Start Add Excluderanges to the Scope : 192.168.24.0, Server : 192.168.20.54
387
+ # ======================================================================
388
+
389
+
390
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 add excluderange 192.168.24.220 192.168.24.254
391
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 add excluderange 192.168.24.1 192.168.24.39
392
+
393
+ # ======================================================================
394
+ # End Add Excluderanges to the Scope : 192.168.24.0, Server : 192.168.20.54
395
+ # ======================================================================
396
+
397
+
398
+ # ======================================================================
399
+ # Start Add OptionValues to the Scope : 192.168.24.0, Server : 192.168.20.54
400
+ # ======================================================================
401
+
402
+
403
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 set optionvalue 51 DWORD "14400"
404
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 set optionvalue 3 IPADDRESS "192.168.24.251"
405
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19"
406
+ Dhcp Server 192.168.20.54 Scope 192.168.24.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
407
+
408
+ # ======================================================================
409
+ # End Add OptionValues to the Scope : 192.168.24.0, Server : 192.168.20.54
410
+ # ======================================================================
411
+
412
+
413
+ # ======================================================================
414
+ # Start Add ReservedIp to the Scope : 192.168.24.0, Server : 192.168.20.54
415
+ # ======================================================================
416
+
417
+
418
+
419
+ # ======================================================================
420
+ # End Add ReservedIp to the Scope : 192.168.24.0, Server : 192.168.20.54
421
+ # ======================================================================
422
+
423
+
424
+ Dhcp Server 192.168.20.54 add scope 192.168.25.0 255.255.255.0 "Voice" ""
425
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set state 1
426
+
427
+ # ======================================================================
428
+ # Start Add Ipranges to the Scope 192.168.25.0, Server 192.168.20.54
429
+ # ======================================================================
430
+
431
+
432
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 Add iprange 192.168.25.1 192.168.25.254
433
+
434
+ # ======================================================================
435
+ # End Add Ipranges to the Scope 192.168.25.0, Server 192.168.20.54
436
+ # ======================================================================
437
+
438
+
439
+ # ======================================================================
440
+ # Start Add Excluderanges to the Scope : 192.168.25.0, Server : 192.168.20.54
441
+ # ======================================================================
442
+
443
+
444
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 add excluderange 192.168.25.1 192.168.25.39
445
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 add excluderange 192.168.25.220 192.168.25.254
446
+
447
+ # ======================================================================
448
+ # End Add Excluderanges to the Scope : 192.168.25.0, Server : 192.168.20.54
449
+ # ======================================================================
450
+
451
+
452
+ # ======================================================================
453
+ # Start Add OptionValues to the Scope : 192.168.25.0, Server : 192.168.20.54
454
+ # ======================================================================
455
+
456
+
457
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 51 DWORD "691200"
458
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 3 IPADDRESS "192.168.25.251"
459
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
460
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
461
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 15 STRING "sample.corp"
462
+ Dhcp Server 192.168.20.54 Scope 192.168.25.0 set optionvalue 150 IPADDRESS "192.168.21.10"
463
+
464
+ # ======================================================================
465
+ # End Add OptionValues to the Scope : 192.168.25.0, Server : 192.168.20.54
466
+ # ======================================================================
467
+
468
+
469
+ # ======================================================================
470
+ # Start Add ReservedIp to the Scope : 192.168.25.0, Server : 192.168.20.54
471
+ # ======================================================================
472
+
473
+
474
+
475
+ # ======================================================================
476
+ # End Add ReservedIp to the Scope : 192.168.25.0, Server : 192.168.20.54
477
+ # ======================================================================
478
+
479
+
480
+ Dhcp Server 192.168.20.54 add scope 192.168.27.0 255.255.255.0 "Maintenance" ""
481
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set state 1
482
+
483
+ # ======================================================================
484
+ # Start Add Ipranges to the Scope 192.168.27.0, Server 192.168.20.54
485
+ # ======================================================================
486
+
487
+
488
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 Add iprange 192.168.27.1 192.168.27.254 BOTH
489
+
490
+ # ======================================================================
491
+ # End Add Ipranges to the Scope 192.168.27.0, Server 192.168.20.54
492
+ # ======================================================================
493
+
494
+
495
+ # ======================================================================
496
+ # Start Add Excluderanges to the Scope : 192.168.27.0, Server : 192.168.20.54
497
+ # ======================================================================
498
+
499
+
500
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 add excluderange 192.168.27.200 192.168.27.254
501
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 add excluderange 192.168.27.1 192.168.27.100
502
+
503
+ # ======================================================================
504
+ # End Add Excluderanges to the Scope : 192.168.27.0, Server : 192.168.20.54
505
+ # ======================================================================
506
+
507
+
508
+ # ======================================================================
509
+ # Start Add OptionValues to the Scope : 192.168.27.0, Server : 192.168.20.54
510
+ # ======================================================================
511
+
512
+
513
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
514
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set optionvalue 51 DWORD "28800"
515
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set optionvalue 3 IPADDRESS "192.168.27.251"
516
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
517
+ Dhcp Server 192.168.20.54 Scope 192.168.27.0 set optionvalue 51 DWORD user="Default BOOTP Class" "259200"
518
+
519
+ # ======================================================================
520
+ # End Add OptionValues to the Scope : 192.168.27.0, Server : 192.168.20.54
521
+ # ======================================================================
522
+
523
+
524
+ # ======================================================================
525
+ # Start Add ReservedIp to the Scope : 192.168.27.0, Server : 192.168.20.54
526
+ # ======================================================================
527
+
528
+
529
+
530
+ # ======================================================================
531
+ # End Add ReservedIp to the Scope : 192.168.27.0, Server : 192.168.20.54
532
+ # ======================================================================
533
+
534
+
535
+ Dhcp Server 192.168.20.54 add scope 192.168.248.0 255.255.255.0 "VPN" "VPN Description"
536
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set state 0
537
+
538
+ # ======================================================================
539
+ # Start Add Ipranges to the Scope 192.168.248.0, Server 192.168.20.54
540
+ # ======================================================================
541
+
542
+
543
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 Add iprange 192.168.248.1 192.168.248.254
544
+
545
+ # ======================================================================
546
+ # End Add Ipranges to the Scope 192.168.248.0, Server 192.168.20.54
547
+ # ======================================================================
548
+
549
+
550
+ # ======================================================================
551
+ # Start Add Excluderanges to the Scope : 192.168.248.0, Server : 192.168.20.54
552
+ # ======================================================================
553
+
554
+
555
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 add excluderange 192.168.248.200 192.168.248.254
556
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 add excluderange 192.168.248.1 192.168.248.100
557
+
558
+ # ======================================================================
559
+ # End Add Excluderanges to the Scope : 192.168.248.0, Server : 192.168.20.54
560
+ # ======================================================================
561
+
562
+
563
+ # ======================================================================
564
+ # Start Add OptionValues to the Scope : 192.168.248.0, Server : 192.168.20.54
565
+ # ======================================================================
566
+
567
+
568
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 51 DWORD "14400"
569
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19"
570
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 44 IPADDRESS "192.168.20.11" "192.168.20.19"
571
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 3 IPADDRESS "192.168.248.251"
572
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 15 STRING "sample.corp"
573
+ Dhcp Server 192.168.20.54 Scope 192.168.248.0 set optionvalue 46 BYTE "8"
574
+
575
+ # ======================================================================
576
+ # End Add OptionValues to the Scope : 192.168.248.0, Server : 192.168.20.54
577
+ # ======================================================================
578
+
579
+
580
+ # ======================================================================
581
+ # Start Add ReservedIp to the Scope : 192.168.248.0, Server : 192.168.20.54
582
+ # ======================================================================
583
+
584
+
585
+
586
+ # ======================================================================
587
+ # End Add ReservedIp to the Scope : 192.168.248.0, Server : 192.168.20.54
588
+ # ======================================================================
589
+
590
+
591
+ Dhcp Server 192.168.20.54 add scope 192.168.249.0 255.255.255.0 "Main VPN" ""
592
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set state 1
593
+
594
+ # ======================================================================
595
+ # Start Add Ipranges to the Scope 192.168.249.0, Server 192.168.20.54
596
+ # ======================================================================
597
+
598
+
599
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 Add iprange 192.168.249.1 192.168.249.254
600
+
601
+ # ======================================================================
602
+ # End Add Ipranges to the Scope 192.168.249.0, Server 192.168.20.54
603
+ # ======================================================================
604
+
605
+
606
+ # ======================================================================
607
+ # Start Add Excluderanges to the Scope : 192.168.249.0, Server : 192.168.20.54
608
+ # ======================================================================
609
+
610
+
611
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 add excluderange 192.168.249.65 192.168.249.65
612
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 add excluderange 192.168.249.220 192.168.249.254
613
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 add excluderange 192.168.249.1 192.168.249.39
614
+
615
+ # ======================================================================
616
+ # End Add Excluderanges to the Scope : 192.168.249.0, Server : 192.168.20.54
617
+ # ======================================================================
618
+
619
+
620
+ # ======================================================================
621
+ # Start Add OptionValues to the Scope : 192.168.249.0, Server : 192.168.20.54
622
+ # ======================================================================
623
+
624
+
625
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set optionvalue 51 DWORD "14400"
626
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set optionvalue 3 IPADDRESS "192.168.249.251"
627
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set optionvalue 15 STRING "SAMPLE.CORP"
628
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
629
+ Dhcp Server 192.168.20.54 Scope 192.168.249.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
630
+
631
+ # ======================================================================
632
+ # End Add OptionValues to the Scope : 192.168.249.0, Server : 192.168.20.54
633
+ # ======================================================================
634
+
635
+
636
+ # ======================================================================
637
+ # Start Add ReservedIp to the Scope : 192.168.249.0, Server : 192.168.20.54
638
+ # ======================================================================
639
+
640
+
641
+
642
+ # ======================================================================
643
+ # End Add ReservedIp to the Scope : 192.168.249.0, Server : 192.168.20.54
644
+ # ======================================================================
645
+
646
+
647
+ Dhcp Server 192.168.20.54 add scope 10.20.0.0 255.255.255.0 "Another Server Scope" ""
648
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set state 1
649
+
650
+ # ======================================================================
651
+ # Start Add Ipranges to the Scope 10.20.0.0, Server 192.168.20.54
652
+ # ======================================================================
653
+
654
+
655
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 Add iprange 10.20.0.1 10.20.0.254 BOTH
656
+
657
+ # ======================================================================
658
+ # End Add Ipranges to the Scope 10.20.0.0, Server 192.168.20.54
659
+ # ======================================================================
660
+
661
+
662
+ # ======================================================================
663
+ # Start Add Excluderanges to the Scope : 10.20.0.0, Server : 192.168.20.54
664
+ # ======================================================================
665
+
666
+
667
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 add excluderange 10.20.0.1 10.20.0.100
668
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 add excluderange 10.20.0.200 10.20.0.254
669
+
670
+ # ======================================================================
671
+ # End Add Excluderanges to the Scope : 10.20.0.0, Server : 192.168.20.54
672
+ # ======================================================================
673
+
674
+
675
+ # ======================================================================
676
+ # Start Add OptionValues to the Scope : 10.20.0.0, Server : 192.168.20.54
677
+ # ======================================================================
678
+
679
+
680
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 51 DWORD "691200"
681
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 3 IPADDRESS "10.20.0.251"
682
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 15 STRING "SAMPLE.CORP"
683
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
684
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 44 IPADDRESS "192.168.20.11" "192.168.20.19"
685
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 46 BYTE "8"
686
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
687
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 66 STRING "192.168.20.130"
688
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 67 STRING "pxelinux.0"
689
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 241 IPADDRESS vendor="Cisco Aironet 1251" "192.168.23.252"
690
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 101 IPADDRESS vendor="Airespace" "192.168.23.253"
691
+ Dhcp Server 192.168.20.54 Scope 10.20.0.0 set optionvalue 51 DWORD user="Default BOOTP Class" "691200"
692
+
693
+ # ======================================================================
694
+ # End Add OptionValues to the Scope : 10.20.0.0, Server : 192.168.20.54
695
+ # ======================================================================
696
+
697
+
698
+ # ======================================================================
699
+ # Start Add ReservedIp to the Scope : 10.20.0.0, Server : 192.168.20.54
700
+ # ======================================================================
701
+
702
+
703
+
704
+ # ======================================================================
705
+ # End Add ReservedIp to the Scope : 10.20.0.0, Server : 192.168.20.54
706
+ # ======================================================================
707
+
708
+
709
+ Dhcp Server 192.168.20.54 add scope 10.20.8.0 255.255.255.0 "Terminal Velocity" ""
710
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set state 1
711
+
712
+ # ======================================================================
713
+ # Start Add Ipranges to the Scope 10.20.8.0, Server 192.168.20.54
714
+ # ======================================================================
715
+
716
+
717
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 Add iprange 10.20.8.1 10.20.8.254
718
+
719
+ # ======================================================================
720
+ # End Add Ipranges to the Scope 10.20.8.0, Server 192.168.20.54
721
+ # ======================================================================
722
+
723
+
724
+ # ======================================================================
725
+ # Start Add Excluderanges to the Scope : 10.20.8.0, Server : 192.168.20.54
726
+ # ======================================================================
727
+
728
+
729
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 add excluderange 10.20.8.1 10.20.8.39
730
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 add excluderange 10.20.8.220 10.20.8.254
731
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 add excluderange 10.20.8.80 10.20.8.81
732
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 add excluderange 10.20.8.90 10.20.8.90
733
+
734
+ # ======================================================================
735
+ # End Add Excluderanges to the Scope : 10.20.8.0, Server : 192.168.20.54
736
+ # ======================================================================
737
+
738
+
739
+ # ======================================================================
740
+ # Start Add OptionValues to the Scope : 10.20.8.0, Server : 192.168.20.54
741
+ # ======================================================================
742
+
743
+
744
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 51 DWORD "691200"
745
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 3 IPADDRESS "10.20.8.251"
746
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 15 STRING "SAMPLE.CORP"
747
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19" "192.168.99.59"
748
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 44 IPADDRESS "192.168.20.11" "192.168.20.19"
749
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 46 BYTE "8"
750
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
751
+
752
+ # ======================================================================
753
+ # End Add OptionValues to the Scope : 10.20.8.0, Server : 192.168.20.54
754
+ # ======================================================================
755
+
756
+
757
+ # ======================================================================
758
+ # Start Add ReservedIp to the Scope : 10.20.8.0, Server : 192.168.20.54
759
+ # ======================================================================
760
+
761
+
762
+ Dhcp Server 192.168.20.54 Scope 10.20.8.0 Add reservedip 10.20.8.20 005056930f9c "test1.SAMPLE.CORP" "" "BOTH"
763
+
764
+ # ======================================================================
765
+ # End Add ReservedIp to the Scope : 10.20.8.0, Server : 192.168.20.54
766
+ # ======================================================================
767
+
768
+
769
+ Dhcp Server 192.168.20.54 add scope 10.20.208.0 255.255.255.0 "Test Net" ""
770
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set state 1
771
+
772
+ # ======================================================================
773
+ # Start Add Ipranges to the Scope 10.20.208.0, Server 192.168.20.54
774
+ # ======================================================================
775
+
776
+
777
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add iprange 10.20.208.100 10.20.208.200 BOTH
778
+
779
+ # ======================================================================
780
+ # End Add Ipranges to the Scope 10.20.208.0, Server 192.168.20.54
781
+ # ======================================================================
782
+
783
+
784
+ # ======================================================================
785
+ # Start Add Excluderanges to the Scope : 10.20.208.0, Server : 192.168.20.54
786
+ # ======================================================================
787
+
788
+
789
+
790
+ # ======================================================================
791
+ # End Add Excluderanges to the Scope : 10.20.208.0, Server : 192.168.20.54
792
+ # ======================================================================
793
+
794
+
795
+ # ======================================================================
796
+ # Start Add OptionValues to the Scope : 10.20.208.0, Server : 192.168.20.54
797
+ # ======================================================================
798
+
799
+
800
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 51 DWORD "691200"
801
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 3 IPADDRESS "10.20.208.251"
802
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 15 STRING "SAMPLE.CORP"
803
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 6 IPADDRESS "192.168.20.11" "192.168.20.19"
804
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 4 IPADDRESS "192.168.20.11" "192.168.20.19"
805
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 66 STRING "192.168.20.130"
806
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 67 STRING "pxelinux.0"
807
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
808
+
809
+ # ======================================================================
810
+ # End Add OptionValues to the Scope : 10.20.208.0, Server : 192.168.20.54
811
+ # ======================================================================
812
+
813
+
814
+ # ======================================================================
815
+ # Start Add ReservedIp to the Scope : 10.20.208.0, Server : 192.168.20.54
816
+ # ======================================================================
817
+
818
+
819
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.114 0050b622ded7 "test2.sample.corp" "" "BOTH"
820
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.117 005056ac15cd "test3" "" "BOTH"
821
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.129 005056ac07c5 "test4" "" "BOTH"
822
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.131 005056ac4ec0 "test5" "" "BOTH"
823
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.145 005056ac27c7 "test6" "" "BOTH"
824
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.151 005056ac00c8 "test7.sample.corp" "" "BOTH"
825
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 Add reservedip 10.20.208.152 005056ac00c7 "test8.sample.corp" "" "BOTH"
826
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set reservedoptionvalue 10.20.208.154 66 STRING "foreman.sample.corp"
827
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set reservedoptionvalue 10.20.208.154 67 STRING "pxelinux.0"
828
+ Dhcp Server 192.168.20.54 Scope 10.20.208.0 set reservedoptionvalue 10.20.208.154 12 STRING "puppet.sample.corp"
829
+
830
+ # ======================================================================
831
+ # End Add ReservedIp to the Scope : 10.20.208.0, Server : 192.168.20.54
832
+ # ======================================================================
833
+
834
+
835
+ Dhcp Server 192.168.20.54 add scope 10.20.253.0 255.255.255.0 "Cisco VPN" ""
836
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 set state 1
837
+
838
+ # ======================================================================
839
+ # Start Add Ipranges to the Scope 10.20.253.0, Server 192.168.20.54
840
+ # ======================================================================
841
+
842
+
843
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 Add iprange 10.20.253.1 10.20.253.254
844
+
845
+ # ======================================================================
846
+ # End Add Ipranges to the Scope 10.20.253.0, Server 192.168.20.54
847
+ # ======================================================================
848
+
849
+
850
+ # ======================================================================
851
+ # Start Add Excluderanges to the Scope : 10.20.253.0, Server : 192.168.20.54
852
+ # ======================================================================
853
+
854
+
855
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 add excluderange 10.20.253.1 10.20.253.39
856
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 add excluderange 10.20.253.220 10.20.253.254
857
+
858
+ # ======================================================================
859
+ # End Add Excluderanges to the Scope : 10.20.253.0, Server : 192.168.20.54
860
+ # ======================================================================
861
+
862
+
863
+ # ======================================================================
864
+ # Start Add OptionValues to the Scope : 10.20.253.0, Server : 192.168.20.54
865
+ # ======================================================================
866
+
867
+
868
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 set optionvalue 51 DWORD "3600"
869
+ Dhcp Server 192.168.20.54 Scope 10.20.253.0 set optionvalue 51 DWORD user="Default BOOTP Class" "2592000"
870
+
871
+ # ======================================================================
872
+ # End Add OptionValues to the Scope : 10.20.253.0, Server : 192.168.20.54
873
+ # ======================================================================
874
+
875
+
876
+ # ======================================================================
877
+ # Start Add ReservedIp to the Scope : 10.20.253.0, Server : 192.168.20.54
878
+ # ======================================================================
879
+
880
+
881
+
882
+ # ======================================================================
883
+ # End Add ReservedIp to the Scope : 10.20.253.0, Server : 192.168.20.54
884
+ # ======================================================================
885
+
886
+
887
+
888
+ # =====================================
889
+ # Add Scope End
890
+ # =====================================
891
+
892
+
893
+ # =====================================
894
+ # Add Super Scope
895
+ # =====================================
896
+
897
+
898
+ # =====================================
899
+ # Add Super Scope End
900
+ # =====================================
901
+
902
+ # =====================================
903
+ # Add MScope
904
+ # =====================================
905
+
906
+
907
+
908
+ # =====================================
909
+ # Add MScope End
910
+ # =====================================
911
+
912
+
913
+ # ==============================================================
914
+ # Configuration Information for Server 192.168.20.54 Ends
915
+ # ==============================================================
916
+
917
+
data/test.rb ADDED
@@ -0,0 +1,41 @@
1
+ #!/bin/ruby
2
+ # Author: Corey Osman
3
+ # Date: 11/1/11
4
+ # Purpose: code to parse msdhcp dump text from dhcp server
5
+ # This will get all the dhcp scope information available via the dump file.
6
+ # This file is a sample program that uses the msdhcpdump gem to parse a dump file into objects
7
+
8
+ require 'rubygems'
9
+ require 'msdhcpdump'
10
+
11
+
12
+ dumpfile = File.open('sampledump.txt', 'r')
13
+ @dhcpdump = Msdhcpdump.new(dumpfile)
14
+
15
+ # List the all the dhcp scopes found in the dump
16
+ puts "\nAll scopes in dump file"
17
+ puts @dhcpdump.list
18
+
19
+ # Show the properties of a specific scope
20
+ puts "\nShow the properties of scope"
21
+ puts @dhcpdump["192.168.19.0"].to_s
22
+ # Show the exclusions
23
+ puts "\nShow the Exclusions \n"
24
+ puts @dhcpdump["192.168.19.0"].exclusions
25
+
26
+ # Show the reservations of the scope
27
+ puts "\nScope Reservations\n"
28
+ puts @dhcpdump["192.168.19.0"].reservations
29
+
30
+ # Show Active Scopes
31
+ puts "\nAll Active Scopes"
32
+ @dhcpdump.each_value do |sc|
33
+ puts "#{sc.net}" if sc.active?
34
+ end
35
+
36
+ # Show All Scope properties
37
+ puts "\n"
38
+ @dhcpdump.each_value do |sc|
39
+ puts sc.to_s
40
+ end
41
+ dumpfile.close
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: msdhcpdump
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 1
9
+ version: 0.1.1
10
+ platform: ruby
11
+ authors:
12
+ - Corey Osman
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-11-02 00:00:00 -07:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Easy way to parse a Microsoft DHCP dump of scopes
22
+ email: corey@logicminds.biz
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - lib/msdhcpdump/exclusion.rb
31
+ - lib/msdhcpdump/reservation.rb
32
+ - lib/msdhcpdump/scope.rb
33
+ - lib/msdhcpdump.rb
34
+ - test.rb
35
+ - sampledump.txt
36
+ - msdhcpdump.gemspec
37
+ has_rdoc: true
38
+ homepage: http://github.com/logicminds/msdhcpdump
39
+ licenses: []
40
+
41
+ post_install_message:
42
+ rdoc_options: []
43
+
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ segments:
51
+ - 0
52
+ version: "0"
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ requirements: []
61
+
62
+ rubyforge_project:
63
+ rubygems_version: 1.3.6
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Gem to parse Microsoft DHCP server dump
67
+ test_files: []
68
+