配置交换机管理IP

3.1 问题

配置交换机管理IP为192.168.1.1 ,默认网关为192.168.1.100

3.2 方案

网络拓扑图如图-3

图-3

3.3 步骤

实现此案例需要按照如下步骤进行

步骤一:配置交换机接口模式

1)配置路由器R1的接口IP作为192.168.1.0网段的网关地址

  1. Router>enable
  2. Router#configure terminal
  3. Router(config)#interface fastEthernet 0/0
  4. Router(config-if)#ip address 192.168.1.100
  5. Router(config-if)#ip address 192.168.1.100 255.255.255.0
  6. Router(config-if)#no shutdown

2)配置交换机管理IP和网关地址

 
   
  1. Switch(config)#interface vlan 1
  2. Switch(config-if)#ip address 192.168.1.1 255.255.255.0
  3. Switch(config-if)#no shutdown
  4. Switch(config-if)#exit
  5. Switch(config)#ip default-gateway 192.168.1.100

3)用ping命令进行测试

 
  
  1. PC>ipconfig
  2. FastEthernet0 Connection:(default port)
  3. Link-local IPv6 Address.........: FE80::200:CFF:FEE4:90B0
  4. IP Address......................: 192.168.1.2
  5. Subnet Mask.....................: 255.255.255.0
  6. Default Gateway.................: 192.168.1.100
  7. PC>ping 192.168.1.1
  8. Pinging 192.168.1.1 with 32 bytes of data:
  9. Request timed out.
  10. Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
  11. Reply from 192.168.1.1: bytes=32 time=3ms TTL=255
  12. Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
  13. Ping statistics for 192.168.1.1:
  14. Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
  15. Approximate round trip times in milli-seconds:
  16. Minimum = 0ms, Maximum = 3ms, Average = 1ms
  17. PC>ping 192.168.1.100
  18. Pinging 192.168.1.100 with 32 bytes of data:
  19. Reply from 192.168.1.100: bytes=32 time=50ms TTL=255
  20. Reply from 192.168.1.100: bytes=32 time=0ms TTL=255
  21. Reply from 192.168.1.100: bytes=32 time=0ms TTL=255
  22. Reply from 192.168.1.100: bytes=32 time=0ms TTL=255
  23. Ping statistics for 192.168.1.100:
  24. Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
  25. Approximate round trip times in milli-seconds:
  26. Minimum = 0ms, Maximum = 50ms, Average = 12ms
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐