How to make sure use one IP access Internet firstly, when a Windows Server have multi IP addresses?
Sophia Terry
windows have multi IP addresses, but now I want to browser Internet, I only want to use one IP access Internet preferentially.
such as I have IP addresses:
45.1.1.1
45.1.1.2
45.1.1.3
45.1.1.4I want to access the IP.cn, I only want to there shows 45.1.1.1, but it(ip.cn) will show 45.1.1.2 or others actually.
how to realize it?
EDIT-01
I don't know the skip as source, is it mean this button? do you mean check it to add secondary IP or uncheck to add 2rd IP?
1 Answer
Delete and re-add the secondary addresses with the "skip as source" flag specified. This can be done through command-line tools only (but not through the "TCP/IP Properties" GUI).
Netsh
Netsh requires the address to be deleted first, then re-added:
netsh interface ipv4 add address <interface> <address>/<prefixlen> skipassource=trueFor example:
netsh int ipv4 add addr "Ethernet" 192.168.1.5/24 skipassource=truePowerShell
To add a new address:
New-NetIPAddress -IPAddress <addr>/<len> -InterfaceAlias <interface> -SkipAsSource $TruePowerShell also allows changing existing addresses:
Get-NetIPAddress <address> | Set-NetIPAddress -SkipAsSource $TrueFinal note
Note that in Server 2012, you must use only command-line tools, as any address change done through the "TCP/IP Properties" GUI will lose this flag for all addresses.
Further information:
- Microsoft TechNet Blogs: Fine Grained Control When Registering Multiple IP Addresses On a Network Card and Part 2: PowerShell