1

Is it possible to configure dhcpd (on a Linux box) to assign a Windows PC 2 separate IP configurations? Right now I've configured the two IP addresses manually and it does exactly what's needed, but I can't figure out how to achieve the same thing with DHCP.

For example, is it possible to set up a virtual interface that piggy-backs onto the first interface and gets its own configuration?

Alternatively, is it possible to run a script upon getting IP values from DHCP that would then be able to configure the secondary IP?

2
  • That's not how DHCP works. Just out of curiousity, why does the PC need 2 separate IP configs? Perhaps we can offer an alternative solution. Jan 10, 2011 at 21:31
  • I'm trying to match the current topology, but yes I'm starting to think this warrants a separate question.
    – IndigoFire
    Jan 11, 2011 at 23:10

3 Answers 3

1

I tried to tackle this a few years ago.. I got halfway there and forgot about the project.

Virtualization software (VMWare, VirtualPC) virtual NICs can pull DHCP through the host's NIC, so it can certainly be done..

I ended up making use of a 'Virtual Loopback Adapter'

Here'e the thread on EE (scroll down) - http://www.google.com/#q=http://www.experts-exchange.com/Networking/Protocols/Transport/TCP-IP/Q_24010688.html

Good luck!

2
  • support.microsoft.com/kb/839013 < link to virtual loopback adapter
    – goofology
    Jan 10, 2011 at 19:06
  • Thanks for this. I've tried installing the loopback and bridging it, but Windows then treats it as one adapter. If it could be used as an ethernet bridge with two separate IP layers, that would be ideal. Seems to me like this is pretty close to impossible with the basic Windows tools.
    – IndigoFire
    Jan 13, 2011 at 16:41
0

When you make a virtual network device (which you're doing on your windows PC), you should set its MAC address to be different from the physical network card. If they both make DHCP requests, they should be treated as two different machines, and each be given separate IP addresses. If you set up your DHCP server (on your linux machine) to reserve IP addresses to either of them, or both of them, then you can specify what addresses each interface will receive.

In general, DHCP servers aren't aware of the physical layer, but the DHCP request made includes the mac address of the requesting interface. Because this is a field in the packet which is volunteered by the DHCP protocol, rather than being automatically attached by the physical network device, you should be able to get this working simply by creating a virtual network device, and setting its MAC address (sometimes referred to as MAC address spoofing).

0

I've also stumbled across a method to assign multiple static IPs and keep the DHCP functionality on a single interface - http://archive.news.softpedia.com/news/Both-DHCP-and-Static-IP-addresss-at-the-same-time-47494.shtml

not exactly what you are looking for, but might help.

Copypasta from linked website as suggested by comment:

Setting the connection to obtain the DHCP provided IP

To setup the connection in order to automatically obtain the IP address from the DHCP, you need to right click on the Local Area Connection and to select Properties. Under the General tab go to Internet protocol (TCP/IP) and select properties.

The options "Obtain IP address automatically" and "Obtain DNS server addresses automatically" must be selected. Under the next tab, "Alternate Configuration", "Automatic private IP address" must be also selected. With these settings you ensure that your computer obtains the IP address from the DHCP server.

Review imageReview imageReview imageAdding more static IP addresses Next step consists in the operation of adding another static IP addresses (not provided by the DHCP server). Because from Windows there is no option to offer you the freedom to add more IP addresses that can be used in the same time, we need to do a little trick editing the registry.

Open the registry editor (Go to Start > Run and type Regedit) and look for the following path:

HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Services>Tcpip>Parameters>Interfaces

Here you will find a key look like this: {BDF058FE-237C-402A-ABAB-8DEB342026BC}. It is the one that represents the NIC card. You need to look for the one representing your own network card.

Once you found it, select it and in the right panel, look for IPAddress key. Double click on it and you will get the Edit Multi-String window with a value of 0.0.0.0. Under this value, just add your static IP. You can add one, two or more IP addresses according to your needs.

In the same right panel, look for the SubnetMask key. This key needs to be edited in the same way we did with the key above.

Now close the Registry editor and disable the network connection by right clicking on the tray icon. Re-enable the connection again and you are done.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .