Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have servers connected to multiple Juniper EX4200 based virtual chassis. In order to make them hot swappable without manual reconfiguration, I would like to be able to always give the same IP, with DHCP, to servers connected to a specific switch port.

Or, alternatively, to be able for the server to know which port it has been connected to.

Is any of these setups possible?


share|improve this question
up vote 1 down vote accepted

Cisco switches offer a feature called "DHCP Server Port-Based Address Allocation", which implements DHCP option 82 (aka "DHCP Relay Agent Information"); in the general case, you should just need a switch which supports DHCP Option 82 and a DHCP server which knows what to do with that information. I don't know the specifics of your switch or DHCP server though.

share|improve this answer
Thanks a lot ;) – Pierre Jan 17 '12 at 11:06

That's backwards. DHCP has no knowledge of switch-ports. How is that supposed to work ?

You can give out a fixed ip to a specific mac-address by DHCP (a so-called DHCP reservation) but that requires that whatever swap you make preserves the mac-address.

As I have no knowledge of this Juniper equipment I have no idea if this is possible in your case.

Virtual machines typically have either a static mac-address that moves with the VM to whatever physical hardware which is hosting it. Or they have a dynamically generated mac-address that can change when you move it to different hardware. The static one is what you would need.

share|improve this answer
It's entirely possible with DHCP relay agent information, if the switch supports it. – Andrew Jan 17 '12 at 0:44

The only way I can think of to do this is to put each port in its own VLAN and subnet. Then for that subnet, configure a DHCP pool with only a single IP address.

share|improve this answer
Grin.. I hadn't thought of that one. It would work but (shudder) I would not want to be the one to maintain the documentation for that particular data-center. – Tonny Jan 16 '12 at 22:38
@Tonny - agreed. It's an ugly hack, but should theoretically work. – EEAA Jan 16 '12 at 22:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.