All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Trying to remember how bootp and dhcp work to assign addresses.
So I am aware I have bootp setup to route dhcp broadcast packets from my different vlans to a central dhcp server. On that central dhcp server I have the following in /var/log/messages
Aug 2 21:38:12 main dhcpd: DHCPDISCOVER from 00:25:90:a1:ef:4c via 10.0.22.1
Aug 2 21:38:13 main dhcpd: DHCPOFFER on 10.0.22.3 to 00:25:90:a1:ef:4c via 10.0.22.1
Aug 2 21:38:13 main dhcpd: DHCPDISCOVER from 00:25:90:a1:ef:4c via 10.0.22.1
Aug 2 21:38:13 main dhcpd: DHCPOFFER on 10.0.22.3 to 00:25:90:a1:ef:4c via 10.0.22.1
Aug 2 21:38:15 main dhcpd: DHCPREQUEST for 10.0.22.3 (10.0.0.2) from 00:25:90:a1:ef:4c via 10.0.22.1
Aug 2 21:38:15 main dhcpd: DHCPACK on 10.0.22.3 to 00:25:90:a1:ef:4c via 10.0.22.1
How in the world does the request come from the gateway 10.0.22.1 of an assigned range on the interface? I know I'm matching to see what network the request comes from on my DHCP server to tell what address I am going to give. EX:
subnet 10.0.22.0 netmask 255.255.255.0{
option subnet-mask 255.255.255.0;
option routers 10.0.22.1;
range dynamic-bootp 10.0.22.2 10.0.22.254;
}
I could have multiple ip ranges assigned to an interface on my router, so how does it get decided what gateway these requests come from? Does it just come from the 'first' assigned ip range?
Comments
It's the address of the device running the DHCP helper, although I'm not actually sure what would happen if the interface on the device had multiple subnets present.
I suspect it may also vary depending on the implementation.
Working example. We are using in our Proxmox Servers.
We are using to assign IP statically to a MAC address.
You can use range:
I could have multiple ip ranges assigned to an interface on my router, so how does it get decided what gateway these requests come from? Does it just come from the 'first' assigned ip range?
The bootp/dhcp request is being processed by the relay agent on your router before it reaches your DHCP server. If you configure the relay agent on your router, it will listen for the BOOTP/DHCP host UDP broadcast requests on its interfaces. The agent will examine certain fields such as hop count and in particular the 'giaddr' field. If 'giaddr' is blank - that denotes that it is the first hop. The relay agent will fill the blank 'giaddr' out with the IP address with the IP address of the interface on which the BOOT/DHCP request was received on before the agent relays the request. That way if there are multiple hops before the BOOTP/DHCP server is reached, the 'giaddr' will contain the correct IP to return the response.
When your DHCP server processes the request, the 'giaddr' field will examined so that the correct DHCP scope is used. Similarly, the 'giaddr' field is used by the relay agent to determine which interface to relay the BOOTREPLY or DHCPOFFER message which is generated by you DHCP server.
@hostfav your response was completely irrelevant. I have a working setup. Was just wondering how the bootp relay was doing it's magic.
@birchbeer Thank you for your explanation. It looks like from your response yes my router does use the first ip range assigned to the interface to send the traffic over to the bootp relay for the giaddr field.
@dragon2611 thank you for your response, but I'm doing intervlan routing with a bootp relay for all interfaces.
That should be fine, my question was more about what would happen if the device running the relay had multiple IP addresses on the same Vlan interface, as some devices do support that.
I am guessing you are asking about multiple IP address on a layer3 switch interface, you are basically making that a trunk. When a bootp request is generated by the client, the relay agent on the same VLAN as the client would fill out the giaddr before forwarding it. If that request is sent through a switch trunk, the relay agent on the switch would ignore the non-zero giaddr field and simply forward the bootp request on the other interfaces.
But if you are asking about the unusual use-case where the client is on a VLAN with multiple subnets, I actually don't know what would happen. I skimmed through the RFC and I didn't see a specification for that use-case but I may have missed it.
Yes this is the interesting one.
Yeah I'm doing the 'unusual use-case' and it looks like it's using the first assigned subnet.
It's theoretically possible for a client to use a "preferred IP" when doing a bootp request but I think that's typically used for IP renewals.
I was imagining that there is possibly even a scenario where a relay agent could rebroadcast multiple requests with the giaddr for each interface. And in that case, the client could just pick a preferred request or whatever the first one that arrives - the RFC says it's up to the client - which sounds pretty random to me.
In some switches like Cisco - if there are multiple gateways, I think that those gateways are considered secondary interfaces so I bet their relay agent would always use the primary gateway.
Interesting use-case though.
Yeah there aren't multiple nics on these machines so I had to make it all work with a single nic