发布网友 发布时间:2022-04-21 12:47
共5个回答
热心网友 时间:2022-05-18 23:57
命令行下用netsh命令更改IP的步骤是:
1。在运行栏里输入cmd打开命令提示符
2。输入netsh 回车
3。输入int ip 回车
4。输入set address name="本地连接" source="static" addr=ip mask=255.255.255.0 Gateway 1
解释一下:
set address 是更改IP的命令
name = 你要更改IP的连接名称
source = 设置成静态的IP
addr = 要更改成的IP
mask=子网掩码
gateway是你的网关IP,后面的1是到达网关的跃点数
等待几秒钟会出现一个”确定“的信息,表示你的IP已经更改成功了,不信用ipconfig /all检验一下。
知道了命令的用户我们就可以把它写成批处理如下:
@ echo off
echo This Programe will change your Ipaddress and Gateway.
echo Press any key to continue
pause >nul
rem 设置变量
set Nic=本地连接
rem //可以根据你的需要更改,
set Add=202.96.134.9
rem //可以根据你的需要更改
set Gat=202.96.134.60
netsh interface ip set address name=%Nic% source=static addr=%add% mask=255.255.255.0 %Gat% 1
rem //顺便把DNS也改掉
netsh interface ip set dns name=%Nic% source=static addr=%add% primary
echo OK!
注:把上面代码复制到空白的记事本里,把“Nic=、Add= Gat=”更改成你自己的值然后另存为*.bat即可
热心网友 时间:2022-05-18 23:58
开始-运行-CMD进入半DOS下
输入 NETSH
出现netsh>后在后面输入int
netsh>int
netsh interface>ip
netsh interface ip>set address "本地连接" DHCP
这个就是把名字叫本地连接这块网卡的模式调成DHCP动态获得IP
netsh interface ip >set address "本地连接" stat 192.168.1.88 255.255.255.0
这个就是把名字叫本地连接这块网卡的IP地址设成192.168.1.88 掩码是255.255.255.0
用法: set address [name=]<string>
[[source=]dhcp |
[source=] static [addr=]IP address [mask=]IP subnet mask]
[[gateway=]<IP address>|none [gwmetric=]integer]
参数:
标记 值
name - 接口名称。
source - 下列值之一:
dhcp: 对于指定接口,设置用 DHCP 配置 IP
地址。
static: 设置使用本地静态配置设置 IP
地址。
gateway - 下列值之一:
<IP address>: 您设置的 IP 地址的指定默认
网关。
none: 不设置默认网关。
gwmetric - 默认网关的跃点数。如果网关设置为 'none',则
不应设置此字段。
只有在 'source' 为 'static' 时才设置下列选项:
addr - 指定接口的 IP 地址。
mask - 指定 IP 地址的子网掩码。
注释 : 用来将 IP 地址配置模式从 DHCP 模式改为 static,或从 static
模式改为 DHCP。用静态 IP 地址在接口上添加 IP 地址,或添加
默认网关。
示例 :
set address name="Local Area Connection" source=dhcp
set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1
热心网友 时间:2022-05-18 23:58
更改ip地址的方法,
C:\>ipconfig (首先用ipconfig这个命令看一下更改之前的ip地址)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.1.1.94 (本地连接更改之前的ip)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.1.1.254
C:\>netsh (进入设置模式)
netsh>interface
interface>ip
interface ip>set address "本地连接" static 10.1.1.111 255.255.255.0 10.1.1.254
interface ip>exit
上文中的set命令具体解释如下:
set address - 设置指定的接口的 IP 地址和默认网关。
set dns - 设置 DNS 服务器模式和地址。
set wins - 设置 WINS 服务器模式和地址。
C:\>ipconfig (更改后再用ipconfig命令看一下,确认一下是否更改成功)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.1.1.111
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.1.1.254
热心网友 时间:2022-05-18 23:59
@echo off
::设置本地连接名称
set NET=本地连接
::设置IP
set IP=192.168.0.2
::设置子网掩码
set MASK=255.255.255.0
::设置网关
set GATE=192.168.0.1
::设置主DNS
set DNS1=218.85.152.99
::设置副DNS,如果没有请留空
set DNS2=218.85.157.99
::开始修改
echo.&echo 正在设置IP %IP%,请稍候...
netsh interface ip set address name="%NET%" static %IP% %MASK% %GATE% 1 >nul
echo.&echo 正在设置主DNS %DNS1%,请稍候...
netsh interface ip set dns name="%NET%" static %DNS1% >nul
if defined DNS2 (
echo.&echo 正在设置副DNS %DNS2%,请稍候...
netsh interface ip add dns name="%NET%" %DNS2% 2 >nul
)
exit
热心网友 时间:2022-05-18 23:59
修改ip,子网掩码,网关,dns。“网络连接名”是你机器上网络属性里看到的连接名,把下面改成自己的连接名。
netsh interface ip set address "网络连接名" static 192.168.0.88 255.255.255.0 192.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