jagornet / dhcp Goto Github PK
View Code? Open in Web Editor NEWJagornet DHCP Server - An open source DHCPv4/DHCPv6 Server for Java
Home Page: https://www.jagornet.com
License: GNU General Public License v3.0
Jagornet DHCP Server - An open source DHCPv4/DHCPv6 Server for Java
Home Page: https://www.jagornet.com
License: GNU General Public License v3.0
Although the indentation in findBindingPool(InetAddress)
of BaseBindingManager
suggests otherwise, the return
statement is not part of the if
block. This results in the first binding pool of the first list of binding pools to be always returned.
Adding braces to the if
statement around the logging and return
statements will resolve this.
The logic for reconciling the lease database against the configured pools at server startup is broken. It is performed on a per manager basis, which would obliterate leases managed by other managers. Note the TODO comment in V6AddrBindingManager.buildBindingPools.
When we configure v4 and/or v6 options (using subOptions or vxOtherOptions) for anything other than 'string' the DHCP server throws an exception (null pointer) when trying to service a request that asks for that option. No matter which type we use (ipAddress, opaqueDataOption, opaqueDataOptionList). If we set to string, it works without issue, for any of the others it throws what looks like the same exception. We have tried with the examples from the documentation (copy/paste) and see the same behavior.
This is reproducible every time.
Here is an example of the xml file, with the exception below:
(this works)
(this doesn't-we tried short & long notation for the IP, also same problem with V4, and with all the different data types-ip, opaque, ip list, opaque list, etc)
Remote IPv6 Client Link (Unicast/Multicast traffic) fd78::0000/64 fd00::71 [sdsdev.com](http://sdsdev.com/). fd78:0000:0000:0000:0000:0000:0000:0071From the server log:
2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG netty.DhcpV6PacketDecoder - Received datagram packet: localChannel=fd00:0:0:0:0:0:0:71:547 remoteSender=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] INFO netty.DhcpV6UnicastChannelDecoder - Decoding unicast message: local=fd00:0:0:0:0:0:0:71:547 remote=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=72 localAddr=fd00:0:0:0:0:0:0:71:547 remoteAddr=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=12
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - Decoding DhcpRelayMessage from: /fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Relay-Forward
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - HopCount=0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - LinkAddress: /fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - PeerAddress: /fe80:0:0:0:72b3:d5ff:feeb:2a84
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=9
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=34 localAddr=fd78:0:0:0:0:0:0:0:547 remoteAddr=fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=11
2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] INFO request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding DhcpMessage from: fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Info-Request
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - TransactionId=9297445
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=1
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=8
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=6
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - DhcpMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - DhcpRelayMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] INFO netty.DhcpV6UnicastChannelDecoder - Unicast message decoded: msg=
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,013 [nioEventLoopGroup-5-1] WARN channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException: null
at com.jagornet.dhcp.core.message.DhcpV6Message.toStringWithOptions(DhcpV6Message.java:666) ~[jagornet-dhcp-core-4.0.0.jar:?]
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:207) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleRelayForward(DhcpV6MessageHandler.java:131) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:81) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:85) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:55) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.UnorderedThreadPoolEventExecutor$NonNotifyRunnable.run(UnorderedThreadPoolEventExecutor.java:277) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_351]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_351]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_351]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_351]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_351]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_351]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]
The state of the link must be checked before allocating a lease from available pools.
I have many network interfaces on a server machine, and I want to be able to configure Jagornet to act as a DHCP server for a network that is attached to just one of those interfaces. Currently if a single IP address is provided to the --v4ucast
parameter, Jagornet does not start successfully.
It looks like it is due to the following code, that parses the options. The case of specifying just one IPv4 unicast address results in a null value for v4UcastAddrs
.
The default log4j2 configuration will create a "${jagornet.dhcp.home}" directory if it the system property is not defined.
Also, the default file appender has seemingly backwards index naming convention.
DHCP Client test tools should allow configuration of the number of requests sent per second.
The bin/dhcpserver testclientv4|testclientv6 run options throw a file not found error when loading the Log4j2 configuration file.
DHCPv4 packets that are received by the server via a relay agent are not handled correctly.
The version, list-interfaces, and test-configfile options of the bin/dhcpserver script throw Java exceptions when trying to start Log4J, but otherwise work. For example, the output from running 'bin/dhcpserver version':
bin/dhcpserver version
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /log/dhcpserver.log (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:221)
at java.io.FileOutputStream.(FileOutputStream.java:142)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:547)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:483)
at org.apache.log4j.LogManager.(LogManager.java:127)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:253)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at com.jagornet.dhcp.server.JagornetDhcpServer.(JagornetDhcpServer.java:87)
Jagornet DHCP Server Community Edition 2.0.0
Copyright Jagornet Technologies, LLC 2009-2014. All Rights Reserved.
v2.0.3 builds include incompatible jar files, resulting in failed server startup.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method getLinkList() is undefined for the type LinksType
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.initLinkMap(DhcpServerConfiguration.java:222)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.<init>(DhcpServerConfiguration.java:169)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.getInstance(DhcpServerConfiguration.java:142)
at com.jagornet.dhcp.server.JagornetDhcpServer.start(JagornetDhcpServer.java:184)
at com.jagornet.dhcp.server.JagornetDhcpServer.main(JagornetDhcpServer.java:944)
2016-06-17 23:58:58,907 [Thread-0] INFO com.jagornet.dhcp.server.JagornetDhcpServer - Stopping Jagornet DHCPv6 Server
Stopping Jagornet DHCPv6 Server: Fri Jun 17 23:58:58 EDT 2016
The DHCP client test tools should include a unique hostname for generated requests.
DHCPv6 client request received on local multicast IPv6 channel:
2016-06-19 23:34:16,458 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Decoding packet: size=52 localAddr=fe80:0:0:0:1311:11ff:fe11:1111%eth5:547 remoteAddr=fe80:0:0:0:2022:22ff:fe22:2222%17:546
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Message type byte=1
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Decoding DhcpMessage from: fe80:0:0:0:2022:22ff:fe22:2222%17:546
2016-06-19 23:34:16,461 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - MessageType=Solicit
2016-06-19 23:34:16,465 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - TransactionId=2636585
2016-06-19 23:34:16,465 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=1
2016-06-19 23:34:16,469 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6ClientIdOption reports length=14: bytes remaining in buffer=44
2016-06-19 23:34:16,481 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=6
2016-06-19 23:34:16,485 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6OptionRequestOption reports length=4: bytes remaining in buffer=26
2016-06-19 23:34:16,485 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=8
2016-06-19 23:34:16,489 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG base.BaseDhcpOption - DhcpV6ElapsedTimeOption reports length=2: bytes remaining in buffer=18
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - Option code=3
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG v6.DhcpV6IaNaOption - IA_NA option reports length=12: bytes remaining in buffer=12
2016-06-19 23:34:16,493 [Old I/O datagram worker ([id: 0x3f270e0a, 0.0.0.0/0.0.0.0:547])] DEBUG message.DhcpV6Message - DhcpMessage decoded.
2016-06-19 23:34:16,500 [pool-3-thread-2] DEBUG netty.DhcpV6ChannelHandler - Received:
Solicit (xactId=2636585) from fe80:0:0:0:2022:22ff:fe22:2222%17:546
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=000100011ef95580222222222222
DhcpV6OptionRequestOption: unsignedShortList=23,24
DhcpV6ElapsedTimeOption: unsignedShort=0
IA_NA_OPTIONS
DhcpV6IaNaOption: iaId=572662306 t1=5400 t2=0
2016-06-19 23:34:16,504 [pool-3-thread-2] INFO request.DhcpV6MessageHandler - Handling client request on local client link address: 0.0.0.0
2016-06-19 23:34:16,530 [pool-3-thread-2] WARN channel.SimpleChannelHandler - EXCEPTION, please implement com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.exceptionCaught() for proper handling.
java.lang.ClassCastException: java.net.Inet4Address cannot be cast to java.net.Inet6Address
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.preProcess(BaseDhcpV6Processor.java:469)
at com.jagornet.dhcp.server.request.DhcpV6SolicitProcessor.preProcess(DhcpV6SolicitProcessor.java:87)
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:412)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:90)
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.messageReceived(DhcpV6ChannelHandler.java:73)
at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have many network interfaces on a server machine, and I want to be able to configure Jagornet to act as a DHCP server for a network that is attached to just one of those interfaces. I have configured Jagornet with the --v4bcast
parameter to listen on just one network interface. There is already another process using port 67 for another network interface on the server.
The following code shows that Jagornet actually checks that the broadcast port is available on all network interfaces on the host machine, when should it actually just need to check that the port is available on the network interfaces configured for broadcast?
It looks like this could be a simple code change to use a different constructor for DatagramSocket that accepts the IP address as well as the port...
https://docs.oracle.com/javase/7/docs/api/java/net/DatagramSocket.html
GitHub dependabot alert flagged the log4j:log4j dependency for Log4j 1.2, because it is vulnerable to CVE-2019-17571.
.
v2.0.3 release did included docs/userguide.docbook.html instead of docs/userguide.html
I need to response suboption in v4VendorSpecificOption to client.
my config xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">
<v4ServerIdOption>
<ipAddress>10.17.0.14</ipAddress>
</v4ServerIdOption>
<v6ServerIdOption>
<opaqueData>
<hexValue>000100016038A683D60582BAF453</hexValue>
</opaqueData>
</v6ServerIdOption>
<policies>
<policy>
<name>dhcp.ignoreLinkLocal</name>
<value>false</value>
<name>dhcp.ignoreSelfPackets</name>
<value>false</value>
</policy>
</policies>
<links>
<link>
<name>IPv4 Client Link 1</name>
<address>10.17.0.0/24</address>
<policies>
<policy>
<name>v4.defaultLeasetime</name>
<value>0</value>
</policy>
</policies>
<v4ConfigOptions>
<v4SubnetMaskOption>
<ipAddress>255.255.255.0</ipAddress>
</v4SubnetMaskOption>
<v4RoutersOption>
<ipAddress>10.17.0.1</ipAddress>
</v4RoutersOption>
<v4VendorSpecificOption>
<opaqueData>
<subOptions>
<optionDef v4="true" code="1" name="VendorSubopt1">
<stringOption>
<string>VendorSpecial</string>
</stringOption>
</optionDef>
</subOptions>
</opaqueData>
</v4VendorSpecificOption>
</v4ConfigOptions>
<v4AddrPools>
<pool>
<range>10.17.0.200-10.17.0.220</range>
</pool>
</v4AddrPools>
</link>
</links>
</ns2:dhcpServerConfig>
when sever get a request ,log is:
[epollEventLoopGroup-9-1] WARN channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException: null
at com.jagornet.dhcp.core.option.base.BaseOpaqueData.getLength(BaseOpaqueData.java:65) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseOpaqueDataOption.getLength(BaseOpaqueDataOption.java:69) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseDhcpOption.encodeCodeAndLength(BaseDhcpOption.java:66) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.core.option.base.BaseOpaqueDataOption.encode(BaseOpaqueDataOption.java:75) ~[jagornet-dhcp-core-3.0.3.jar:?]
at com.jagornet.dhcp.server.db.DhcpOption.fromConfigDhcpOption(DhcpOption.java:170) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.convertDhcpOptions(BaseBindingManager.java:1000) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.createBinding(BaseBindingManager.java:399) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.binding.V4AddrBindingManagerImpl.createDiscoverBinding(V4AddrBindingManagerImpl.java:270) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.DhcpV4DiscoverProcessor.process(DhcpV4DiscoverProcessor.java:112) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.BaseDhcpV4Processor.processMessage(BaseDhcpV4Processor.java:221) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.request.DhcpV4MessageHandler.handleMessage(DhcpV4MessageHandler.java:90) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.netty.DhcpV4ChannelHandler.channelRead0(DhcpV4ChannelHandler.java:77) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at com.jagornet.dhcp.server.netty.DhcpV4ChannelHandler.channelRead0(DhcpV4ChannelHandler.java:52) ~[jagornet-dhcp-server-3.0.3.jar:3.0.3]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
If the server is started without specifying the -c configFile argument, it fails to find the default file located in $JAGORNET_DHCP_HOME/config/dhcpserver.xml.
I need IPv6 support with SLAAC enabled, but can't find any config about it. Does this software support?
I'd like to update static DHCPv4 address bindings dynamically.
However, there is not update command and rest api.
Is it possible?
In addition to the legacy XML configuration file format and schema validation, add support for JSON and YAML configuration files using the same schema.
The Subnet.getEndAddress() method needlessly recalculates the endAddress each time it is called.
Update log messages for DHCP options that are not natively defined to include DHCP version and option code.
Add the ability to get and set the DHCP server configuration via the REST API.
The DHCPv6 test client does not check the status code returned by the server. The DHCPv6 server puts the status code option at the message-level, but probably should be at the IA level.
Java profiling indicates that BeanUtils.copyProperties is expensive.
The DHCPv4 client test tool reports an error exit status (1) if the -x/--release option is not specified on the command line.
The DHCP server's default log4j2.xml file should not log to the console.
The server fails to load an existing IA_PD binding from the database with a ClassCastException:
2015-09-04 23:22:40,623 [pool-2-thread-3] INFO request.DhcpV6SolicitProcessor - Processing IA_PD Solicit:
DhcpV6IaPdOption: iaId=221572909 t1=0 t2=0
IA_PREFIXES
DhcpV6IaPrefixOption: ipAddress=0:0:0:0:0:0:0:0 prefixLength=56 preferredLifetime=0 validLifetime=0
2015-09-04 23:22:40,742 [pool-2-thread-3] INFO binding.BaseBindingManager - Found current binding for IA: duid=0003000114d64d34ef2d iatype=3(PD) iaid=221572909 state=3
2015-09-04 23:22:40,747 [pool-2-thread-3] ERROR binding.BaseBindingManager - Failed to find current binding
java.lang.ClassCastException: com.jagornet.dhcp.db.IaAddress cannot be cast to com.jagornet.dhcp.db.IaPrefix
at com.jagornet.dhcp.server.request.binding.V6PrefixBindingManagerImpl.buildBindingFromIa(V6PrefixBindingManagerImpl.java:446)
at com.jagornet.dhcp.server.request.binding.BaseBindingManager.findCurrentBinding(BaseBindingManager.java:301)
at com.jagornet.dhcp.server.request.binding.V6PrefixBindingManagerImpl.findCurrentBinding(V6PrefixBindingManagerImpl.java:264)
at com.jagornet.dhcp.server.request.DhcpV6SolicitProcessor.process(DhcpV6SolicitProcessor.java:222)
at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:435)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleRelayForward(DhcpV6MessageHandler.java:131)
at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:81)
at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.messageReceived(DhcpV6ChannelHandler.java:73)
at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:95)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:777)
at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)
at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
The DHCPv4 server uses only the chAddr field of the header to identify clients
The DHCPv4 message encode() method allocates several byte[] arrays when a simple constant would suffice.
Identity Assoc (IA) level options are not deleted from the lease database when the lease is declined or released by the client.
Jagornet DHCP Server support add dhcp address pool with API?
DHCP Server distribution package does not include client test tools jar.
The 'bin/dhcpserver gentestconfig' option fails when saving the output file. The exception is as follows:
2020-11-01 19:12:27,638 [main] INFO com.jagornet.dhcp.server.config.DhcpServerConfiguration - Saving server configuration file: dhcpserver-test-config.xml
java.io.FileNotFoundException: class path resource [dhcpserver-test-config.xml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195)
at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:150)
at com.jagornet.dhcp.server.config.DhcpServerConfiguration.saveConfig(DhcpServerConfiguration.java:979)
at com.jagornet.dhcp.server.config.GenerateTestConfig.generate(GenerateTestConfig.java:270)
at com.jagornet.dhcp.server.config.GenerateTestConfig.main(GenerateTestConfig.java:288)
The DHCPv6 TAHI test suite for DHCPv6 Ready certification required that the status option be at the message level. Other clients and test tools require it at the IA level.
The DHCP client test tools should allow configuration of the number of threads used.
Current JSON implementations include Gson, custom generator/parser, and partial Jackson. Aim to make all JSON processing consistent utilizing Jackson JSON APIs.
Create Docker/OCI images for Jagornet DHCP Server
There are two loops in BaseOpaqueDataListOption
that use j
as the loop variable, but both of theses loops increment i
. See lines 196 and 246.
The DHCP client test tools should default to wait forever if the -t/--timeout option is not specified.
If in vlan ,the server can't allocate ip addr.Because the server drop the package that source ip is 0.0.0.0
In the User Guide documentation, the server policies for configuring the database schema type and version are incorrectly named as 'dhcp.database.schemaType' and 'dhcp.database.schemaVersion', respectively. However, the correct names are 'database.schemaType' and 'database.schemaVersion'.
The conversion between the com.jagornet.dhcp.core.option.base.DhcpOption and the com.jagornet.dhcp.server.db.DhcpOption classes should be isolated to the persistence layer to minimize data copy operations.
Consider options for improving request/reply processsing via Netty, including any performance profiling and tweaking.
Do you have a roadmap feature list that your planning to implement?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.