How to assign different static IP addresses to the same machine depending on its OS?
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.
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.
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.