Condividi tramite


Installing the IPv6 interface in Win2k3 SP1 WinPE

Installing a dual-stack networking interface to allow both IPv4 and IPv6 clients is possible very easily on the full version of Win2k3 SP1 and WinXP SP2, it is a simple matter of running the following command line:

netsh interface ipv6 install

If you run ipconfig after running this install, you should see a series of lines similar to this along with your traditional IPv4 address:

        IP Address. . . . . . . . . . . . : 3ffe:8312:ffff:b1a1:6c90:9e5e:95fa:828e

It’s a little more complicated on WinPE as there’s a number of dependencies that aren’t available in the default install. Here’s a listing of them, this will also get netsh.exe working for most cases.

inf\netip6.inf

This is the main interface installation inf. This will actually need to be hand modified from the default found in the Win2k3 SP1 full build. The main difference is the smb service needs to be enabled to allow file sharing to work properly. Generally this is located in the file nettcpip.inf in the full os, but this has been stripped out for some reason in the default winpe nettcpip.inf file. You can choose to re-add this into the original file or (like I've done here) add the missing .inf parts into the netip6.inf file. Here's the appropriate changes that need to be made to the netip.inf file. New items are in bold. There's a lot of unchanged code in between, look for the .inf header sections to make sure you put the pieces in the correct place.

[Msft.NTx86]
%MS_TCPIP6.DisplayName% = MS_TCPIP6.Install, MS_TCPIP6
%MS_NETBT_SMB.DisplayName% = MS_NETBT_SMB.PrimaryInstall, MS_NETBT_SMB ;NETBT_SMB
%MS_SMB.DisplayName% = MS_SMB.Install, MS_SMB

;**********************************************************
; NETBT_SMB section
;**********************************************************
[MS_NETBT_SMB.PrimaryInstall]
Characteristics = 0x38 ; NCF_HIDDEN|NCF_NO_SERVICE|NCF_NOT_USER_REMOVABLE
AddReg = Registry.MS_NETBT_SMB.PrimaryInstall

[Registry.MS_NETBT_SMB.PrimaryInstall]
HKR, Ndi, BindForm, 0, "NetbiosSmb"
HKR, Ndi, HelpText, 0, %MS_NETBT_SMB.HelpText%
HKR, Ndi\Interfaces, UpperRange, 0, "netbios_smb"
HKR, Ndi\Interfaces, LowerRange, 0, "nolower"

;=====================================
; Microsoft SMB Interface and Service Install
;=====================================
[MS_SMB.Install]
Characteristics = 0x28 ; NCF_NOT_USER_REMOVABLE | NCF_HIDDEN
AddReg = Registry.MS_SMB.Install

[Registry.MS_SMB.Install]
; Class Information
HKR, Ndi, Service, 0, "Smb"
; HKR, Ndi, HelpText, 0, %MS_SMB.HelpText%

; Interfaces
HKR,Ndi\Interfaces,UpperRange,0,"netbios_smb"
HKR,Ndi\Interfaces,LowerRange,,"tdi"

; Service install
[MS_SMB.Install.Services]
AddService = Smb, 0, Install.AddService.Smb, NetEventLog

; Install Smb service
[Install.AddService.Smb]
DisplayName = %MS_SMB.Smb.DisplayName%
ServiceType = 1 ;SERVICE_KERNEL_DRIVER
StartType = 1 ;SERVICE_SYSTEM_START
ErrorControl = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary = %12%\smb.sys
LoadOrderGroup = PNP_TDI
Dependencies = Tcpip, Tcpip6
AddReg = Registry.Service.Smb
Description = %MS_SMB.Smb.ServiceDescription%

[Registry.Service.Smb]
; HKLM,System\CurrentControlSet\Services\NetBT\Parameters,UseNewSmb,%FLG_ADDREG_TYPE_DWORD%,0
; HKR,Parameters,DebugFlag,%FLG_ADDREG_DWORD_NO_CLOBBER%,0x0

[Registry.Service.Smb.DelReg]
; HKLM,System\CurrentControlSet\Services\NetBT\Parameters,UseNewSmb

;====================================
; SMB Interface and Service Remove
;====================================
[MS_SMB.Install.Remove]
DelReg = Registry.Service.Smb.DelReg

[MS_SMB.Install.Remove.Services]
DelService = Smb

[Strings]
; NETBT_SMB
MS_NETBT_SMB.DisplayName = "Message-oriented TCP/IP Protocol (SMB session)"
MS_NETBT_SMB.HelpText = "A protocol layered on TCP/IP which preserves message boundaries. This instance of the protocol is for use by the file sharing protocol."

MS_SMB.DisplayName = "Microsoft NetbiosSmb"
MS_SMB.HelpText = "A protocol layered on TCP/IP or TCP/IPv6 which preserves message boundaries. This instance of the protocol is for use by the file sharing protocol."
MS_SMB.Smb.DisplayName = "Message-oriented TCP/IP and TCP/IPv6 Protocol (SMB session)"
MS_SMB.Smb.ServiceDescription = "Microsoft NetbiosSmb Device Driver"

system32\6to4svc.dll
system32\wship6.dll
system32\drivers\ip6fw.sys
system32\drivers\tcpip6.sys
system32\drivers\tunmp.sys

The files listed above are specific requirements for the IPv6 interface.

system32\drivers\smb.sys

The files listed above are specific requirements for the smb interface that's been added to the netip6.inf file.

system32\aaaamon.dll
system32\dhcpmon.dll
system32\fwcfg.dll
system32\hnetmon.dll
system32\ifmon.dll
system32\ipmontr.dll
system32\ippromon.dll
system32\ipv6mon.dll
system32\ipxsap.dll
system32\msctf.dll
system32\netsh.exe
system32\nshipsec.dll
system32\ntdsapi.dll
system32\rasmontr.dll
system32\rpcns4.dll
system32\wshisn.dll
system32\wshnetbs.dll
system32\wshqos.dll
system32\wshtcpip.dll

The files listed above are requirements for netsh.exe to run.

It may be possible to strip down the dependencies required significantly here, but I felt that enabling as much of netsh.exe as possible can only be a good thing. The files *mon.dll seem to be specific to the netsh program, which is why the ipv6mon.dll is in the second group. You may also be able to install the IPv6 interface using netcfg rather than the full blown network shell.

- mike (Michael Warmington, mwarm@microsoft.com)