Chinaunix

标题: 用命令控制网卡和IP [打印本页]

作者: 307793421    时间: 2007-03-16 00:53
标题: 用命令控制网卡和IP
启用/禁用网卡
netsh int set int 接口名称 admin = enable
要禁用把 enable 改为 disable 即可(暂时只有 Windows 2003 支持)
设置IP
netsh int ip set addr 接口名称 static IP mask gateway
添加IP
netsh int ip add addr 接口名称 static IP mask gateway
删除IP
netsh int ip del addr 接口名称 static IP mask gateway
更改DNS
netsh int ip set dns 接口名称 static DNS的IP
改为 IP 为 DHCP 分配
netsh int ip set addr 接口名称 dhcp
改为 DNS 为 DHCP 分配
netsh int ip set dns 接口名称 dhcp
备份IP到文件
netsh dump >myip.txt
从文件还原IP
netsh exec   myip.txt

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/33544/showart_259627.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2