Linux – Best practices to set up laptop with wireless and wired interface/NIC over DHCP

dhcplinuxnetworking

Up to now, I've always configured my laptop with a wired and wireless interface, each of them being offered a different IP address from DHCP, and each of those IP addresses resolving to different host names. This has always felt kludgey but worked.

Our sysadmins made a configuration that for practical reasons doesn't work, which involves linking the same IP address to the two different MAC's. It doesn't work practically because of the tool they use to do so, but googling for this configuration tells me that this can in fact work.

I've also found posts that indicate that Windows wouldn't accept two interfaces having the same IP.

So, what are the best practices here, and the pros and cons of each approach ? In my particular case, I run Fedora Linux on the laptop. It sounds like using the same IP for both NIC's is in fact a nicer solution, since I would have the same hostname regardless of how I'm connected.

Best Answer

This isn't entirely clear but for arguments sake lets start with the premise that you are only going to be using 1 interface at a time, such that you will never have the same IP assigned and active at the same time on two different mac addresses. This will not work (at least not in the traditional meaning of the word work). Similarly they have to be the same subnet, obviously if the wireless and wired networks are on different subnets the same IP allocation cannot work.

If both the wired and wireless networks export the same subnet then its relatively trivial to bring up that particular interface with the same IP, DHCP has no restriction preventing the same IP being doled out to two different mac addresses (although it would specifically have to be configured in the dhcp configuration) to do so. If a particular address is reserved for you there is also no reason why you couldn't statically bring it up as necessary in a manual configuration for each network.