The problem:
Is there a way to block offer to the DHCP client when the client already has IP assigned on the second interface ?
This second interface obviously has different MAC but the hostname of the client is the same for both interfaces.
I do not know which interface is connected and assigned first but the second one should be “banned” till the first works.
I do not want to statically disable particular MACs.
A. Why to fill DHCP table with unsed leases ?
B. Computers in accounting department needs fast stable ethernet connection . When users forgot to switch-off WiFi then PC gets IP on WiFi first and it becomes “main” connection instead of ethernet one which means less stable and slower connection.
I know how to list “doubled” connections and who is the owner but I want just to fully disable such connections.
I think easier would be to write some Windows script to check for network status on both nics. If both Ethernet and WiFi are up and belong to the same subnet, disable one or change default GW or do whatever you think is appropriate. You could deploy that with Group Policy.
If IP pools are running out of addresses, make the pools larger or shorten the lease times. Trying to get fancy by making rules that block things if x-y-z is true can come back and cause strange problems later.
(EDIT - I previously said ‘extend’ lease times - whoops. Fixed.)
If you’re completely against using a larger subnet mask (and there’s no need to be against that, but it’s your network not mine) then you might choose to split your network into multiple subnets. Move the wireless to a different IP segment…
The default behavior on Windows (and Mac) computers is that a wired connection is always given preference over a wireless when both connections are active. I agree with ZeroByte…use a larger IP space. Or, you could set your wireless up to use a different subnet than your wired network. Either way, all your computers should automatically default to the wired connection when both wired and wireless are available. You’re making a mountain out of a mole-hill…
simply decrease(and Dramatically !!) DHCP lease time, increase IP-pool for DHCP server to prevent saturation/DOS attack/misconfiguration.
if thats not enough - bound some leases STATICALLY in DHCP server(NOT in ARP’s static list) and then restrict/whitelist some hosts in those leases in firewall.
and another “last resort tweak” - turn ARP on DHCP-managed interfaces to “reply-only”.
would help enough, i think.