交换机配置(实验篇)

    技术2025-03-21  10

    此主题相关图片如上:

    [Switch-2]stp enable (开启生成树协议)

    [Switch-2]stp disable (关闭生成树协议)

    [Switch-2]display stp (察看生成树工作状态)

    [Switch-2]display stp interface e 0/1 (也可以查看到具体端口,如1口的状态)

    验证方法:(1)在未启用生成树(也可以关闭生成树)情况下,环路会出现,广播风暴会导致两台PC无法继续通讯,端口指示灯也会疯狂闪 烁。(2)开启后,环路消失!(3)此时我们应当查看生成树端口状态,从而判断主链路和备份链路。(4)手动断开主链路,查看通讯状态,会发现备份链路切 换到工作状态!

    ————————————————————————

    VLAN实验参考:

    单台交换机VLAN 划分参考

    此主题相关图片如下:

    VLAN实验参考:

    跨交换机 VLAN 划分参考

    此主题相关图片如下:

    以上两个VLAN实验 同VLAN下的PC可以互访 不同VLAN不可互访

    ————————————————————————

    华为2403h的 端口聚合配置笔记 19:53 2006-3-18

    此主题相关图片如下:

    [Switch-1]interface Ethernet 0/7 [Switch-1-Ethernet0/7]duplex full (设置此端口为手动全双工以便于作聚合,2403的限制,其它设备一般不必要此步骤) [Switch-1-Ethernet0/7]speed 100 (设置此端口为手动百兆速率以便于作聚合,2403的限制,其它设备一般不必要此步骤) [Switch-1-Ethernet0/8]quit

    [Switch-1]interface Ethernet 0/8 [Switch-1-Ethernet0/8]duplex full (设置此端口为手动全双工以便于作聚合,2403的限制,其它设备一般不必要此步骤) [Switch-1-Ethernet0/8]speed 100 (设置此端口为手动百兆速率以便于作聚合,2403的限制,其它设备一般不必要此步骤) [Switch-1-Ethernet0/8]quit

    [Switch-1]link-aggregation Ethernet 0/7 to Ethernet 0/8 both (设置7到8口为聚合,后面的both为 负荷分担方式为入/出分担)

    [Switch-1]display link-aggregation (察看聚合配置)

    验证方法:关闭两台交换机的生成树,按拓扑会有风暴产生,两边的PC就无法通讯了。但是如果成功绑定了线路,多条链路即已成为“一条”链路,自然通讯可以恢复正常。

    ————————————————————————

    华为2403h的 端口配置笔记

    [Quidway-Ethernet0/24]interface ethernet 0/24 [Quidway-Ethernet0/24]shutdown (关闭此端口) [Quidway-Ethernet0/24]undo shutdown (开启此端口)

    (设置全双工、速度等参看上一个实验)

    ————————————————————————

    华为2403h的 端口和MAC地址绑定(某地址只能使用某端口)配置笔记 20:09 2006-3-18

    此主题相关图片如下:

    [Switch-1]mac-address static 00c0-26a3-c4e9 interface Ethernet 0/24 (静态写入MAC地址和端口的对应关系,此关系预先应该不存在,例如可先拔出此端口的线缆)

    [Switch-1]display mac-address (察看本机MAC地址表,此时会发现24口MAC地址关系为静态配置)

    验证方法:比如原来未做绑定之时,此MAC地址所在PC连接到交换机任何一个端口都可跟其它PC通讯,绑定之后,只能在24口才可以通讯,连接到其它端口就无法通过交换机与其它PC通讯。

    ————————————————————————

    2403 的流量控制功能:

    [Switch-1-Ethernet0/24]flow-control (打开此端口的流控功能) [Switch-1-Ethernet0/24]undo flow-control (关闭)

    2403 的流量控制功能:

    [Switch-1]port mirror Ethernet 0/24 observing-port Ethernet 0/23 (设置端口镜像,或者叫监控端口)

    ————————————————————————

    2403 的telnet配置途径:

    [Switch-1]interface vlan 1 (进入VLAN 1,因为VLAN 1是初始VLAN,包括交换机所有端口,代表整个交换机)

    [Switch-1-Vlan-interface1]ip address 192.168.1.181 255.255.255.0 (配置IP地址)

    [Switch-1]user-interface vty 0 4 (进入虚拟终端(本机被telnet的接口) 0 到 4)

    [Switch-1-ui-vty0-4]set authentication password simple 911 (设置telnet时的验证密码为911, simple为存储时明文)

    [Switch-1]super password cipher 911 (为了安全设置超级用户密码 cipher为加密 911为密码)

    ————————————

    以下为PC机上的操作:

    telnet 192.168.1.181

    super 3 (以管理员级别登陆)

    ————————————————————————

    2403 的WEB配置途径:

    [Switch-1]local-user admin (创建一个本地用户 admin)

    [Switch-1-luser-admin]password simple admin (设置了明文存贮的密码 admin)

    [Switch-1-luser-admin]service-type telnet level 3 (设置此用户为telnet类型(远程管理),级别3(管理员))

    ————————————————————————

    交换机设备选型案例:

    此主题相关图片如下:

    要求:自己到设备厂商网站选择设备满足上图要求。

      课下建议了解你选择的设备价格。


     

    2006.6.19日课堂演示 华为交换机配置笔记 补充!:

    单台公共端口实验:

    [2403-1]interface Ethernet 0/1 [2403-1-Ethernet0/1]port link-type hybrid [2403-1-Ethernet0/1]port hybrid pvid vlan 10 [2403-1-Ethernet0/1]port hybrid vlan 10 30 untagged [2403-1-Ethernet0/1]quit

    [2403-1]interface Ethernet 0/2 [2403-1-Ethernet0/2]port link-type hybrid [2403-1-Ethernet0/1]port hybrid pvid vlan 10 [2403-1-Ethernet0/2]port hybrid vlan 10 30 untagged [2403-1-Ethernet0/2]quit

    [2403-1]interface Ethernet 0/3 [2403-1-Ethernet0/3]port link-type hybrid [2403-1-Ethernet0/3]port hybrid pvid vlan 20 [2403-1-Ethernet0/3]port hybrid vlan 20 30 untagged [2403-1-Ethernet0/3]quit

    [2403-1]interface Ethernet 0/4 [2403-1-Ethernet0/4]port link-type hybrid [2403-1-Ethernet0/4]port hybrid pvid vlan 20 [2403-1-Ethernet0/4]port hybrid vlan 20 30 untagged [2403-1-Ethernet0/4]quit

    [2403-1]interface Ethernet 0/5 [2403-1-Ethernet0/5]port link-type hybrid [2403-1-Ethernet0/5]port hybrid pvid vlan 30 [2403-1-Ethernet0/5]port hybrid vlan 10 20 30 untagged [2403-1-Ethernet0/5]quit

    <2403-1>display vlan all

     VLAN ID: 10  VLAN类型: 静态  没有route interface属性  描述信息: VLAN 0010  名称: VLAN 0010  Tagged  接口: 无  Untagged接口:              Ethernet0/1           Ethernet0/2           Ethernet0/5

     VLAN ID: 20  VLAN类型: 静态  没有route interface属性  描述信息: VLAN 0020  名称: VLAN 0020  Tagged  接口: 无  Untagged接口:              Ethernet0/3           Ethernet0/4           Ethernet0/5

     VLAN ID: 30  VLAN类型: 静态  没有route interface属性  描述信息: VLAN 0030  名称: VLAN 0030  Tagged  接口: 无  Untagged接口:              Ethernet0/1           Ethernet0/2           Ethernet0/3              Ethernet0/4           Ethernet0/5

    跨交换机VLAN 方法1:

    [2403-1]interface Ethernet 0/1 [2403-1-Ethernet0/1]port link-type hybrid [2403-1-Ethernet0/1]port hybrid pvid vlan 10 [2403-1-Ethernet0/1]port hybrid vlan 10 30 untagged [2403-1-Ethernet0/1]quit

    [2403-1]interface Ethernet 0/2 [2403-1-Ethernet0/2]port link-type hybrid [2403-1-Ethernet0/1]port hybrid pvid vlan 10 [2403-1-Ethernet0/2]port hybrid vlan 10 30 untagged [2403-1-Ethernet0/2]quit

    [2403-1]interface Ethernet 0/3 [2403-1-Ethernet0/3]port link-type hybrid [2403-1-Ethernet0/3]port hybrid pvid vlan 20 [2403-1-Ethernet0/3]port hybrid vlan 20 30 untagged [2403-1-Ethernet0/3]quit

    [2403-1]interface Ethernet 0/4 [2403-1-Ethernet0/4]port link-type hybrid [2403-1-Ethernet0/4]port hybrid pvid vlan 20 [2403-1-Ethernet0/4]port hybrid vlan 20 30 untagged [2403-1-Ethernet0/4]quit

    [2403-1]interface Ethernet 0/5 [2403-1-Ethernet0/5]port link-type hybrid [2403-1-Ethernet0/5]port hybrid pvid vlan 30 [2403-1-Ethernet0/5]port hybrid vlan 10 20 30 tagged [2403-1-Ethernet0/5]quit

    跨交换机VLAN 方法2:

    VLAN 10 PORT ETHERNET 0/1 to ethernet 0/2 quit

    VLAN 20 PORT ETHERNET 0/3 to ethernet 0/4 quit

    interface ethernet 0/5 port link-type trunk port trunk permit vlan 10 20 ( all )

    跨交换机VLAN 方法3:

    VLAN 10 PORT ETHERNET 0/1 to ethernet 0/2 quit

    VLAN 20 PORT ETHERNET 0/3 to ethernet 0/4 quit

    interface ethernet 0/5 port link-type hybrid port hybrid vlan 10 20 tagged

    广域网设备 练习参考 路由器配置 网络工程班 基础项目实践IP地址部分及参考

    最新回复(0)