祖瑞科技 全国计算机 网络IT运维社区!

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 7778|回复: 0

HCNA-9 Hybrid配置应用

[复制链接]

205

主题

218

帖子

1286

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1286
发表于 2021-2-5 13:37:52 | 显示全部楼层 |阅读模式
HCNA-9 Hybrid配置应用

                              
配置通过Access及Trunk接口方式
<Huawei>clocktimezone BJ add 8:00:00
<Huawei>clockdatetime 16:27 2020-04-30
<Huawei>system-view
[Huawei]sysnamesw1
[sw1]vlan10
[sw1-vlan10]descriptionit
[sw1-vlan10]vlan20
[sw1-vlan20]descriptionshichang
[sw1-vlan20]vlan30
[sw1-vlan30]descriptionrenshi
[sw1-vlan30]quit
[sw1]interfaceGigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]undonegotiation auto
[sw1-GigabitEthernet0/0/1]duplexfull
[sw1-GigabitEthernet0/0/1]speed1000
[sw1-GigabitEthernet0/0/1]portlink-type access
[sw1-GigabitEthernet0/0/1]portdefault vlan 10
[sw1-GigabitEthernet0/0/1]quit
[sw1]displayvlan
[sw1]displayport vlan active
[sw1]interfaceGigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]undonegotiation auto
[sw1-GigabitEthernet0/0/2]duplexfull
[sw1-GigabitEthernet0/0/2]speed1000
[sw1-GigabitEthernet0/0/2]portlink-type access
[sw1-GigabitEthernet0/0/2]portdefault vlan 20
[sw1-GigabitEthernet0/0/2]quit3
[sw1]interfaceGigabitEthernet 0/0/3
[sw1-GigabitEthernet0/0/3]undonegotiation auto
[sw1-GigabitEthernet0/0/3]duplexfull
[sw1-GigabitEthernet0/0/3]speed1000
[sw1-GigabitEthernet0/0/3]portlink-type access
[sw1-GigabitEthernet0/0/3]portdefault vlan 30
[sw1-GigabitEthernet0/0/3]quit
[sw1]interfaceGigabitEthernet 0/0/24
[sw1-GigabitEthernet0/0/24]undonegotiation auto
[sw1-GigabitEthernet0/0/24]duplexfull
[sw1-GigabitEthernet0/0/24]speed1000
[sw1-GigabitEthernet0/0/24]portlink-type trunk
[sw1-GigabitEthernet0/0/24]porttrunk allow-pass vlan all
[sw1-GigabitEthernet0/0/24]quit
[sw1-GigabitEthernet0/0/24]return
<sw1>displayport vlan active
<sw1>displayvlan
<sw1>save

<Huawei>clocktimezone BJ add 8:00:00
<Huawei>clockdatetime 16:42 2020-04-30
<Huawei>system-view
[Huawei]sysnamesw2
[sw2]vlan10
[sw2-vlan10]descriptionit
[sw2-vlan10]vlan20
[sw2-vlan20]descriptionshichang
[sw2-vlan20]vlan30
[sw2-vlan30]descriptionrenshi
[sw2-vlan30]quit
[sw2]interfaceGigabitEthernet 0/0/1
[sw2-GigabitEthernet0/0/1]undonegotiation auto
[sw2-GigabitEthernet0/0/1]duplexfull
[sw2-GigabitEthernet0/0/1]speed1000
[sw2-GigabitEthernet0/0/1]portlink-type access
[sw2-GigabitEthernet0/0/1]portdefault vlan 20
[sw2-GigabitEthernet0/0/1]quit
[sw2]interfaceGigabitEthernet 0/0/2
[sw2-GigabitEthernet0/0/2]undonegotiation auto
[sw2-GigabitEthernet0/0/2]duplexfull
[sw2-GigabitEthernet0/0/2]speed1000
[sw2-GigabitEthernet0/0/2]port  link-type access
[sw2-GigabitEthernet0/0/2]portdefault vlan 30
[sw2-GigabitEthernet0/0/2]quit
[sw2]interfaceGigabitEthernet 0/0/24
[sw2-GigabitEthernet0/0/24]undonegotiation auto
[sw2-GigabitEthernet0/0/24]duplexfull
[sw2-GigabitEthernet0/0/24]speed1000
[sw2-GigabitEthernet0/0/24]portlink-type trunk
[sw2-GigabitEthernet0/0/24]porttrunk allow-pass vlan all
[sw2-GigabitEthernet0/0/24]return
<sw2>displayvlan
<sw2>displayport vlan active

配置Hybrid接口
<sw1>system-view
[sw1-GigabitEthernet0/0/1]undoport default vlan  //恢复接口默认vlan
[sw1-GigabitEthernet0/0/1]portlink-type hybrid  //接口链路类型为hybrid(默认值)
[sw1-GigabitEthernet0/0/1]porthybrid untagged vlan 10  //配置为该接口在转发vlan10的帧时,剥离相应vlan tag 10,以Untagged的方式发送给PC
[sw1-GigabitEthernet0/0/1]porthybrid pvid vlan 10  //配置接口默认vlan ID,该接口收到PC发来的未带vlan tag的帧时,会打上vlantag 10,再转发到vlan10
[sw1-GigabitEthernet0/0/1]quit
[sw1]interfaceGigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]undoport default vlan
[sw1-GigabitEthernet0/0/2]portlink-type hybrid
[sw1-GigabitEthernet0/0/2]porthybrid untagged vlan 20
[sw1-GigabitEthernet0/0/2]porthybrid pvid vlan 20
[sw1-GigabitEthernet0/0/2]quit
[sw1]interfaceGigabitEthernet 0/0/3
[sw1-GigabitEthernet0/0/3]undoport default vlan
[sw1-GigabitEthernet0/0/3]portlink-type hybrid
[sw1-GigabitEthernet0/0/3]porthybrid untagged vlan 30
[sw1-GigabitEthernet0/0/3]porthybrid pvid vlan 30
[sw1-GigabitEthernet0/0/3]quit
[sw1]interfaceGigabitEthernet 0/0/24
[sw1-GigabitEthernet0/0/24]porttrunk allow-pass vlan 1  //骨干接口 允许vlan 1通过
[sw1-GigabitEthernet0/0/24]undoport trunk allow-pass vlan 2 to 4094  //骨干接口不执行vlan 2至4094通过
[sw1-GigabitEthernet0/0/24]porthybrid tagged vlan all  //hybrid接口 打上所有vlan标签,即允许通过
[sw1-GigabitEthernet0/0/24]return
[sw2]interfaceGigabitEthernet 0/0/1
[sw2-GigabitEthernet0/0/1]undoport default vlan
[sw2-GigabitEthernet0/0/1]portlink-type hybrid
[sw2-GigabitEthernet0/0/1]porthybrid untagged vlan 20
[sw2-GigabitEthernet0/0/1]porthybrid pvid vlan 20
[sw2-GigabitEthernet0/0/1]return
[sw2-GigabitEthernet0/0/2]undoport default vlan
[sw2-GigabitEthernet0/0/2]portlink-type hybrid
[sw2-GigabitEthernet0/0/2]porthybrid untagged vlan 30
[sw2-GigabitEthernet0/0/2]porthybrid pvid vlan 30
[sw2-GigabitEthernet0/0/2]quit
[sw2]interfaceGigabitEthernet 0/0/24
[sw2-GigabitEthernet0/0/24]porttrunk allow-pass vlan 1
[sw2-GigabitEthernet0/0/24]undoport trunk allow-pass vlan 2 to 4094
[sw2-GigabitEthernet0/0/24]portlink-type hybrid
[sw2-GigabitEthernet0/0/24]porthybrid tagged vlan all
[sw2-GigabitEthernet0/0/24]return

现在要求IT部PC可以访问其他所有部门vlan
<sw1>system-view
[sw1]interfaceGigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]porthybrid untagged vlan 10 20 30
[sw1-GigabitEthernet0/0/1]quit
[sw1]interfaceGigabitEthernet 0/0/2
[sw1-GigabitEthernet0/0/2]porthybrid untagged vlan 10 20
[sw1-GigabitEthernet0/0/2]quit
[sw1-GigabitEthernet0/0/3]porthybrid untagged vlan 10 30
[sw1-GigabitEthernet0/0/3]return
<sw1>save
<sw1>displayport vlan active
T=TAGU=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID   VLAN List
-------------------------------------------------------------------------------
GE0/0/1             hybrid       10     U: 1 10 20 30
GE0/0/2             hybrid       20     U: 1 10 20
GE0/0/3             hybrid       30     U: 1 10 30
……
GE0/0/23            hybrid       1      U: 1
GE0/0/24            hybrid       1      T: 1 10 20 30

[sw2]interfaceGigabitEthernet 0/0/1
[sw2-GigabitEthernet0/0/1]porthybrid untagged vlan 10 20
[sw2-GigabitEthernet0/0/1]quit
[sw2]interfaceGigabitEthernet 0/0/2
[sw2-GigabitEthernet0/0/2]porthybrid untagged vlan 10 30
[sw2-GigabitEthernet0/0/2]return
<sw2>save
<sw2>displayport vlan active
T=TAGU=UNTAG
-------------------------------------------------------------------------------
Port                Link Type   PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             hybrid       20     U: 1 10 20
GE0/0/2             hybrid       30     U: 1 10 30
……
GE0/0/23            hybrid       1      U: 1
GE0/0/24            hybrid       1      T: 1 10 20 30

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
祖瑞(上海)网络科技有限公司
我们在全国范围提供企业IT运维、网络工程、弱电安装、监控安防、计算机产品收售、办公设备耗材等服务!
期待与您的合作!
邮箱:sanne@zurkj.com
电话:021-51850021 18918292296
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

公司网站

QQ|Archiver|手机版|小黑屋|祖瑞科技 全国计算机 网络IT运维社区! ( 沪ICP备16021636号-2 )

GMT+8, 2024-11-26 03:46 , Processed in 0.035698 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表