資源描述:
《Windows命令行下配置IP地址》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、Windows命令行下配置IP地址Sometimesthesystemiswrong,thereisnolocalconnectioninthenetworkconnection,andthenetworkcardisnorma1.ThereisnowaytochangethelocalIPaddress?BecauseusuallymodifyIPinthelocalconnectionproperties,butlocalconnectionisnowcan'tsee,underthecommandlinewithIPconf
2、igcanviewyourIPaddress,butcannotbemodified.Infact,wecanconfiguretheIPaddressatthecommandline,whichistheNETSHcommandofthesystem.Aftermybatchprocessing,youcanmodifythe"localconnection"IPaddress:@echooffSetIP=〃192.168.3.100〃//settheIPaddressarbitrarily(theIPaddressandthe
3、connectionnameareenclosedindoublequotationmarks)EchosetIPaddressto%IP%ThenetshinterfaceIPsetaddressname二"localcormection"Thesource=staticaddress=%IPnumbermask=255.255.255.0Gateway=192.168.3.177Remgwmetric=autoEcho〃ok〃RempauseCommonnetshcommands:(1)setuptheWindowsxpthe
4、IPaddressofthe"localconnection"for10.223?3.254,subnetas255?255?255?0,gatewayfor10.223.3.1,jumppoints1.C:>netshinterfaceIPsettheaddressname二"localareaconnectiorTsource二staticaddr二10.223.3.254mask255.255.255.0gatewayof二二10.223.3.1Gwmetric二auto(2)settingtheIPaddressofWi
5、ndowsxp"localconnection"automaticallygetstheC:>netshinterfaceIPsetaddressname二"localareaconnectiorTsource二DHCP(3)theDNSnameforsettingWindowsxp"localconnectiorTis10.223?3.2C:>netshinterfaceIPsetDNSname二"localareaconnection"source二staticaddr二10.223.3.2register二primary
6、(4)theDNSforsettingupWindowsxp"localconnectiorTisautomaticallyobtainedC:>netshinterfaceIPsetDNSname二"localareaconnection"source二DHCPAttached:thenetshcommandconfigurestheIPaddressandthedetailedusageofDNSAddIPaddressesanddefaultgateways(add,resetorupdatetheoriginalIPad
7、dress)NetshaddinterfaceIPaddressUsage:addaddress[name二]IPaddress[mask二]IPsubnetmask][[gateway二]IPaddress[gwmetric二]integer]Parameters:Name-IPinterfacename?Addr-theIPaddresstobeaddedtothisinterface?Mask-theIPsubnetmaskthatspecifiestheIPaddress?Gateway-specifiesthedefau
8、ltgatewayfortheIPaddress?Gwmetric-thejumppointforthedefaultgateway.Annotation:addanIPaddressanddefaultgatewaytoaninterfaceco