案例一:配置IP地址并验证连通性

1.实验环境

主机 A和主机 B通过一根网线相连,如图6.13 所示

2.需求描述
为两台主机配置P地址,验证IP地址是否生效:验证同一网段的两台主机可以互通,不同网段的主机不能直接互通。3.推荐步骤
1.为两台主机配置IP地址,主机A为10.0.10.10,主机B为10.0.11.11:配置子网掩码均为 2、255.255.0.0。
2.通过 ipconfig 命令验证主机IP 是否生效。
3.通过 ping 命令验证两台主机是否互通。
4.将子网掩码都改为 255.255.255.0,并重复步骤2、步骤3
4.实验步骤   

主机B同上步骤设置IP地址和子网掩码。

4.2 使用config命令验证主机IP


C:\>ipconfig /all
 
FastEthernet0 Connection:(default port)
 
   Connection-specific DNS Suffix..: 
   Physical Address................: 0007.ECB8.3508
   Link-local IPv6 Address.........: FE80::207:ECFF:FEB8:3508
   IP Address......................: 10.0.10.10
   Subnet Mask.....................: 255.255.0.0
   Default Gateway.................: 0.0.0.0
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-D0-E7-2E-4C-00-07-EC-B8-35-08
 
Bluetooth Connection:
 
   Connection-specific DNS Suffix..: 
   Physical Address................: 0006.2A18.8A43
   Link-local IPv6 Address.........: ::
   IP Address......................: 0.0.0.0
   Subnet Mask.....................: 0.0.0.0
   Default Gateway.................: 0.0.0.0
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-D0-E7-2E-4C-00-07-EC-B8-35-08

4.3 使用ping命令验证是否相通

C:\>ping 10.0.11.11
 
Pinging 10.0.11.11 with 32 bytes of data:
 
Reply from 10.0.11.11: bytes=32 time=1ms TTL=128
Reply from 10.0.11.11: bytes=32 time<1ms TTL=128
Reply from 10.0.11.11: bytes=32 time<1ms TTL=128
Reply from 10.0.11.11: bytes=32 time<1ms TTL=128    //访问成功
 
Ping statistics for 10.0.11.11:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms4.
4.4更改子网掩码

主机B同上步骤更改子网掩码,并重复步骤2和步骤3。

4.4.1 使用config命令验证
 
  1. C:\>ipconfig /all
     
    FastEthernet0 Connection:(default port)
     
       Connection-specific DNS Suffix..: 
       Physical Address................: 0007.ECB8.3508
       Link-local IPv6 Address.........: FE80::207:ECFF:FEB8:3508
       IP Address......................: 10.0.10.10
       Subnet Mask.....................: 255.255.255.0
       Default Gateway.................: 0.0.0.0
       DNS Servers.....................: 0.0.0.0
       DHCP Servers....................: 0.0.0.0
       DHCPv6 Client DUID..............: 00-01-00-01-D0-E7-2E-4C-00-07-EC-B8-35-08
     
    Bluetooth Connection:
     
       Connection-specific DNS Suffix..: 
       Physical Address................: 0006.2A18.8A43
       Link-local IPv6 Address.........: ::
       IP Address......................: 0.0.0.0
       Subnet Mask.....................: 0.0.0.0
       Default Gateway.................: 0.0.0.0
       DNS Servers.....................: 0.0.0.0
       DHCP Servers....................: 0.0.0.0
       DHCPv6 Client DUID..............: 00-01-00-01-D0-E7-2E-4C-00-07-EC-B8-35-08
  2. 4.4.2 使用ping命令验证
    C:\>ping 10.0.11.11
     
    Pinging 10.0.11.11 with 32 bytes of data:
     
    Request timed out.   
    Request timed out.
    Request timed out.
    Request timed out.   //超时,无法访问
     
    Ping statistics for 10.0.11.11:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
    
  • 22
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值