LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Configuring a DHCP server (https://www.linuxquestions.org/questions/linux-networking-3/configuring-a-dhcp-server-4175581433/)

slepax 06-04-2016 11:00 AM

Configuring a DHCP server
 
Hello all,

I have a catch 22 situation, which I am not sure how to solve.

I would like the machine running the DHCP server to have a static ip, but I would rather not specify the ip in eth0 but rather have it set by the DHCP server.
  • The DHCP server requires eth0 to be running
  • but when eth0 loads up and as the DHCP server is not running yet then eth0 doesn't have an IP and therefore no subnet
  • then when the DHCP server starts, it complains that the subnet on eth0 does not match the current subnet in dhcpd.conf.

It's like an endless loop, is there any solution to this?

Thanks!

jayjwa 06-04-2016 03:26 PM

I'm wondering what your network looks like; usually you'd use dhcpd to serve your intranet. For example, if eth0 goes out to your internet connection then you'd set something like 'dhcpd -cf /etc/dhcpd.conf wlan0' to serve your wireless intranet. Your dhcpd.conf should reflect that. Why don't you want to set your first internal address statically? What is eth0 connecting to: a cable modem, or a router? Does it/can it assign an address? We may be able to answer better if we knew more what the network looks like and how it's set up.

slepax 06-05-2016 09:26 AM

Sorry you are right, I should explain the configuration with a bit more detail.

I have a small Banana Pi box running Bananian. It is basically a nas box running a few services like OpenMediaVault, transmission, samba, etc. So it needs to have network and internet connectivity. Because it is running 24x7 I thought a dhcp server would be nice merely because the one I have on my router is not very stable.

If I configure a static IP on eth0, I would also have to configure the router ip address and dns servers, and then repeat the same configuration in the dhcp server config file. For that reason I was hopping leaving eth0 to obtain it's [fixed] ip and other information dynamically from the dhcp server (which is located on the same machine).

Being that my dhcp server is for a small home network, is there an option for excluding the subnet configuration? There is only one subnet and only one ip range anyway.


All times are GMT -5. The time now is 11:53 PM.