• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Windows 10: How to set IP address using netsh but using MAC address?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

mrjayviper

Registered
Joined
Jul 18, 2012
So I have a dual port gigabit Ethernet card and I want to setup their IPs via a batch script.

I have used this and it works at the time I first wrote it.

Code:
    netsh interface ipv4 set address name="Ethernet" static 192.168.2.2 255.255.255.0
    netsh interface ipv4 set address name="Ethernet 2" static 192.168.3.2 255.255.255.0

But the problem is when I reinstalled Windows. Windows has swapped them so the IPs got swapped as well.

I am hoping to can help me with another script/command where I can use MAC address instead of "interface name" since this name can be swapped.

Thanks
 

Zuzzz

Premium Member
Joined
Mar 11, 2003
I hope I do not sound dumb but could you just change the script to reflect the change? As in, reverse the script to 'correct' the unwanted change. Again forgive me if it sounds dumb.

Z