map遍历 cordova unity3d pointers enums Keys.js vue最新版本 后台管理界面 jquery绑定change事件 springboot单点登录 java数据分析 oracle删除表字段 matlab中axis python刷题 bootstrap居中对齐 python抛异常 python获取输入 java数据库连接 java初级 java中class java接口规范 java语言运算符 倒计时计时器 oem修改器 php购物车 电脑基础 摩斯密码翻译器 社区网格化管理平台 apihook 海蜘蛛软路由 思源黑体 nastran 抖音APP下载 类似迅雷的下载软件 凯立德下载 换肤助手 win10工作组 php单例模式 唯品会客服在哪 ps涂抹工具快捷键
当前位置: 首页 > 学习教程  > 编程语言

华为交换机:基于mac地址的vlan

2020/11/4 14:29:13 文章标签:

sw2 <Huawei>sys [Huawei]sysname sw2 [sw2][sw2]un in en #关闭消息回执 Info: Information center is disabled.[sw2]vlan batch 10 20[sw2]int g0/0/2 [sw2-GigabitEthernet0/0/2]port link-type access [sw2-GigabitEthernet0/0/2]port default vlan 10 [sw2-…

在这里插入图片描述

sw2

<Huawei>sys	
[Huawei]sysname sw2
[sw2]

[sw2]un in en    #关闭消息回执
Info: Information center is disabled.
	
[sw2]vlan batch 10 20

[sw2]int g0/0/2	
[sw2-GigabitEthernet0/0/2]port link-type access 
[sw2-GigabitEthernet0/0/2]port default vlan 10
[sw2-GigabitEthernet0/0/2]q
[sw2]int g0/0/3	
[sw2-GigabitEthernet0/0/3]port link-type access 
[sw2-GigabitEthernet0/0/3]port default vlan 20
[sw2-GigabitEthernet0/0/3]q
[sw2]dis vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(U)      GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      
                GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     
                GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)     GE0/0/24(D)                                     

10   common  UT:GE0/0/2(U)                                                      

20   common  UT:GE0/0/3(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
20   enable  default       enable  disable    VLAN 0020                         
[sw2]

[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk 	
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

sw1

The device is running!

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn	
[Huawei]sysname sw1
[sw1]
[sw1]
[sw1]int g0/0/2
[sw1]un in en
[sw1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type trunk 
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20
[sw1-GigabitEthernet0/0/2]q

[sw1]vlan batch 10 20
[sw1]vlan 10	
[sw1-vlan10]mac-vlan mac-address 0000-0000-0001
[sw1-vlan10]q

[sw1]vlan 20	
[sw1-vlan20]mac-vlan mac-address 0000-0000-0002
[sw1-vlan20]q

[sw1]int g0/0/1	
[sw1-GigabitEthernet0/0/1]port hybrid untagged vlan 10 20	#让g0/01属于多个vlan
[sw1-GigabitEthernet0/0/1]mac-vlan enable    #开启基于mac的学习vlan

[sw1]dis vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(U)      GE0/0/2(U)      GE0/0/3(D)      GE0/0/4(D)      
                GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      
                GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     
                GE0/0/13(D)     GE0/0/14(D)     GE0/0/15(D)     GE0/0/16(D)     
                GE0/0/17(D)     GE0/0/18(D)     GE0/0/19(D)     GE0/0/20(D)     
                GE0/0/21(D)     GE0/0/22(D)     GE0/0/23(D)     GE0/0/24(D)     

10   common  UT:GE0/0/1(U)                                                      

             TG:GE0/0/2(U)                                                      

20   common  UT:GE0/0/1(U)                                                      

             TG:GE0/0/2(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
20   enable  default       enable  disable    VLAN 0020                         
[sw1]

验证结果

用PC1 ping vlan10-server


PC>ping 192.168.1.5

Ping 192.168.1.5: 32 data bytes, Press Ctrl_C to break
From 192.168.1.5: bytes=32 seq=1 ttl=128 time=94 ms
From 192.168.1.5: bytes=32 seq=2 ttl=128 time=63 ms
From 192.168.1.5: bytes=32 seq=3 ttl=128 time=62 ms
From 192.168.1.5: bytes=32 seq=4 ttl=128 time=62 ms

--- 192.168.1.5 ping statistics ---
  4 packet(s) transmitted
  4 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 62/70/94 ms

用PC1 ping vlan20-server


PC>ping 192.168.1.6

Ping 192.168.1.6: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable

--- 192.168.1.6 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss

PC>

用PC2 ping vlan10-server

PC>ping 192.168.1.5

Ping 192.168.1.5: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable
From 192.168.1.2: Destination host unreachable

--- 192.168.1.5 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>

用PC2 ping vlan20-server

PC>ping 192.168.1.6

Ping 192.168.1.6: 32 data bytes, Press Ctrl_C to break
From 192.168.1.6: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.1.6: bytes=32 seq=2 ttl=128 time=78 ms
From 192.168.1.6: bytes=32 seq=3 ttl=128 time=62 ms
From 192.168.1.6: bytes=32 seq=4 ttl=128 time=79 ms
From 192.168.1.6: bytes=32 seq=5 ttl=128 time=62 ms

--- 192.168.1.6 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 62/71/79 ms

PC>

本文链接: http://www.dtmao.cc/news_show_350161.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?