命令行修改网络设置ip地址、dns、网关的方法(windows)

本文介绍了一个实用技巧,通过创建批处理文件来快速更改笔记本电脑的网络设置,包括IP地址、子网掩码、默认网关及DNS服务器,适用于频繁更换工作环境的用户。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这个技巧在常使用笔记本出差的朋友是非常有用的,比如到了另外一个环境,如客户的公司等,总需要修改网络设置成别人的内网地址、网关、dns等,写个批处理文件,到时候改一下后一执行便可以了,比鼠标操作来的快吧。

Form:http://blog.youkuaiyun.com/zmxj
修改ip,子网掩码,网关,dns。“网络连接名”是你机器上网络属性里看到的连接名,把下面改成自己的连接名。
netsh interface ip set address "网络连接名" static192.168.0.88 255.255.255.0192.168.0.1 1
netsh interface ip set dns "网络连接名" static 202.216.224.66
netsh interface ip add dns "网络连接名" 202.216.224.67

如果要改成动态分配ip和自动获得dns使用下面命令。
netsh interface ip set address "网络连接名" dhcp
netsh interface ip set dns "网络连接名" dhcp

<!-- Begin: AdBrite --><style type="text/css"> .adHeadline {font: bold 10pt Arial; text-decoration: underline; color: #0000FF;} .adText {font: normal 10pt Arial; text-decoration: none; color: #000000;}</style> <!-- End: AdBrite -->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值