MS-DOS命令笔记:ipconfig

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”

此条目发表在os/software分类目录,贴了, 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据