Win 2003中重置Internet协议
chw · 2007-08-31 17:54 · 61068 次点击
如果您在“本地连接”属性中显示的此连接使用下列项目列表中单击Internet协议(TCP/IP)项,您将发现卸载按钮不可用(被禁用)。这是因为传输控制协议/Internet协议(TCP/IP)堆栈是MicrosoftWindowsServer2003的核心组件,不能删除。
在有些情况下,可能需要重新安装TCP/IP以使TCP/IP堆栈恢复为原始状态。可以使用NetShell实用程序重置TCP/IP堆栈,使其恢复到初次安装操作系统时的状态。
NetShell实用程序(netsh)是一个命令行脚本编写工具,您可以使用此实用程序配置并监视WindowsServer2003联网。此工具提供了交互式网络外壳程序接口。
您可以使用该实用程序的Internet协议(IP)上下文中的reset命令重写以下与TCP/IP相关的注册表项:
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
SYSTEM\CurrentControlSet\Services\DHCP\Parameters\
运行此命令的结果与删除并重新安装TCP/IP协议的效果相同。
命令语法
netshintipreset
要使用netsh命令重置TCP/IP堆栈,您必须指定记录命令结果的日志文件的名称。如果输入了本文“命令示例”一节中介绍的任一命令,当前计算机中的TCP/IP堆栈将被重置,且该xx作的活动将被记录到命令行中指定的Resetlog.txt文件。在第一个示例中,日志文件被创建在当前文件夹中;在第二个示例中,则指定了Resetlog.txt日志文件的完整路径。
备注:如果该文件的名称与目标文件夹中的现有日志文件的名称相同,则会将新日志文件的信息附加到现有文件的结尾处。
命令示例
下面的示例说明了如何使用netsh命令重置TCP/IP协议堆栈。
示例1
单击开始,然后单击运行。
在打开框中键入cmd,然后单击确定。
在命令提示符后键入以下命令,然后按ENTER键:
netshintipresetresetlog.txt
备注:在上面的命令中,“int”是interface命令的缩写形式。
键入exit,然后按ENTER键。
示例2
单击开始,然后单击运行。
在打开框中键入cmd,然后单击确定。
在命令提示符后键入以下命令,然后按ENTER键:
netshintipresetc:\resetlog.txt
键入exit,然后按ENTER键。
要查看有关命令的帮助,请键入空格,然后键入?。即会显示有关netsh命令子上下文中可用命令的其他帮助。例如,要查看上一节中介绍的netsh命令,应在命令提示符后键入以下命令:
键入netsh?,然后按ENTER键。
键入netshint?,然后按ENTER键。
键入netshintip?,然后按ENTER键。
键入netshintipreset?,然后按ENTER键。
NETSHINTIPRESET的日志文件示例
以下是一个日志文件的示例,该日志文件是由运行ipreset命令后的netsh生成的。根据发出命令的计算机上不同的配置,实际的日志文件也会有所不同。通常,如果没有替换TCP/IP注册表项的原始配置,则不会在文件中记录任何操作。
resetSYSTEM\CurrentControlSet\Services\Dhcp\Parameters\Options\15\RegLocation
oldREG_MULTI_SZ=
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\?\DhcpDomain
SYSTEM\CurrentControlSet\Services\TcpIp\Parameters\DhcpDomain
added
SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{2DDD011E
-B1B6-4886-87AC-B4E72693D10C}\NetbiosOptions
added
SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{BAA9D128
-54BB-43F6-8922-313D537BE03E}\NetbiosOptions
reset
SYSTEM\CurrentControlSet\Services\Netbt\Parameters\Interfaces\Tcpip_{BD2859BA
-B26A-4E2B-A3FE-3D246F90A81A}\NameServerList
oldREG_MULTI_SZ=
10.1.1.2
deletedSYSTEM\CurrentControlSet\Services\Netbt\Parameters\EnableLmhosts
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\AddressType
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\DefaultGatewayMetric
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\DisableDynamicUpdate
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\DontAddDefaultGateway
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\EnableDhcp
oldREG_DWORD=0
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\NameServer
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\RawIpAllowedProtocols
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\TcpAllowedPorts
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{2DDD011E-B1B6-
4886-87AC-B4E72693D10C}\UdpAllowedPorts
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\DisableDynamicUpdate
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\EnableDhcp
oldREG_DWORD=0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\IpAddress
oldREG_MULTI_SZ=
12.12.12.12
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\IpAutoconfigurationAddress
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\IpAutoconfigurationMask
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\IpAutoconfigurationSeed
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\RawIpAllowedProtocols
oldREG_MULTI_SZ=
0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\SubnetMask
oldREG_MULTI_SZ=
255.255.255.0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\TcpAllowedPorts
oldREG_MULTI_SZ=
0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{5B3675C3-6EB9-
4936-B991-04DA31024C4E}\UdpAllowedPorts
oldREG_MULTI_SZ=
0
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\AddressType
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\DefaultGatewayMetric
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\DisableDynamicUpdate
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\DontAddDefaultGateway
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\EnableDhcp
oldREG_DWORD=0
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\NameServer
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\RawIpAllowedProtocols
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\TcpAllowedPorts
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BAA9D128-54BB-
43F6-8922-313D537BE03E}\UdpAllowedPorts
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\DefaultGateway
oldREG_MULTI_SZ=
10.1.1.2
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\DefaultGatewayMetric
oldREG_MULTI_SZ=
0
added
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\DisableDynamicUpdate
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\EnableDhcp
oldREG_DWORD=0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\IpAddress
oldREG_MULTI_SZ=
10.1.1.1
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationAddress
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationMask
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\IpAutoconfigurationSeed
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\NameServer
oldREG_SZ=10.1.1.2,10.1.1.3
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\RawIpAllowedProtocols
oldREG_MULTI_SZ=
0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\SubnetMask
oldREG_MULTI_SZ=
255.255.255.0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\TcpAllowedPorts
oldREG_MULTI_SZ=
0
reset
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{BD2859BA-B26A-
4E2B-A3FE-3D246F90A81A}\UdpAllowedPorts
oldREG_MULTI_SZ=
0
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DontAddDefaultGatewayDefau
lt
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableIcmpRedirect
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\EnableSecurityFilters
deletedSYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SearchList
deleted
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\UseDomainNameDevolution