Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

How to make sure use one IP access Internet firstly, when a Windows Server have multi IP addresses?

Writer 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.4

I 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?

enter image description here

3

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=true

For example:

netsh int ipv4 add addr "Ethernet" 192.168.1.5/24 skipassource=true

PowerShell

To add a new address:

New-NetIPAddress -IPAddress <addr>/<len> -InterfaceAlias <interface> -SkipAsSource $True

PowerShell also allows changing existing addresses:

Get-NetIPAddress <address> | Set-NetIPAddress -SkipAsSource $True

Final 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:

8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy