第1个回答 2010-07-16
开始-运行-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
第2个回答 2007-11-06
更改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
第3个回答 2010-10-23
@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
第4个回答 2008-08-20
修改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