如何在命令提示符下设置IP地址,子网掩码,网关

来源:百度知道 编辑:UC知道 时间:2024/05/22 06:37:26

命令行下:
netsh
interface
ip
add
用?号来显示在线帮助,很详细哦!多看看吧

netsh int ip set address "本地连接" source=dhcp 本地连接设置ip为dhcp
netsh int ip set address "本地连接" static 192.168.0.12 255.255.255.0 本地连接设置IP地址
netsh int ip set dns "本地连接" source=dhcp 本地连接设置dns为dhcp
netsh int ip set dns "本地连接" static 202.123.123.123 202.123.123.123.233 1 本地连接设置dns地址

首先进入NETSH接口下面
C>netsh
netsh>interface
netsh interface>ip
netsh interface ip>?
下列指令有效:

命令从 netsh 上下文继承:
.. - 移到上一层上下文级。
abort - 丢弃在脱机模式下所做的更改。
add - 在项目列表上添加一个配置项目。
alias - 添加一个别名
bridge - 更改到 `netsh bridge' 上下文。
bye - 退出程序。
commit - 提交在脱机模式中所做的更改。
delete - 在项目列表上删除一个配置项目。
diag - 更改到 `netsh diag' 上下文。
exit - 退出程序。
firewall - 更改到 `netsh firewall' 上下文。