IP address of DHCP Server

I know this is a stupid question, but I'll ask anyway.

Must a DHCP server have a static IP address or is it possible for it to ask itself for an IP address?
 
A DHCP server broadcasts to the entire network. It usually has the ip of the gateway like a modem or router but it can be something else. The ip isn't relevant to make a DHCP request work. The server only has to be visible over wire,
 
I was wondering if there was some way to start the DHCP sever before running ifconfig_em0="dhcp".....

probably not.... just asking...
 
I was wondering if there was some way to start the DHCP sever before running ifconfig_em0="dhcp".....

probably not.... just asking...
I think you need to have at least 1 network interface up, and the (local) DHCP client must assume this is the network to expect a DHCP server on.
Not sure, though. I kind of never tried this situation. Even a softrouter has its ip and gateway configured before starting a DHCP server to act upon this link.
 
I know this is a stupid question, but I'll ask anyway.

Must a DHCP server have a static IP address or is it possible for it to ask itself for an IP address?

DHCP is a Layer 2 service thus below IP, runs on a raw network interface, and actually doesn't need any IP address assigned to that interface at all to operate.

Yes it is possible. Understand that it is the MAC address that is king in the broadcast domain of LAN, not IP. Two or more machines can be DHCP servers at the same time, provided they're meticously configured to not interfere with eachother.
 
with enough effort, i guess you could, but why? configure your DHCP server with a static IP. If you want to use hardware blocks to pin the rest of your network, that's cool, we do that for a few things, but we wouldn't go out of our way to make the DHCP server come up before IP because it's easier to just configure it statically.
 
DHCP is a Layer 2 service thus below IP, runs on a raw network interface, and actually doesn't need any IP address assigned to that interface at all to operate.

Yes it is possible. Understand that it is the MAC address that is king in the broadcast domain of LAN, not IP. Two or more machines can be DHCP servers at the same time, provided they're meticously configured to not interfere with eachother.
Just curious. What kind of signal does dhclient send to what if there's no TCP/IP network at all? Does 1 device with a MAC-address somehow get priority to send hardware-layer signals with?
If you create a bridge or tap device and give it an ip, shouldn't a DHCP request be sent to a black hole because it assumes this is where to get a lease since it's the only networking device seen?
 
DHCP conversation is started by a client. Inital packet is broadcast, basically raw IP (UDP) sent to 255.255.255.255 usually port 67. A DHCP server is listening on that port and sends back a reply.
So in theory if you have a listener on port 67 attached to an interface, then it should work.

But you would need to figure out how to write the server side to listen on a raw interface and send back a response on that same interface.

Wikipedia actually has a pretty good article on DHCP, includes packet formats
 
mer the dhcpd's interface binding is from rc.conf, as the daemon opens the raw socket. I don't think it is necessary to have IP on this interface, and dhcpd will not perform any sort of checks to see whether its subnet definition matches the IP/network on the interface.

Of course it is easier. but is it possible to do what I want. I have my reasons.

I found with FreeBSD and networking, anything is possible.
If you give me the exact details of your setup, I can give you the recommendation.
 
Just curious. What kind of signal does dhclient send to what if there's no TCP/IP network at all? Does 1 device with a MAC-address somehow get priority to send hardware-layer signals with?
If you create a bridge or tap device and give it an ip, shouldn't a DHCP request be sent to a black hole because it assumes this is where to get a lease since it's the only networking device seen?

Just to add to mer's description, the UDP does not require a TCP/IP state machine, so the port can be actually unconfigured as it is prior to DHCP client's task.

The dhclient will fail if it cannot open a raw packet connection.

I have trouble understanding the rest of your questions. I can only answer generally - there are no hardware layer signals, everything is done in software. If you refer to Layer 2, the drivers actually read the MAC from the card and set up the interface, but the "stack" is the one generating the packets, and therefore you can use any MAC entry. It is the network stacks ARP table that holds bindings between IPs and MACs.
 
Just to add to mer's description, the UDP does not require a TCP/IP state machine, so the port can be actually unconfigured as it is prior to DHCP client's task.

The dhclient will fail if it cannot open a raw packet connection.

I have trouble understanding the rest of your questions. I can only answer generally - there are no hardware layer signals, everything is done in software. If you refer to Layer 2, the drivers actually read the MAC from the card and set up the interface, but the "stack" is the one generating the packets, and therefore you can use any MAC entry. It is the network stacks ARP table that holds bindings between IPs and MACs.
Dhclient sends a request on UDP to everything that's connected on ARP/MAC level? So, the system networking stack spreads a DHCP request to everything that's known as networking device, as I understand, (I'm only slightly aware of the 90's TCP layers doctrine)
 
Back
Top