From ce73aa40ec89ae08f58052e09e37e7e2631f675e Mon Sep 17 00:00:00 2001 From: huangxin Date: Mon, 19 Sep 2022 16:25:34 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20ZNJK-1000=20=E5=A2=9E=E5=8A=A0DHCP=20Serv?= =?UTF-8?q?er=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/opendhcp.ini | 360 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 config/opendhcp.ini diff --git a/config/opendhcp.ini b/config/opendhcp.ini new file mode 100644 index 0000000..3ef6ceb --- /dev/null +++ b/config/opendhcp.ini @@ -0,0 +1,360 @@ +# This is configuration file, may need editing +# Any line starting with a punctuation character will be a comment +# You need to remove ' from begining of values and replace with your +# own values below if you need change settings. + + +[LISTEN_ON] +# Specify the Interfaces you would like Server to listen +# if you have more than one NIC card on your server +# always specify which cards will listen DHCP/DNS requests +# Requests from diffent Interfaces look for matching DHCP ranges. +# Requests from relay agents look for matching range to relay agent IP. +# upto 125 interfaces can be specified +# Default is All static Interfaces +192.168.30.1 + + +[LOGGING] +# LogLevel can be set as None, Errors or All +# It is advisable to keep logging to Normal, Normal include errors +# and DHCP renewal messages. Normal is defaul logging also. +;LogLevel=None +;LogLevel=Normal +LogLevel=All + + +[REPLICATION_SERVERS] +# You can have 2 instances of Open DHCP Servers in a network. Open DHCP Server +# will send replication inform messages to other instance of Open DHCP +# server and leases will be replicated. The IP address alloted by one server +# will not be realotted by other server to another host. Also when one server +# goes down, other can will renew the leases, without NAK and DISCOVER. You need +# to specify Primary and secondary servers for replication to work. +# Make sure that Primary & Secondary Server entries are identical on both +# servers. You may copy the entire ini file on both servers and change the +# LISTEN_ON on individual servers, if needed. +;Primary=192.168.0.253 +;Secondary=192.168.0.254 + + +[HTTP_INTERFACE] +# This is http inerface for viewing lease status, +# Default is 127.0.0.1:6789 +# You can change it here to any network interface. +HTTPServer=192.168.30.1:6789 +# Also to limit the clients access, you can specify upto 8 +# HTTP client IPs Here. If no Client IP is specified then All +# Clients can access the HTTP Interface +HTTPClient=192.168.30.1 +HTTPClient=192.168.30.110 +;HTTPClient=192.168.23.123 +# You can also change the title of html page +;HTTPTitle=This is Custom Title + + +# Sections below are other DHCP Sections. Clients can be alotted addresses in +# two ways, dynamically from DHCP Range or statically. For static addresses, +# client section needs to be created for each static client +# against its MAC Address. BOOTP clients are allways static. +# The DHCP Ranges are grouped into [RANGE_SET]s, so that range specific options +# can be specified for a group of ranges at one place. The total ranges together +# in all [RANGE_SET]s is also 125 and there can also be 125 [RANGE_SET]s max. +# You can specify one or more ranges in each [RANGE_SET] section, in format +# specified. Open DHCP Server will alot addresses from these ranges. Static Hosts +# and BootP clients do not need ranges. No need to specify any [RANGE_SET] +# or DHCP_Range if all clients are Static. + +# The Policy for alloting dynamic address is:- +# 1)First Look if MacAddress is specified as Static DHCP Client and use that IP +# 2)If not found look for old expired/active address of same host +# 3)If not,look at requested IP Address and if it is free +# 4)If not, allot virgin IP Adress, if any available +# 5)If no virgin IP address exists, allot expired IP address of other host. +# From 2) to 6), requests from diffent Interfaces look for matching DHCP ranges +# of Interface IP and requests from relay agents look for matching range to +# relay agent IP. + +# All the ranges in a [RANGE_SET] section can be further restricted +# by Filter_Mac_Range, Filter_Vender_Class and Filter_User_Class +# If for example Mac Range is specified, then this section's ranges +# will only be available to hosts, whoes Mac Address +# Falls in this range. Also if any host has matching Filter_Mac_Range in +# any DHCP_RANGE section then other DHCP Range sections +# without Filter_Mac_Range or not having matching Mac Range will +# not be available to it. Each Manufacturer has a fixed Mac Range. +# However Mac ranges can repeat in many DHCP_RANGE sections. +# For Filter_Vendor_Class (option 60) and Filter_User_Class filter (option 77), +# the range would only be available to matching value of Filter_Vender_Class +# and Filter_User_Class sent in client request. If Filter_Vender_Class and +# Filter_User_Class do match in one or more ranges, other ranges with missing +# or not matching values would not be available to such clients. +# You can specify upto 32 Filter_Mac_Range, Filter_Vender_Class and +# Filter_User_Class in each [RANGE_SET]. + +# Generally you dont have to specify any filters for relay agent. The range is +# automatically selected based on relay agent IP and range's subnetmask. Relay agent +# always sends it's subnet side IP. This server would only use the DHCP Range, which +# matches this IP. This would ensure that correct range is used. This feature +# eliminate the need of additional configuration. For matching purpose, range is +# recalculated using Subnet Mask of range and Relay Agent IP. However if you want +# to manually configure the subnet selection, you can use FilterSubnetSelection in +# a RANGE_SET. If this fitler is specified it will be first matched with SubnetSelection +# Option 118 sent by client. If client sends no such option, it will be matched +# with relay Agent IP. If not relay agent IP is sent, Listening Interface's IP +# will be matched. You can also override the Target Relay Agent using TargetRelayAgent option. + +[RANGE_SET] +# This is first and simple DHCP range section example, +# This example may be good enough for simple/home use. +# If you need range filters, look at example below +DHCPRange=192.168.30.110-192.168.30.120 +;DHCPRange=192.168.5.1-192.168.5.254 +# Following are range specific DHCP options. +# You can copy more options names from [GLOBAL_OPTIONS] +SubnetMask=255.255.255.0 +DomainServer=114.114.114.114,8.8.8.8 +#Router is default gateway +Router=192.168.30.1 +# Lease Time can be different for this Range +;AddressTime=360 + +[RANGE_SET] +# This section is also simple [RANGE_SET] section +# Here the options are specified as flat options. +;DHCPRange=192.168.0.1-192.168.0.254 +;DHCPRange=192.168.4.1-192.168.4.254 +;DHCPRange=192.168.5.1-192.168.5.254 +# Following are flat range specific DHCP options. +# SubnetMask below +;1=255.255.255.0 +# DomainServers below +;6=192.168.0.1, 192.168.0.2 +#Router is default gateway +;3=192.168.0.1 +# AddressTime +;51=11000 + + +[RANGE_SET] +# This is filtered [RANGE_SET] section. +# First eight entries in this example are filters. +# Currently only following types of filters are supported +# However 32 filters of each type can be specified +;FilterMacRange=00:0d:60:c5:4e:00-00:0d:60:c5:4e:ff +;FilterMacRange=00:0e:12:c5:4e:00-00:0e:12:c5:4e:ff +;FilterMacRange=00:0f:60:c5:4e:a1-00:0f:60:c5:4e:a1 +;FilterVendorClass="MSFT 5.0" +;FilterVendorClass="MSFT 5.1" +;FilterVendorClass="MSFT 5.2" +;FilterUserClass="My User Class 4.0" +;FilterUserClass=123,56,87,123,109,0,23,56,156,209,234,56 +;FilterUserClass=00:0d:60:c5:4e:0d:60:c5:4e +# You can select RANGE_SET based on FilterSubnetSelection +;FilterSubnetSelection=192.168.55.1 +;FilterSubnetSelection=192.168.33.1 +#You can send DHCP Messages for this range to TargetRelayAgent +;TargetRelayAgent=192.168.44.11 +# Next few are actual ranges of this section. +;DHCPRange=10.0.0.5-10.0.0.10 +;DHCPRange=10.0.10.1-10.0.10.254 +;DHCPRange=10.0.1.1-10.0.1.254 +;DHCPRange=10.0.2.1-10.0.2.254 +# Following are range specific DHCP options. +# You can copy more option names from [GLOBAL_OPTIONS] +# or add flat options like 240="this is the string value" +# or as IP like 6=192.168.5.1 +# or byte array like 6=123,45,1,0,3,67,4,3,22,4,3,5 +# or hex array like 6=23:89:a5:ba:a9:e4 +;SubnetMask=255.255.255.0 +;DomainServer=10.5.6.90, 11.4.5.6 +#Router is default gateway +;Router=11.5.6.7, 10.0.99.1 +# AddressTime can be different for this range +# specify 0 for infinity.AddressTime +;AddressTime=360 +;Ethernet=no +;NETBIOSNameSrv=192.168.0.201 +# You can also use hex array or byte array with named options +# If you want to send option 43 back to client for +# ranges in this section, specify it as flat option like:- +;43="this is return string" +# or use the byte array in value +;43=123,56,87,123,109,0,23,56,156,209,234,56 +# or use the hex array in value +;43=a6:87:b6:c9:ae:eb:89:09:a4:67:d5 + +[GLOBAL_OPTIONS] +# These are global DHCP Options and would supplement +# client specific options and [RANGE_SET] options. +# Options tags start with 1 and goes up to 254, you can +# always specify option like 1=255.255.255.0, but it may +# be difficult to remember option tags. Try using Option Names +# If no matching name found, you can use tag=value (flat options) +# You can also specify the value as byte array or even hex array. +# Some options having sub-options can only be specified as hex/byte +# array If options have client specific values, move/copy them +# to specific Static Client's section. If any option has DHCP range +# specific value, move/copy them to [RANGE_SET] sections. +# You may quote stings values (must quote if sting contain chars +# like comma, dot or colon) for example NDS_Tree_Name="my.NDS.Tree" +# or 43="this is return string" or use the byte array in value +# like 43=123,56,87,123,109,0,23,56,156,209,234,56 or use the hex +# array in value 43=a6:87:b6:c9:ae:eb:89:09:a4:67:d5 +;DomainName="workgroup.com" +;SubNetMask=255.255.255.0 +;DomainServer=192.168.1.1, 192.168.1.2 +#Router is default gateway +;Router=192.168.1.1 +# AddressTime is default lease time for server +# specify 0 for infinity lease time +;AddressTime=36000 +;RenewalTime=0 +;RebindingTime=0 +# NextServer is PXEBoot TFTP Server +;NextServer=192.168.0.1 +;TimeOffset=3000 +;TimeServer=192.168.0.1 +;NameServer=192.168.0.1 +;LogServer=192.168.0.1 +;QuotesServer=192.168.0.1 +;LPRServer=192.168.0.1 +;ImpressServer=192.168.0.1 +;RLPServer=192.168.0.1 +;BootFileSize=2345 +;SwapServer=192.168.0.1 +;RootPath=/opt/boot/ +;ExtensionFile=bootdir/files +;ForwardOn/Off=yes +;SrcRteOn/Off=yes +;PolicyFilter=192.168.34.1/255.255.255.240 +;DefaultIPTTL=234 +;MTUTimeout=3453 +;MTUPlateau=ac:c0:12:09:02:24:0a:4D:61:63:20:48:44:5F:4E:42:53 +;MTUInterface=23553 +;MTUSubnet=yes +;BroadcastAddress=192.168.0.255 +;MaskDiscovery=yes +;MaskSupplier=yes +;RouterDiscovery=yes +;RouterRequest=192.168.67.1 +;StaticRoute=192.168.11.1/255.255.255.0, 192.168.12.1/255.255.255.0 +;Trailers=yes +;ARPTimeout=3453 +;Ethernet=yes +;DefaultTCPTTL=21 +;KeepaliveTime=120 +;KeepaliveData=yes +;NISDomain=my.nis.domain +;NISServers=192.168.110.1, 192.168.120.1, 192.168.130.1 +;NTPServers=192.168.116.1, 192.168.126.1, 192.168.136.1 +;NETBIOSNameSrv=192.168.5.1 +;NETBIOSDistSrv=192.168.5.1 +;NETBIOSNodeType=8 +;NETBIOSScope=NETBIOS.COM +;XWindowFont=192.168.0.1 +;XWindowManager=192.168.0.1 +;NetwareIPDomain=NETWAREDOMAIN.COM +;NetWareIPOption=123,7,0,45,234,20,27,167,198,34,112,45 +;NISDomainName=NISDOMAINNAME.COM +;NISServerAddr=192.168.0.1 +;TFTPServerName=MyTFTPServer +;BootFileName=BootFileName.ini +;BootFileOption=BootFileOption.ini +;HomeAgentAddrs=192.168.0.1 +;SMTPServer=192.168.0.1 +;POP3Server=192.168.0.1 +;NNTPServer=192.168.0.1 +;WWWServer=192.168.0.1 +;FingerServer=192.168.0.1 +;IRCServer=192.168.0.1 +;StreetTalkServer=192.168.0.1 +;STDAServer=192.168.0.1 +;NDSServers=192.168.0.1 +;NDSTreeName="myNDSTree" +;NDSContext=NewContext +;LDAP="ldap://192.168.1.1" +;AutoConfig=yes +;NameServiceSearch=23,0,235,4,2,0,236,7,94,34,87,4,127,254,23 +;SubnetSelectionOption=255.255.255.240 +# Option TFTPServerIPaddress is for phone use only, for PXEBoot use NextServer option +;TFTPServerIPaddress=192.168.4.1 +;CallServerIPaddress=192.168.0.1 +;DiscriminationString="" +;RemoteStatisticsServerIPAddress=192.168.50.1 +;HTTPProxyPhone=192.168.51.1 +;IPTelephone="MCIPADD=10.10.0.1,MCPORT=1719,TFTPSRVR=10.10.0.254,TFTPDIR=,VLANTEST=0" +# next few are sample flat option, (global mac boot options) +# option mac-version +;230=00:00:00:00 +# option mac-nb-img +;234=ac:11:00:09:02:24:0a:4D:61:63:20:48:44:5F:4E:42:53:00:00:00:0:02:1b:53:68:61:72:65:64:49:6D:61:67:65:73:00:4E:65:74:42:6F:6F:74:20:48:44:2E:69:6D:67 +# option mac-apps-img +;235="\opt\isv\boot\bootimage.bin" + + +# Following sections are Static Client DHCP entries/options +# If no IP is given, then that host will never be allotted any IP +# More option Names can be copied from DHCP-OPTIONS to clients. +# For BOOTP requests, only these options would be sent. +# For DHCP requests. Missing Options will be supplimented from +# first [DHCP-RANGE] options (if IP falls in any range), other +# options will be supplemented from [DHCP-OPTIONS]. + + +[00:41:42:41:42:00] +# This is a client with MAC addr 00:41:42:41:42:00 +IP=192.168.0.200 +# No other options specified for this client +# For non BOOPT requests, Missing Options will be supplemented from first [RANGE_SET] +# options, if IP falls in any range. and other missing would be added from [GLOBAL_OPTIONS]. + +[00:41:42:41:42:05] +# This is a client with MAC addr 00:41:42:41:42:05 +IP=192.168.0.211 +# DHCP will offer following hostname to this client +;HostName=TestHost +# For example, you can specify DNS Servers, Routers separately for this client +;DomainServer=10.5.6.90, 11.4.5.6 +;Router=11.5.6.7, 4.6.7.34 +;NETBIOSNodeType=8 +# AddressTime can be different for this client +# specify 0 for infinity.AddressTime +;AddressTime=36000 + +[00:ff:a4:0e:ef:d5] +# this is an example for MacOsX network boot, client specific options +# for client having MAC addr 00:ff:a4:0e:ef:d5 +IP=10.10.0.12 +# you can omit the comments, these are for guidance only +# Next Server (TFTP Boot Server) and Boot File can be different for this client +;BootFileName=pxelinux.0 +;BootFileSize=255 +;RootPath="/" +;ExtensionFile="/linux/" +;NextServer=192.168.0.1 +# option mac-nc-client-unknown +;220=00:00:00:00 +# option mac-nc-client-id +;221=4D:61:63:20:4E:43:20:23:38 +# option mac-username +;232="bootuser" +# option mac-password +;233="bootpassword" +# option mac-machine-name +;237=myComputer +# option mac-client-nb-img +;238="\opt\isv\boot\image.bin" + +[00:ff:a4:0e:ef:99] +[ff:00:27:78:7b:01] +[ff:00:27:78:7b:02] +[ff:00:27:78:7b:03] +# Above hosts has no IP specified +# Above hosts will never get an +# IP, even from Dynamic Ranges +# You can disable some hosts from +# Getting an IP from this Server. +# using this kind of entries + +