欢迎来到天天文库
浏览记录
ID:41393070
大小:63.08 KB
页数:9页
时间:2019-08-24
《Windows命令行下配置IP地址》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
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
此文档下载收益归作者所有