MS-DOS命令笔记:ipconfig

发表于: os/software | 作者: | 日期: 2009/3/12 09:03

ipconfig 概述

ipconfig是调试计算机网络的常用命令,通常大家使用它显示计算机中网络适配器的IP地址、子网掩码及默认网关。其实这只是ipconfig的不带参数用法,而它的带参数用法,在网络应用中也是相当不错的。

参数说明

+++++++++++++++++++++++++++++++++++++++++++
1、/all
+++++++++++++++++++++++++++++++++++++++++++

显示所有网络适配器(网卡、拨号连接等)的完整TCP/IP配置信息。与不带参数的用法相比,它的信息更全更多,如IP是否动态分配、显示网卡的物理地址等。

+++++++++++++++++++++++++++++++++++++++++++
2、/batch 文件名
+++++++++++++++++++++++++++++++++++++++++++
将Ipconfig所显示信息以文本方式写入指定文件。此参数可用来备份本机的网络配置。

+++++++++++++++++++++++++++++++++++++++++++
3、/release_all和/release N
+++++++++++++++++++++++++++++++++++++++++++
释放全部(或指定)适配器的由 DHCP分配的动态IP 地址。此参数适用于IP地址非静态分配的网卡,通常和下文的renew参数结合使用。

+++++++++++++++++++++++++++++++++++++++++++
4、ipconfig /renew_all或ipconfig /renew N
+++++++++++++++++++++++++++++++++++++++++++
为全部(或指定)适配器重新分配IP地址。此参数同样仅适用于IP地址非静态分配的网卡,通常和上文的release参数结合使用。

应用实例

1、备份网络设置


ipconfig /batch bak-netcfg

说明:将有关网络配置的信息备份到文件bak-netcfg中。

2、为网卡动态分配新地址

ipconfig /release 1

说明:去除网卡(适配器1)的动态IP地址。

ipconfig /renew 1

———————以下是ipconfig的帮助文件———————
USAGE:
ipconfig [/? | /all | /renew [adapter] | /release [adapter] | /flushdns | /displaydns | /registerdns | /showclassid adapter | /setclassid adapter [classid] ]

where
adapter Connection name
(wildcard characters * and ? allowed, see examples)

Options:
/? Display this help message
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.

The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP.

For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed.

For Setclassid, if no ClassId is specified, then the ClassId is removed.

Examples:
> ipconfig … Show information.
> ipconfig /all … Show detailed information
> ipconfig /renew … renew all adapters
> ipconfig /renew EL* … renew any connection that has its name starting with EL
> ipconfig /release *Con* … release all matching connections, eg. “Local Area Connection 1” or “Local Area Connection 2”

: https://blog.darkmi.com/2009/03/12/788.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.