首页 > 其他分享 >【计网实验】三层交换机的配置

【计网实验】三层交换机的配置

时间:2024-02-07 18:11:50浏览次数:31  
标签:0ms 32 Fa0 bytes 192.168 计网 Switch 交换机 三层

三层交换机的配置

实验环境

  • 仿真平台:Cisco Packet Tracer 6.1
  • 终端系统:Linux Ubuntu Mate 20.04
  • 交换机:3560-24PS

实验1:通过 vlan ip 做网关,实现不同 vlan 间的路由

网络拓扑

网络配置

  • PC1:192.168.1.1/24,网关192.168.1.2
  • PC2:192.168.2.1/24,网关192.168.2.2

实验步骤

1.配置交换机

Switch>en
Switch#vlan data
Switch(vlan)#vlan 2
VLAN 2 added:
    Name: VLAN0002
Switch(vlan)#vlan 3
VLAN 3 added:
    Name: VLAN0003
Switch(vlan)#exit

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit

Switch(config)#int vlan 2
Switch(config-if)#ip address 192.168.1.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#int vlan 3
Switch(config-if)#ip address 192.168.2.2 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#ip routing
Switch(config)#end

2.检查配置

VLAN配置:

Switch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24, Gig0/1, Gig0/2
2    VLAN0002                         active    Fa0/1
3    VLAN0003                         active    Fa0/2
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
3    enet  100003     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0   
1003 tr    101003     1500  -      -      -        -    -        0      0   
1004 fdnet 101004     1500  -      -      -        ieee -        0      0   
1005 trnet 101005     1500  -      -      -        ibm  -        0      0   

Remote SPAN VLANs
------------------------------------------------------------------------------


Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

路由配置:

Switch#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, Vlan2
C    192.168.2.0/24 is directly connected, Vlan3

通信测试

使用PC1来Ping PC2:

PC>ipconfig

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::201:96FF:FEB5:9EBD
   IP Address......................: 192.168.1.1
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.1.2

PC>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=5ms TTL=128
Reply from 192.168.1.1: bytes=32 time=0ms TTL=128
Reply from 192.168.1.1: bytes=32 time=1ms TTL=128
Reply from 192.168.1.1: bytes=32 time=2ms TTL=128

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 5ms, Average = 2ms

PC>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time=0ms TTL=255
Reply from 192.168.1.2: bytes=32 time=0ms TTL=255
Reply from 192.168.1.2: bytes=32 time=0ms TTL=255
Reply from 192.168.1.2: bytes=32 time=0ms TTL=255

Ping statistics for 192.168.1.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

PC>ping 192.168.2.2

Pinging 192.168.2.2 with 32 bytes of data:

Reply from 192.168.2.2: bytes=32 time=1ms TTL=255
Reply from 192.168.2.2: bytes=32 time=0ms TTL=255
Reply from 192.168.2.2: bytes=32 time=0ms TTL=255
Reply from 192.168.2.2: bytes=32 time=0ms TTL=255

Ping statistics for 192.168.2.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC>ping 192.168.2.1

Pinging 192.168.2.1 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time=1ms TTL=127
Reply from 192.168.2.1: bytes=32 time=0ms TTL=127
Reply from 192.168.2.1: bytes=32 time=0ms TTL=127
Reply from 192.168.2.1: bytes=32 time=0ms TTL=127

Ping statistics for 192.168.2.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

标签:0ms,32,Fa0,bytes,192.168,计网,Switch,交换机,三层
From: https://www.cnblogs.com/yangxuanzhi/p/18011121

相关文章

  • 【Cisco Packet Tracer】集线器和交换机区别
    ......
  • 华为交换机查看环路
    dismac-addressflappingrecord 光口查看对端连接设备dislldpneighborinterfaceGigabitEthernet1/5/1/1......
  • 【计网实验】基于EVE-NG进行VLAN划分实践
    基于EVE-NG进行VLAN划分实践实验说明本实验中,我们将实现OpenWrt官网上如图所示的拓扑:你有一台OpenWrt路由器,有3个端口;还有一台交换机,有5个端口;这里为了方便起见,我们把Wifi变成直连一台计算机的局域网LAN5。实现LAN1...5中计算机通过WAN口上网,并且WAN口与LAN1...4接在交换机上......
  • H3C 交换机端口安全实验
    H3C交换机端口安全实验实验拓扑​​实验需求按照图示配置IP地址在SW1所有连接PC的接口上配置开启802.1X验证,使接入的终端需要进行身份验证创建一个用户身份验证的用户。用户名为wangdaye​,密码为123456​创建一个端口隔离组,实现三台PC无法互相访问实验步骤PC配置IP(略)......
  • H3C 三层交换实验
    H3C三层交换实验实验拓扑​​实验需求按照图示为PC1和PC2配置IP地址和网关PC1属于Vlan10,PC2属于Vlan20,在三层交换机上配置Vlanif三层接口实现Vlan10和Vlan20三层互通PC1和PC2可以互通实验步骤PC配置IP地址(略)SW1配置创建VLAN10和VLAN20#vlan10......
  • Arct房屋设计网的设计与实现代码
      <headerid="sticky-header">  <divclass="cc-header-area">  <divclass="container-fluid">   <divclass="row">   <divclass="main-wrapper">    <navclass=&q......
  • h3c交换机配置登录口令强度要求、更换要求
    H3C交换机的具体命令可能会根据不同的设备型号和软件版本有所不同。以下是一些通用的命令示例,你可以根据你的具体情况进行调整:1.登录口令强度要求:设置最小密码长度:[Switch]aaa[Switch-aaa]local-useruser1password-min-length8设置密码复杂性:[Switch]aaa[Switch-aaa]loc......
  • 交换机ARP学习异常,看网工大佬是如何处理的?
    晚上好,我的网工朋友。在复杂多变的网络环境中,网工就没有不遇到问题的,习惯了,兵来将挡水来土掩。那ARP异常你遇到过吗?ARP作为网络中的基础协议之一,它的稳定性对整个网络的性能和可靠性至关重要。比如说,交换机上遇到了大量的不完整ARP表项导致用户终端的ARP缓存不稳定,这个情况,怎么自查......
  • 不同品牌交换机mac地址与ip地址绑定命令
    华为交换机:使用user-bindstatic命令可以在全局或接口模式下配置ip地址、mac地址和接口的绑定。例如,如果要将192.168.1.100的ip地址和00e0-fc00-0001的mac地址绑定到GigabitEthernet0/0/1接口上,可以使用以下命令:[Switch]user-bindstaticip-address192.168.1.100mac-addres......
  • ssh远程管理实现从交换机登录交换机
    ssh分为两个版本,使用命令行对虚拟机进行设置操作的时候需要注意对ssh版本的支持问题。ssh使用非对称加密方法————设置公钥私钥。对于收发消息双方,只需一方生成公钥私钥,将其中一个发送给对端,对端使用收到的密钥处理数据,另一种数据用于本端处理数据。举例如下:A发数据给B:A生成......