MDT 2012: Automating Network Interface Configuration

I’m currently using MDT (and SCCM) to build servers. After I clone templates in VMWare I run a Post OS task sequence that will rename the Server, assign a static IP address, Join the domain, install Apps etc. One server has 2 network interface cards with multiple static TCP/IP addresses on the second card.

OK so this all sounds easy right? Yeah, well wait until you actually try to do it. There’s a couple of issues that I ran into when I tried to configure the second card so I thought I’d share my solutions.

If you have 1 Task Sequence that is only going to deploy 1 server then I suggest using the task sequence step Apply Network Settings. This will handle multiple adapters for you and save you headaches. This runs the script ZTINicConfig.wsf which uses netsh to set its configuration.

However, if you need to use the same Task Sequence for setting static IP addresses in various scenarios then you will need to use the customsettings.ini (or database) to hold the settings. The samples below demonstrate adapter deployment in both uni and multihomed adapter configurations.

Configure a Single NIC with 1 IP Address (Unihomed)

In this example, OSDAdapter0EnableDHCP turns off DHCP. OSDAdapter0Name is the label for the NIC. The rest is really obvious so I’ll just continue with the examples.

OSDAdapter0EnableDHCP=False
OSDAdapter0IPAddressList=10.0.0.2
OSDAdapter0SubnetMask=255.255.255.0
OSDAdapter0Gateways=10.0.0.1
OSDAdapter0DNSServerList=10.0.0.1
OSDAdapter0Name=Corporate LAN
OSDAdapter0DNSSuffix=scriptimus.wordpress.com

Configure a Single NIC with Multiple IP Addresses

In this example, the property OSDAdapter0IPAddressList has a list of IP Addresses delimited by commas. The same goes for the Subnet Mask, Gateway and DNS Servers.

OSDAdapter0EnableDHCP=False
OSDAdapter0IPAddressList=10.0.0.2,15.0.0.7
OSDAdapter0SubnetMask=255.255.255.0,255.255.255.0
OSDAdapter0Gateways=10.0.0.1,15.0.0.1
OSDAdapter0DNSServerList=10.0.0.1
OSDAdapter0Name=Corporate LAN
OSDAdapter0DNSSuffix=scriptimus.wordpress.com

Adding Additional properties

These are the extra properties that can be applied with the default values shown. So unless you need to changed from the below settings, you can omit these lines. They don’t really need explaining.

OSDAdapter0EnableDNSRegistration=False
OSDAdapter0EnableFullDNSRegistration=True
OSDAdapter0EnableTCPIPFiltering=False
OSDAdapter0EnableLMHOSTS=False
OSDAdapter0EnableWINS=False
OSDAdapter0GatewayCostMetric=Automatic
OSDAdapter0TcpipNetbiosOptions=0

Configure Multiple Network Adapters with IP Addresses (Multihomed)

Now here’s where extra the research is needed. The first thing is property OSDAdapterCount has been set to 2. The second set of settings have all been incremented from 0 to 1.

OSDAdapterCount=2
OSDAdapter0MacAddress=%MacAddress001%
OSDAdapter0EnableDHCP=False
OSDAdapter0IPAddressList=10.0.0.2
OSDAdapter0SubnetMask=255.255.255.0
OSDAdapter0DNSServerList=10.0.0.1
OSDAdapter0Name=Corpnet
OSDAdapter0DNSSuffix=continuum.local
OSDAdapter1MacAddress=%MacAddress002%
OSDAdapter1EnableDHCP=False
OSDAdapter1IPAddressList=131.107.0.2,131.107.0.3
OSDAdapter1SubnetMask=255.255.255.0,255.255.255.0
OSDAdapter1Name=Internet
OSDAdapter1DNSSuffix=isp.example.com

Assignment by MAC Address

You’ll see above I’ve added the OSDAdapter0MacAddress property. This allows you to assign a configuration set to a specific card based on its hardware address. The gather process will collect the  MAC Addresses of all enabled adapters and store them in property values incrementing them in series. eg. MacAddress001, MacAddress002 etc. These can be called in the customsettings.ini by enclosing them in %’s. This allows you to  assign which card gets the appropriate config settings.

The Big Gotcha

Before I forget, there’s a major gotcha. By default, MDT is only configured to recognise the first NIC because only Adapter0 has been configured in the ZTIGather.xml. So if you wish to configure multiple adapters then you will need edit the ZTIGather.xml file to add a new section like in the example below.

Advertisements

About Andrew Barnes

A Scripting and Deployment Specialist.
This entry was posted in Deployment, MDT 2010, MDT 2012 and tagged , , , , , , . Bookmark the permalink.

16 Responses to MDT 2012: Automating Network Interface Configuration

  1. skeltor9000 says:

    great article on how todo this. I see that you modified the customsettings.ini file, what if I needed to install on 50 hosts, I cant use the same file. So you suggest using the the database option within MDT, can do that multiuple interfaces after the modification of ZTIGather.xml?

    Like

    • Hi,
      The change to the gather and customsettings.ini are made on the deployment share so it can be applied to 50 or 50,000 hosts. I havn’t tried this change with the database yet.
      /Andrew

      Like

  2. Vineeth (MSFT) says:

    Yes. you can set IP address for multiple adapters after adding the OSDAdapter1… variables in ZTIGather.xml. By default it will have only one adapter variables defined which is OSDAdapter0…
    So you have to copy/modify/add for OSDAdapter0… Then set the variablesin CS.ini as mentioned above for multihome..

    Like

  3. Pingback: MDT 2012 Settings for fully automated LTI deployment, part I: Bootstrap.ini | renshollanders.nl

  4. remotefix says:

    My delimma is that I will be deploying 3-4 different hardware models of servers which will have between 4-7 NIC cards. How can I use your solution in my scenario?

    Like

  5. remotefix says:

    I tried the ztiniconfig script with force capture and it did the job for me

    Like

  6. Hi sir,your document is very helpful for me and I have 1 request .Please help me –

    I am useing MDT 2012Update1. ” How configure DNSSuffix settings to autoappend in TCP/IP advanced properties for all the systems while migrating from Winxp to Win7 ,when the domain environment has no active DHCP”.

    As i am new to MDT i am not able to find the proper documents and your document helped me to resolve the Automation of Domain joining in Static i.p. environment with standalone Media”
    Your support will be a very lot for me

    Regards
    N.V.Srinivas,

    Like

    • Hi there,

      You’ll need to edit the unattend.xml to configure this setting.

      Go to this site for an example. http://technet.microsoft.com/en-us/library/cc766454(v=ws.10).aspx

      I’ve also written a post here to help you update the unattend.xml

      /Andrew

      Like

      • Hi Sir,
        Sorry for asking agian same issue…
        I am MDT 2012Update only,I don’t have active DHCP or Active SCCM.
        My scenario is I need to create a standalone media which can support me to migrate all the desktop systems from Windows XP .
        The Media is supporting me to do all the tasks…User profilesbakup,xp to win7 Migration,Drivers,Apps Installation,Domain Joining,user profiles bakup.

        Now I have a problem with the DNS Suffixes auto appending for every migrated pc.Is ther any guide which can help me to overcome this issue and also as ur sugestion how TO modify the UNATTEND.xml to make the DNSSuffixes auto appending for each Desktop which will be migrated useing this standalone Image.

        Please donot feel in an irritating way or uneasyabout thisrequest.Please suggest me to overcome this issue.

        Like

  7. Ricco says:

    I cannot get this to work i run MDT 2012 Update 1, i use the database, and have set the settings on the computer object, no matter what i dont the static ip set.

    we are talking 1nic adapter, nothing fancy, i use groups to give servers applications and other settings which works perfect.

    how do i get the ip to work?

    Like

  8. Nathan says:

    Great blog… I have a question what if I want to deploy an image based on its ip address? let’s say from 192.168.1.1 till .10 image 1 will be deployed automatically and 192.168.1.11 till .20 image 2 will be deployed. my dhcp server will take care of the ip address deployment.

    Like

  9. Griff says:

    Running MDT 2013 and booting a VM from the ‘LiteTouchPE_x64.iso’. The network where the VM resides doesn’t have a DHCP server present. When the ISO boots it takes a while since it is trying to get a DHCP which eventually times out and then the initial Welcome screen appears where I can manually add in a static IP Address. How do I automatically provide an IP Address to this VM without having to manually enter in that information? Seems that adding in those OSDAdapter settings into the customsettings.ini has no effect since that file isn’t even processed at that point. Perhaps I’m missing something but if you could shed some light on this question that would be helpful.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s