通常我们都是在图形界面的向导里修改添加网络IP地址,在命令行里也可以做到这些事情,有的时候还是有实用价值的。看看这些过程吧,相信你能看明白:
方 法 一:
C:\\>ipconfig
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.0.127.235
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.127.1
C:\\>netsh
netsh>i
interface>i
interface ip>sh a
接口 \"本地连接\" 的配置
DHCP 启用 否
IP 地址 10.0.127.235
子网掩码 255.255.255.0
默认网关: 10.0.127.1
GatewayMetric: 1
InterfaceMetric 1
interface ip>set a \"本地连接\" static 192.168.16.44 255.255.255.0 192.168.16.5 1
确定。
interface ip>sh a
接口 \"本地连接\" 的配置
DHCP 启用 否
IP 地址 192.168.16.44
子网掩码 255.255.255.0
默认网关: 192.168.16.5
GatewayMetric: 1
InterfaceMetric 1
interface ip>exit
C:\\>ipconfig
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.16.44
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.16.5
方 法 二:
netsh interface ip set address \"本地连接\" static 192.168.0.2 255.255.255.0 192.168.0.1 1
回车待出现\"确定\"2字就完成了IP的改变。
其中:
192.168.0.2 是你本机的IP
255.255.255.0 是子掩网码
192.168.0.1 是网关
1 是确定
方 法 三:
netsh -c interface dump>c:\\ip.txt //把本机网络配置导出到C盘下的 ip.txt 文件中
netsh -f c:\\ip.txt //修改后再导入回本机
因篇幅问题不能全部显示,请点此查看更多更全内容