网络设备配置与管理(华为)基础系列 20190321

一、交换机初始配置:端口组

[Huawei] port-group group-member        //临时端口组

[Huawei] port-group groupname           //永久端口组

值得注意的是,永久端口组中加入端口前要加上group-member指令;加入端口的方式有两种:第一种是e0/0/01 e0/0/4这样的,单个单个输入的;还有一种是像e0/0/5 to e0/0/10这样的,采用to连续输入的。

小提醒:端口组的功能不同,建议设置不同的端口组(例如port-group lilywhite只是作用于g0/0/1和g0/0/2口;port-group guiltykiss只是作用于e0/0/1 to e0/0/22口)。

二、MAC地址表

MAC地址表具有自我学习和老化的功能,同时我们也可以对MAC地址表进行相关的管理。

[Huawei] mac-address aging-time <0,10-1000000>

//设置老化时间(0为永不老化,下限到10秒,上限到100W秒)

例:[Huawei] mac-address aging-time 60

[Huawei] mac-address atatic MAC地址 应用接口 应用vlan

例:[lilywhite] mac-address static 5489-9872-6ce0 e0/0/10 vlan 1

//设置静态MAC地址

Tips:设置上静态的MAC地址表后,对于静态的MAC地址,不存在老化;同时,如果交换机内还有动态MAC地址存在,那就存在两张MAC地址表,且遵循先静态后动态的原则进行ARP解析操作。

一般情况下,交换机的一个接口可以学习到8K个MAC地址(8*1024),如果MAC地址表全部学习满了,则出现泛洪的现象,易造成MAC洪水攻击。

三、交换机的接口配置:

实例:配置交换机SW1和SW2的管理IP地址及物理接口。(使用VLAN66作为管理VLAN)

步骤:1.配置SW1和SW2的管理IP地址

        [SW1/SW2] interface vlanif 66

        [SW1/SW2-Vlanif66] ip address IP地址 子网掩码

     

2.配置SW1中Etherent0/0/1接口为access接口,并将该接口划分到管理VLAN66中。

        [SW1] interface e0/0/1

        [SW1-Ethernet0/0/1] port link-type access

        [SW1-Ethernet0/0/1] port default vlan 66

   

3.配置SW1中Etherent0/0/2和SW2中Etherent0/0/2接口为中继接口,并使中继链路上允许VLAN66的数据通过。

        [SW1/SW2] interface e0/0/2

        [SW1/SW2-Ethernet0/0/2] port link-type trunk

        [SW1/SW2-Ethernet0/0/2] port trunk allow-pass vlan 66

四、小复习:交换机的用户配置

实例:配置交换机SW1的Console口和管理员远程登录参数。

步骤:1.配置Console口,认证模式为密码认证,用户权限为15,设置历史命令缓冲区存放150条历史命令,设置用户连接的超时时间为1分钟30秒。(其中密码以加密方式保存。密码设置为huawei)

        [SW1] user-interface console 0

        [SW1-ui-console0] authentication-mode password

        [SW1-ui-console0] set authentication password cipher huawei

        [SW1-ui-console0] user privilege level 15

        [SW1-ui-console0] history-command max-size 150

        [SW1-ui-console0] idle-timeout 1 30

         

2.配置远程登录(VTY0-4)。认证模式为AAA认证,用户名为test,用户权限为2,该用户能通过Telnet远程登录。(其中密码以加密方式保存。密码设置为huawei)

        [SW1] user-interface vty 0 4

        [SW2-ui-vty0-4] authentication-mode aaa

        [SW2-ui-vty0-4] quit

        [SW1] aaa

        [SW1-aaa] local-user test password cipher huawei

        [SW1-aaa] local-user test privilege level 2

        [SW1-aaa] local-user test service-type telnet

原文地址:https://www.cnblogs.com/lilywhite/p/10574865.html