2 MACs map to one IP addr. Wired, then Wifi OK, reverse not?
-
Hello all,
I have a computer that I would like to always be at the same IP address. I've created 2 static mappings for it, one for its wired interface and one for its wireless interface. I've noticed that if this computer is connected via Ethernet, and I unplug the Ethernet cable and then connect via Wi-Fi, then DHCP gives the Wi-Fi interface the IP address that is supposed to receive. On the other hand, if I'm connected by Wi-Fi, and I then disconnect Wi-Fi and connect the Ethernet cable, the DHCP server does not issue an IP address. I then have to make the now-offline Wi-Fi lease go away, and then the DHCP server will issue the IP address to the wired interface.
Is there a way to fix this problem?
Also, how does PFSense know to remove the wired lease when I disconnect the ethernet cable?
-
My experience has been you always need to turn off the Wi-Fi rather than disconnect. Computer With Wi-Fi and ethernet will have a preferred connection. It won’t look to the second connection until the preferred is switched off. I believe if you just disconnect the Wi-Fi, it’ll just standby with that connection waiting for you to reconnect. That’s why you need to switch it off.
-
@Uglybrian Yes, when I say disconnect Wifi, I mean turning off Wifi.
-
@tzalmaves what OS do you use? I run Linux Mint and often have to manually restart the NetManager daemon to get it working.
-
Perhaps the solution is to release the lease prior to disconnecting either network.
Unplugging a network connection is different than releasing the lease then disconnecting the cable.
If this is windows, it's possible to create a task based on a trigger. In this case I don't think it will work. The trigger would be loss of network connection, but once lost, can't issue a dhcp release.
You could however run a script that would do the same via commandline. Just have to remember to execute it before switching wired<>wireless.
I use something like this for my screen blanking. I have a rodent that suffers from tourette's syndrome, manifesting as random movements when the the trackball is not even touched. This results in the screen waking for no good reason.
Using such a script it's set to disable the mouse, then induce screen sleep mode. Of course I can't wake the mouse but can with keyboard. A trigger based on wakeup runs another script that re-enables the rodent.
This particular box has 2 ethernet nics + wifi. AP is configured for for a different vlan than the primary lan. Both wifi and wired can be on at the same time (with different IP's).
What is your use case for keeping the same ip for both interfaces?