How To Add A Secondary IP Address To Windows Container

Recently someone asked me how can he adds a secondary IP address to a Windows Container hosting multiple IIS websites.

Adding a secondary IP Address to a Windows Container can be done using a few PowerShell cmdlets In a matter of a few minutes as you will see below.

Get Started

In my case, I have a Windows Server Core 2016 1709 Container and my container host has the Network configuration below.

Next, I’ll create a Container with the Transparent network above

docker run -it --name test --network=MyTransparentNetwork microsoft/windowsservercore:1709 powershell

From the Container, I’ll run the cmdlet below to get the Network Adapter Interface ID


In the final step, I’ll assign a secondary IP

New-NetIPAddress -InterfaceIndex 23 -IPAddress -PrefixLength 24 -DefaultGateway

And as you can see below. The new secondary IP address Is set.

This article Is based on the blog post below where I used it on Windows Nano Server 2016.

Leave a Reply

Your email address will not be published. Required fields are marked *