China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 19:25
中国DOS联盟论坛 » 其它操作系统综合讨论区 » Repost: How to change the IP address at the command line View 2,432 Replies 5
Original Poster Posted 2002-11-18 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
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
Floor 2 Posted 2006-06-30 15:21 ·  中国 广东 深圳 天威有线宽带(关内)
初级用户
Credits 96
Posts 44
Joined 2006-06-26 17:52
20-year member
UID 57603
Gender Male
From 深圳
Status Offline
Just be straightforward, okay!
Floor 3 Posted 2006-08-08 07:09 ·  中国 浙江 湖州 电信
初级用户
★★
Credits 178
Posts 78
Joined 2005-08-09 17:09
20-year member
UID 41491
Gender Female
Status Offline
Excuse me, can the above be executed in the domain?
Floor 4 Posted 2006-09-22 21:31 ·  中国 辽宁 沈阳 电信数据中心
新手上路
Credits 4
Posts 2
Joined 2006-09-22 20:04
19-year member
UID 63386
Gender Male
Status Offline
Thanks for the hard work
Floor 5 Posted 2006-10-15 22:18 ·  中国 广东 深圳 福田区 电信
初级用户
★★
Credits 133
Posts 57
Joined 2006-03-15 23:12
20-year member
UID 52128
Status Offline
Still learning
Floor 6 Posted 2006-10-19 10:17 ·  中国 广东 惠州 惠城区 电信
初级用户
Credits 42
Posts 22
Joined 2006-10-19 05:35
19-year member
UID 66733
Gender Male
Status Offline
Study and learn..

Thank you for providing, the thread starter has worked hard啦
Forum Jump: