• 实验2.1.2 交换机的常用配置


    项目2 交换技术的位置

    活动2 交换机的常用配置

    一、具体要求:

    (1)添加1台计算机,将标签名更改为PC1。
    (2)添加1台S3700-26C-HI交换机,标签名为SWA,将交换机的名称设置为SWA。
    (3)PC1的Ethernet0/0/1接口连接SWA的Ethernet0/0/1接口。
    (4)按照实验拓扑图,使用直连线连接好计算机,并设置计算机的IP地址和子网掩码。
    (5)开启交换机和计算机。
    (6)恢复交换机的出厂设置
    (7)将交换机的名称设置为SWA。
    (8)将交换机的系统时间设置为2023年10月8日中午12时整,所在时区为东八区。
    (9)将交换机的语言模式设置为中文。
    (10)将交换机远程管理地址配置为192.168.1.254/24。
    (11)配置取消干扰信息、永不超时。
    (12)配置交换机的Console密码。
    (13)配合撤销交换机配置时弹出的信息。
    (14)配置交换机接口模式、接口带宽限制、接口双工模式。
    (15)保存交换机配置。

    二、实验拓扑:

    在这里插入图片描述

    三、任务实施

    1.交换机恢复出厂设置。

    <Huawei>reset saved-configuration 
    Warning: The action will delete the saved configuration in the device.
    The configuration will be erased to reconfigure. Continue? [Y/N]:y
    Warning: Now clearing the configuration in the device.
    Error: The config file does not exist.
    <Huawei>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    2.修改交换机的名称。

    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    [Huawei]sysname SWA
    [SWA]
    
    • 1
    • 2
    • 3
    • 4

    3.设置交换机的系统时间和所在时区。

    [SWA]quit
    <SWA>clock datetime 12:00:00 2023-10-07
    <SWA>clock timezone BJ add 08:00:00
    <SWA>display clock  //查看配置的系统时间和所在时区
    2023-10-08 04:00:23+08:00
    Sunday
    Time Zone(BJ) : UTC+08:00
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    4.设置语言模式。

    <SWA>language-mode Chinese 
    Change language mode, confirm? [Y/N] y
    Oct  8 2023 04:00:48+08:00 SWA %%01CMD/4/LAN_MODE(l)[53]:The user chose Y when d
    eciding whether to change the language mode.
    提示:改变语言模式成功。
    
    • 1
    • 2
    • 3
    • 4
    • 5

    5.配置交换机远程管理IP地址。

    [SWA]int vlanif 1
    [SWA-Vlanif1]ip add 192.168.1.254 24
    [SWA-Vlanif1]
    2023/10/8 04:01:21+08:00 SWA %%01IFNET/4/LINK_STATE(l)[54]:链路协议IP在接口Vlanif1上的状态变
    为UP。
    [SWA-Vlanif1]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    6.配置取消干扰信息、永不超时。
    干扰信息

    <SWA>undo terminal monitor
    提示:当前终端禁止所有类信息输出。
    
    • 1
    • 2

    永不超时

    [SWA]user-interface console 0
    [SWA-ui-console0]id	
    [SWA-ui-console0]idle-timeout 0
    [SWA-ui-console0]quit
    [SWA]
    
    • 1
    • 2
    • 3
    • 4
    • 5

    7.配置交换机的Console密码。
    (1)以登录用户界面的认证方式为密码认证,密码为123456.

    [SWA]user-interface console 0
    [SWA-ui-console0]authentication-mode password
    [SWA-ui-console0]set authentication password simple 123456
    [SWA-ui-console0]return
    <SWA>quit
    
    • 1
    • 2
    • 3
    • 4
    • 5

    对交换机的Console密码进行测试:

    <SWA>quit
    Please Press ENTER.
    Login authentication
    Password:
    <SWA>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    (2)以登录用户界面的认证方式为AAA认证,用户名为admin,密码为123456.

    [SWA]user-interface  console 0
    [SWA-ui-console0]authentication-mode aaa
    [SWA-ui-console0]quit
    [SWA]aaa
    [SWA-aaa]local-user admin password simple 123456
    [SWA-aaa]local-user admin service-type terminal 
    [SWA-aaa]return
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    对交换机的Console密码进行测试:

    <SWA>quit
    Please Press ENTER.
    Login authentication
    Username:admin
    Password:
    <SWA>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    8.撤销交换机配置时弹出的信息。

    [SWA]undo info-center enable 
    Info: Information center is disabled.
    
    • 1
    • 2

    9.配置交换机的接口模式。

    [SWA]interface Ethernet 0/0/1
    [SWA-Ethernet0/0/1]port link-type access 
    [SWA-Ethernet0/0/1]quit
    [SWA]int	
    [SWA]interface Ethernet 0/0/2
    [SWA-Ethernet0/0/2]port link-type trunk 
    [SWA-Ethernet0/0/2]quit
    [SWA]
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    10.配置接口带宽限制。

    [SWA]interface Ethernet 0/0/3
    [SWA-Ethernet0/0/3]undo negotiation auto 
    [SWA-Ethernet0/0/3]speed 100
    [SWA-Ethernet0/0/3]quit
    [SWA]
    
    • 1
    • 2
    • 3
    • 4
    • 5

    11.配置接口双工模式。

    [SWA]interface Ethernet 0/0/4
    [SWA-Ethernet0/0/4]undo negotiation auto 
    [SWA-Ethernet0/0/4]duplex full 
    [SWA-Ethernet0/0/4]return
    <SWA>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    12.管理MAC地址表。
    (1)通过PC1 ping SWA(确保连通)后查看交换机的MAC地址表
    在这里插入图片描述在这里插入图片描述

    [SWA]display mac-address
    MAC address table of slot 0:
    -------------------------------------------------------------------------------
    MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
                   VSI/SI                                              MAC-Tunnel  
    -------------------------------------------------------------------------------
    5489-985a-5be2 1           -      -      Eth0/0/1        dynamic   0/-         
    -------------------------------------------------------------------------------
    Total matching items on slot 0 displayed = 1 
    
    [SWA]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    (2)使用mac-address static命令在交换机中添加静态条目,并显示MAC地址表信息。

    [SWA]mac-address static 5489-98f6-585a ethernet 0/0/1 vlan 1
    [SWA]display mac-address
    MAC address table of slot 0:
    -------------------------------------------------------------------------------
    MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
                   VSI/SI                                              MAC-Tunnel  
    -------------------------------------------------------------------------------
    5489-98f6-585a 1           -      -      Eth0/0/1        static    -           
    -------------------------------------------------------------------------------
    Total matching items on slot 0 displayed = 1 
    
    MAC address table of slot 0:
    -------------------------------------------------------------------------------
    MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
                   VSI/SI                                              MAC-Tunnel  
    -------------------------------------------------------------------------------
    5489-985a-5be2 1           -      -      Eth0/0/1        dynamic   0/-         
    -------------------------------------------------------------------------------
    Total matching items on slot 0 displayed = 1 
    
    [SWA]
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    四、任务验收:

    (1)测试Console接口的密码配置是否正确。

    上述步骤所示
    
    • 1

    (2)使用display命令查看交换机的MAC地址表是否存在静态条目。

    上述步骤所示
    
    • 1

    (3)使用display current-configuration命令查看设备的当前配置。

    
    #
    sysname SWA
    #
    undo info-center enable
    #
    cluster enable
    ntdp enable
    ndp enable
    #
    drop illegal-mac alarm
    #
    diffserv domain default
    #
    drop-profile default
    #
    aaa 
     authentication-scheme default
     authorization-scheme default
     accounting-scheme default
     domain default 
     domain default_admin 
     local-user admin password simple 123456
     local-user admin service-type terminal
    #
    interface Vlanif1
     ip address 192.168.1.254 255.255.255.0 
    #
    interface MEth0/0/1
    #
    interface Ethernet0/0/1
     port link-type access
    #
    interface Ethernet0/0/2
     port link-type trunk
    #
    interface Ethernet0/0/3
     undo negotiation auto
    #
    interface Ethernet0/0/4
     undo negotiation auto
    #
    interface Ethernet0/0/5
    #
    interface Ethernet0/0/6
    #
    interface Ethernet0/0/7
    #
    interface Ethernet0/0/8
    #
    interface Ethernet0/0/9
    #
    interface Ethernet0/0/10
    #
    interface Ethernet0/0/11
    #
    interface Ethernet0/0/12
    #
    interface Ethernet0/0/13
    #
    interface Ethernet0/0/14
    #
    interface Ethernet0/0/15
    #
    interface Ethernet0/0/16
    #
    interface Ethernet0/0/17
    #
    interface Ethernet0/0/18
    #
    interface Ethernet0/0/19
    #
    interface Ethernet0/0/20
    #
    interface Ethernet0/0/21
    #
    interface Ethernet0/0/22
    #
    interface GigabitEthernet0/0/1
    #
    interface GigabitEthernet0/0/2
    #
    interface NULL0
    #
    mac-address static 5489-98f6-585a Ethernet0/0/1 vlan 1
    #
    user-interface con 0
     authentication-mode aaa
     set authentication password simple 123456
     idle-timeout 0 0
    user-interface vty 0 4
    #
    return 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93

    注:此为记录笔记,如有不足,还望海涵,可留言斧正

  • 相关阅读:
    使用 PyTorch 的计算机视觉简介 (6/6)
    Flink从Kafka写入mysql
    Vue进阶(幺叁幺):父子组件传值实现数据深拷贝_vue3拷贝父组件传来的值
    VirtualBox设置共享文件夹步骤及遇到的问题
    无线通信网络
    [每日两题系列]刷算法题咯~~
    uni——app、H5省市区选择
    20天深度复习JavaSE的详细笔记(十四)——不可变集合、Stream、异常
    ShardingSphere实现数据库读写分离,主从库分离,docker详细教程
    附录12-伪类选择器
  • 原文地址:https://blog.csdn.net/w1911026171/article/details/133743201