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 |