正在加载...
 
< foxmail让俺虚...
使WindowsXP... >
dos下配置IP地址 
 标签:妙计锦囊 | 浏览数(2002) | 评论数(3) | 2007-01-05

Windows的广泛应用得益于它的可视窗口,但是今天“窗口”给我制造了麻烦,不知道中了什么招,我的网络连接的属性页死活打不开了,想要修改IP地址简直是“没门”,另外,对于WinXP来说,有时候通过网络连接属性页来修改IP,还时不时的提示重起系统生效,真是麻烦,难道打不开属性页就一定要重装系统?XP修改IP一定要重启系统?呵呵,不是第,在Windows的dos窗口中同样提供了丰富的命令,可以完成各种配置操作,我们来看看dos下配置IP地址的过程吧:

1、首先查看一下修改以前的网卡配置信息如下

C:\>ipconfig -all

Windows IP Configuration

Ethernet adapter 本地连接:

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Mobile Connection
        Physical Address. . . . . . . . . : 00-11-25-47-42-11
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.6.168
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.6.5
        DNS Servers . . . . . . . . . . . : 202.106.0.20

2、进入配置状态                                                    //有点类似Cisco的操作哦

C:\>netsh
netsh>interface
netsh interface>ip
netsh interface ip>

3、配置命令

1)set address

2)命令用法

用法: 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

3)应用实例

netsh interface ip>set address "本地连接" static 192.168.6.200 255.255.255.0 192.168.6.5 1
确定。                                                                          //至此 配置完毕

netsh interface ip>exit                                                  //退出

c:\>

4、看看配置后的结果

C:\>ipconfig -all

Windows IP Configuration

Ethernet adapter 本地连接 :

        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Mobile Connection
        Physical Address. . . . . . . . . : 00-11-25-47-42-11
        Dhcp Enabled. . . . . . . . . . . : No
        IP Address. . . . . . . . . . . . : 192.168.6.200
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.6.5
        DNS Servers . . . . . . . . . . . : 202.106.0.20

//哈哈,不错不错,IP从168变成200了,不过提醒一下,这些命令只是在Win2000以上的版本中有效

http://www.i170.com/Article/53962/trackback

评论:

  badboyandgirl  2007-01-06 评论  

ddddddd

  123  2007-04-27 评论  

**匿名评论只有文章作者可以阅读**

  hasang  2007-08-22 评论  

有一点你没介绍呢,这个操作需要启动“Remote Registry”服务,否则是不行的。

    发表评论: