Windows 7 断开媒体连接时获取静态IP地址、子网掩码和网关
当媒体与端口断开连接时,是否有方法通过命令行查询当前ip地址、子网掩码和默认网关 我累了Windows 7 断开媒体连接时获取静态IP地址、子网掩码和网关,windows-7,Windows 7,当媒体与端口断开连接时,是否有方法通过命令行查询当前ip地址、子网掩码和默认网关 我累了ipconfig Ethernet adapter Local Area Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : netsh interface ip show addresses显示网关,但不显示子网或ip地址 Configu
ipconfig
Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
netsh interface ip show addresses
显示网关,但不显示子网或ip地址
Configuration for interface "Local Area Connection"
DHCP enabled: No
Default Gateway: 192.168.6.17
Gateway Metric: 1
InterfaceMetric: 5
和netsh接口ip显示配置
Configuration for interface "Local Area Connection"
DHCP enabled: No
Default Gateway: 192.168.6.17
Gateway Metric: 1
InterfaceMetric: 5
Statically Configured DNS Servers: None
Register with which suffix: Primary only
Statically Configured WINS Servers: None
当媒体断开连接时,GUI显示ip地址、子网掩码和默认网关。是否有命令在命令行上获取相同的信息?要获取ip地址和子网掩码,请运行以下命令
> netsh interface ip dump
# ----------------------------------
# IPv4 Configuration
# ----------------------------------
pushd interface ipv4
reset
set global icmpredirects=enabled
add route prefix=0.0.0.0/0 interface="Local Area Connection" nexthop=192.168.7.12 metric=1 publish=Yes
add address name="Local Area Connection" address=192.168.7.34 mask=255.255.255.128
popd
# End of IPv4 configuration
IP地址为Address=192.168.7.34
,子网掩码为Mask=255.255.255.128
,DEAFULT网关为nexthop=192.168.7.12