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)
- Configure a Single NIC with Multiple IP Addresses
- Adding Additional properties
- Configure Multiple Network Adapters with IP Addresses (Multihomed)
- Assignment by MAC Address
- The Big Gotcha
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
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,188.8.131.52 OSDAdapter0SubnetMask=255.255.255.0,255.255.255.0 OSDAdapter0Gateways=10.0.0.1,184.108.40.206 OSDAdapter0DNSServerList=10.0.0.1 OSDAdapter0Name=Corporate LAN OSDAdapter0DNSSuffix=scriptimus.wordpress.com
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
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=220.127.116.11,18.104.22.168 OSDAdapter1SubnetMask=255.255.255.0,255.255.255.0 OSDAdapter1Name=Internet OSDAdapter1DNSSuffix=isp.example.com
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.
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.