|
yiyesong
元老会员
        
积分 1987
发帖 632
注册 2002-10-27
状态 离线
|
『楼 主』:
转贴:如何在命令行下更改ip地址
使用 LLM 解释/回答一下
微软的Windows家族从Windows NT开始跨入了网络操作系统的市场,到现在的Windows 2000可以说网络功能在逐渐的完善,在这个成长过程中Windows融入了很多其他网络操作系统的功能,可以说是借鉴而来的,逐渐形成了一套功能完善的网络操作系统,这也是令SUN等各大公司所感觉到不服的原因,觉得不是微软完全自给研发的东西。不过Windows2000的功能确实是很强大的,它几乎可以象Unix和Linux一样在命令行下做很多的工作。
下面我们看一下Windows上一个可以在命令行下更改ip地址的命令,看过这个命令后大家可能会觉得这个命令很象Unix和Linux的命令,更象Cisco的路由器命令。下面是我在计算机上实际操作的回显,我会加上一些注释:
C:\>ipconfig (首先用ipconfig这个命令看一下更改之前的ip地址)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.250 (本地连接更改之前的ip)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
PPP adapter 拨号连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 211.149.128.147
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 211.149.128.147
C:\>netsh (然后执行netsh这个命令)
netsh>interface (netsh命令的子命令)
interface>ip (interface命令的子命令)
interface ip>set (interface ip命令的子命令)
下列指令有效:
此上下文中的命令:
set address - 设置指定的接口的 IP 地址或默认网关。
set dns - 设置 DNS 服务器模式和地址。
set wins - 设置 WINS 服务器模式和地址。
interface ip>set address "本地连接" static 192.168.0.2 255.255.255.0 192.168.0.1
1 (设置ip地址)
确定。
(注释:上面一段象不象Cisco的命令。)
interface ip>exit
C:\>ipconfig (更改后再用ipconfig命令看一下ip地址,确认一下是否更改成功)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.2 (更改后的ip说明成功了)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
PPP adapter 拨号连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 211.149.128.147
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 211.149.128.147
C:\>
netsh这个命令还有好多强大的功能 如下:
C:\>netsh
netsh>?
下列指令有效:
此上下文中的命令:
.. - 移到上一层上下文级。
? - 显示命令列表。
aaaa - 更改到 `aaaa' 上下文。
abort - 丢弃在脱机模式下所做的更改。
add - 将一个配置项添加到项目列表中。
alias - 添加一个别名
bye - 退出程序。
commit - 提交在脱机模式中所做的更改。
delete - 在项目列表上删除一个配置项目。
dhcp - 更改到 `dhcp' 上下文。
dump - 显示一个配置脚本。
exec - 运行一个脚本文件。
exit - 退出程序。
help - 显示命令列表。
interface - 更改到 `interface' 上下文。
offline - 将当前模式设置成脱机。
online - 将当前模式设置成联机。
popd - 从堆栈上打开一个上下文。
pushd - 将当前上下文放推入堆栈。
quit - 退出程序。
ras - 更改到 `ras' 上下文。
routing - 更改到 `routing' 上下文。
set - 更新配置设置。
show - 显示信息
unalias - 删除一个别名。
wins - 更改到 `wins' 上下文。
下列的子上下文可用:
routing interface ras dhcp wins aaaa
若需要命令的更多帮助信息,请键入命令,
后面跟 ?。
每一个子命令下面还有很多子命令。这里就不一一介绍了因为实在是功能太多了,大家可以自己研究一下。
Microsoft's Windows family entered the market of network operating systems starting from Windows NT. Up to Windows 2000 now, it can be said that the network functions are gradually improving. In this growth process, Windows has incorporated many functions of other network operating systems, which can be said to be borrowed, and has gradually formed a complete set of network operating systems. This is also the reason why major companies such as SUN feel dissatisfied, thinking that it is not something completely independently developed by Microsoft. However, the functions of Windows 2000 are indeed very powerful. It can almost do many things at the command line like Unix and Linux.
Now let's take a look at a command on Windows that can change the IP address at the command line. After seeing this command, everyone may feel that this command is very similar to the commands of Unix and Linux, and more like the commands of Cisco routers. The following is the echo of my actual operation on the computer, and I will add some comments:
C:\>ipconfig (First use the ipconfig command to see the IP address before the change)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.250 (IP before change of local connection)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
PPP adapter 拨号连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 211.149.128.147
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 211.149.128.147
C:\>netsh (Then execute the netsh command)
netsh>interface (Subcommand of netsh command)
interface>ip (Subcommand of interface command)
interface ip>set (Subcommand of interface ip command)
The following commands are valid:
Commands in this context:
set address - Set the IP address or default gateway of the specified interface.
set dns - Set DNS server mode and address.
set wins - Set WINS server mode and address.
interface ip>set address "本地连接" static 192.168.0.2 255.255.255.0 192.168.0.1 1 (Set IP address)
Ok.
(Comment: Does the above paragraph look like the command of Cisco.)
interface ip>exit
C:\>ipconfig (Use the ipconfig command again after the change to see the IP address and confirm whether the change is successful)
Windows 2000 IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.2 (IP after change indicates success)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
PPP adapter 拨号连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 211.149.128.147
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 211.149.128.147
C:\>
The netsh command also has many powerful functions as follows:
C:\>netsh
netsh>?
The following commands are valid:
Commands in this context:
.. - Move to the upper-level context level.
? - Display command list.
aaaa - Change to `aaaa' context.
abort - Discard changes made in offline mode.
add - Add a configuration item to the item list.
alias - Add an alias
bye - Exit the program.
commit - Commit changes made in offline mode.
delete - Delete a configuration item on the item list.
dhcp - Change to `dhcp' context.
dump - Display a configuration script.
exec - Run a script file.
exit - Exit the program.
help - Display command list.
interface - Change to `interface' context.
offline - Set the current mode to offline.
online - Set the current mode to online.
popd - Open a context from the stack.
pushd - Push the current context into the stack.
quit - Exit the program.
ras - Change to `ras' context.
routing - Change to `routing' context.
set - Update configuration settings.
show - Display information
unalias - Delete an alias.
wins - Change to `wins' context.
The following sub-contexts are available:
routing interface ras dhcp wins aaaa
For more help information about a command, type the command followed by ?.
There are many sub-commands under each sub-command. I won't introduce them one by one here because there are really too many functions. Everyone can study it by themselves.
|

http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
|
|
2002-11-18 00:00 |
|
|
xiongwei2624
初级用户
 
积分 96
发帖 44
注册 2006-6-26 来自 深圳
状态 离线
|
|
2006-6-30 15:21 |
|
|
shj99422
初级用户
 
积分 178
发帖 78
注册 2005-8-9
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
请问楼主以上能不能在域里面可以执行吗
Excuse me, can the above be executed in the domain?
|
|
2006-8-8 07:09 |
|
|
sywpch
新手上路

积分 4
发帖 2
注册 2006-9-22
状态 离线
|
|
2006-9-22 21:31 |
|
|
kingchain
初级用户
 
积分 133
发帖 57
注册 2006-3-15
状态 离线
|
|
2006-10-15 22:18 |
|
|
nxcgh2006
初级用户
 
积分 42
发帖 22
注册 2006-10-19
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
學習學習..
謝謝 提供 樓主幸苦啦
Study and learn..
Thank you for providing, the thread starter has worked hard啦
|
|
2006-10-19 10:17 |
|