ITeye博客

自动快速设置IP

ileson · 2011-05-24 11:24 · OS · 操作系统 · Markdown

由于机器常常 要切换网络,频繁的改IP 非常麻烦。利用windows 的netsh 命令可以快速设置IP!!! 1、IP、子网掩码、网关 设置IP为自动获取:

netsh interface ip set address "本地连接" dhcp

设置IP及子网掩码:

netsh interface ip set address "本地连接" source=static addr=192.168.2.66 mask=255.255.255.0

设置网关:

netsh interface ip set address "本地连接" gateway=192.168.2.1 gwmetric=0

2、dns 设置自动获取dns

netsh interface ip set dns name="本地连接" source=dhcp

设置主DNS:

netsh interface ip set dns "本地连接" source=static addr=221.207.58.58 register=PRIMARY

设置备用DNS:

netsh interface ip add dns "本地连接" addr=202.116.128.2 index=2

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。