12-07-2017 08:22 AM - edited 03-08-2019 01:02 PM
Hi folks, hope someone can help.
I currently have a Linux DHCP server sitting in a VLAN behind the NXS. All hosts in this VLAN get IP from the Linux server. I want to configure a second DHCP server on a diffferent VLAN and intend to use dhcp relay feature to accomplish this. As with IOS, I was expecting the local server to respond to the DHCP requests first but on NX-IOS, it appears, the dhcp discover messages are not sent to local DHCP and instead I am getting IPs only from the remote DHCP server.
config I used was - ip dchp relay address x.x.x.x
Is there a way of chosing local as primary and remote as secondary?
Many thanks in advance,
GK
Solved! Go to Solution.
12-07-2017 09:13 AM
Hi,
Since DHCP relies on the broadcast for the initial DHCP discover prosses, either the DHCP server or the DHCP relay agent must be on the same network. In your case the Linux server is local and should be the primary and provide the IP. I know this does not make sense, but For testing purposes, can you configure both DHCP IPs with local Linux as the first one and the remote device as the second one?
ip dchp relay address x.x.x.x (local Linux)
ip dchp relay address x.x.x.x (remote Linux)
HTH
12-07-2017 09:53 AM
Let me know if I am wrong:
Your users and the primary DHCP server are in the same VLAN (let's say VLAN 10) and you have a second DHCP server in a new VLAN (VLAN 20.) SVI 10 was configured with the command 'ip dhcp relay address 20.20.20.1' but now, all clients are getting their IPs from the second DHCP server.
Well, that behavior is expected since all DHCP requests are being forwarded to the server configured in the ip dhcp relay command.
You can try adding the first DHCP server: 'ip dhcp relay address 10.10.10.1' before the second one, or you can move the primary DHCP server to a different VLAN (VLAN 30) and to run the same command but with the new IP.
12-07-2017 09:13 AM
Hi,
Since DHCP relies on the broadcast for the initial DHCP discover prosses, either the DHCP server or the DHCP relay agent must be on the same network. In your case the Linux server is local and should be the primary and provide the IP. I know this does not make sense, but For testing purposes, can you configure both DHCP IPs with local Linux as the first one and the remote device as the second one?
ip dchp relay address x.x.x.x (local Linux)
ip dchp relay address x.x.x.x (remote Linux)
HTH
12-08-2017 03:29 AM
Thanks both, will try adding both as DHCP relay and see how it goes.
12-13-2017 12:12 PM
Glad to help and good Luck!
12-13-2017 07:10 AM
12-07-2017 09:53 AM
Let me know if I am wrong:
Your users and the primary DHCP server are in the same VLAN (let's say VLAN 10) and you have a second DHCP server in a new VLAN (VLAN 20.) SVI 10 was configured with the command 'ip dhcp relay address 20.20.20.1' but now, all clients are getting their IPs from the second DHCP server.
Well, that behavior is expected since all DHCP requests are being forwarded to the server configured in the ip dhcp relay command.
You can try adding the first DHCP server: 'ip dhcp relay address 10.10.10.1' before the second one, or you can move the primary DHCP server to a different VLAN (VLAN 30) and to run the same command but with the new IP.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide