6

I was wondering if it is possible, e.g. to assign/reserve one static IP to a computer when it's running windows and assign a second static IP to the same computer/MAC address when it's running Linux?

I have seen this behavior for my computer under university network. That is, the same NIC is assigned one stable IP for windows, and a different one for Linux. I don't know if it is just dynamic IP being remembered for a real long time. But the university network is able to give me two specific IP's depending on the OS that is running.

My questions are,

  1. What kind of network administration technology is used to differentiate OSes and assign IP's based on OS brands?

  2. Can I (and how to) do the same on my own network using a router running dd-wrt?

Thanks in advance.

Note: I asked this question at ServerFault, but was told that it is off-topic there.

tinlyx
  • 1,580

3 Answers3

6

You can configure both the OSes to ask for static IPs instead of the router assigning static IP addresses based on their MAC addresses. This can be achieved by configuring the respective operating systems' network settings, and have both of them ask for different static IPs.

In Windows, these settings can be found in Network and Sharing Center.

In Linux distributions, these settings can be configured using the Settings of your Desktop Environment, or if you prefer the manual method, it involves editing a file (varies depending on your Linux distribution and version).

Make sure the IP addresses set for these are not dynamically allocated to another system on the network. You don't want your static IP-configured system to ask for an IP that is already assigned to another system while it wasn't on. You can avoid this by either having static IP addresses for all the systems on your network, each having their own unique ID, or by having the static IP addresses higher than the usually used range (Usually routers tend to start assigning from the range of 192.168.x.1 or 192.168.x.101, so if know a maximum of 10 different systems would be connected to the network at a time, you can assign static IPs above 20 to avoid collisions).

Another way to achieve this would be to change the MAC address of one or both of your Operating systems and assign different static IPs to those MAC addresses using dd-wrt configuration.

4

This is possible by matching DHCP option 60, “Vendor class identifier”. Microsoft operating systems will send a string starting with “MSFT”. Official documentation is also available. Windows 8 still sends “MSFT 5.0”, by the way.

You should be able to check for it with DNSMASQ (which I believe is what DD-WRT uses) like this:

dhcp-match=set:windows,60,MSFT

As for sending the address, it’s a little harder. Unfortunately, the dhcp-host option is not conditional. The dhcp-range option, however, is. So different address pools are possible.

Generally, for these kinds of things, you’re better of with a fully-featured DHCP server, like ISC DHCP.

user219095
  • 65,551
2

I'd recommend following Chirag64's advice and configuring the static IP on the OS rather than using DHCP reservations. However, I did find this answer on another network that points to fingerbank.org, which stores information about device fingerprints. Fingerbank mentions the PacketFence tool which can apparently use those device fingerprints to segregate network traffic based on device type. I suppose there is probably a way to configure dd-wrt to use PacketFence to segregate your traffic, so that is probably the place to look.

Ryan
  • 3,925