Problem with dhcp when there is a power failure
Home › Forums › Conduit: mLinux Model › Problem with dhcp when there is a power failure
Tagged: Conduit mLinux dhcp
- This topic has 5 replies, 3 voices, and was last updated 7 years, 6 months ago by piyush s.
-
AuthorPosts
-
March 29, 2017 at 3:38 am #18023mikel de pradoParticipant
Hello Multitech Team,
we have our Conduit: mLinux (Fw version 3.2.0) with a Lora mdot in our office, connected to a switch and it receives his Ip Address from our DHCP server.
Lately, we had some power failures and when the power returns we are unable to connect to it by ssh, and our Lora devices are unable to make a Join to the application server(The things Network).
Each time we had a power failure, we had to go to where the conduit is and unplug it and plug it again.We think that each time there is a power failure the conduit restarts faster than our switch, and because of that he is unable to get a IP address through dhcp. We think that when the dhcp fails to get the IP it assign itself some default address and because of it we are unable to connect to it.
Is there a way to solve this issue by modifying the configuration or some other way.
March 29, 2017 at 9:03 am #18028Jeff HatchKeymasterMikel,
Are you using udhcpc or a different DHCP client program?
Jeff
March 30, 2017 at 1:07 am #18067mikel de pradoParticipantI think we are using the udhcpc client, is the only dhcp client on the conduit.
March 30, 2017 at 7:50 am #18071Jeff HatchKeymasterMikel,
Just need to make sure. We have customers that port other software onto the Conduit.
As for using udhcpc, what arguments are being specified when it is getting executed? Are you using a script file? In the past I have used the -qn arguments: udhcpc -i eth0 -qn
With this it will try a few times and quit with an exit status of either 0 (success) or 1 (failure) to get a lease. I then check the exit status and if it didn’t succeed I re-run it after sleeping for a designated amount of time. Doing that in a loop, you can control how often and how long you retry.
The contents of the udhcpc.conf are:
start 192.168.2.100 end 192.168.2.254 interface eth0 option subnet 255.255.255.0 option router 192.168.2.1 option dns 8.8.8.8 # google's DNS server
In this simple case I don’t have udhcpc executing a script (–script argument).
Hopefully that will help,
Jeff
March 31, 2017 at 1:45 am #18095mikel de pradoParticipantJeff,
We first configured the interface to use dhcp, for that we modified the file /etc/network/interfaces, like this:
auto eth0
iface eth0 inet dhcpWe are not using any aditional script, i suppose udhcpc is using it's default script. Using ps -ef, i got that the udhcpc was started with these parameters:
udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
The contents of the udhcpd.conf are:
start 192.168.2.100
end 192.168.2.254
interface eth0
option subnet 255.255.255.0
option router 192.168.2.1
option dns 8.8.8.8 # google's DNS serverAnd the udhcpc default script file:
#!/bin/sh
exec run-parts -a “$1” /etc/udhcpc.d
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
- This reply was modified 7 years, 8 months ago by mikel de prado.
May 23, 2017 at 7:36 am #19269piyush sParticipantHi Mikel,
Were you able to get your problem resolved? Did you modify the dhcp client (or its argument) to solve that or some other way?
thanks,
–Piyush -
AuthorPosts
- You must be logged in to reply to this topic.