案例9 VLAN技术接入案例

发布时间 2023-10-21 15:45:27作者: xl4ng

1 在华为设备上实施VLAN接入

image

[SW1]vlan 8           ^
[SW1-vlan8]description QCNA
[SW1-vlan8]
[SW1-vlan8]display port vlan active 
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             hybrid       1       U: 1
GE0/0/2             hybrid       1       U: 1
GE0/0/3             hybrid       1       U: 1
GE0/0/4             hybrid       1       U: 1
GE0/0/5             hybrid       1       U: 1
GE0/0/6             hybrid       1       U: 1
GE0/0/7             hybrid       1       U: 1
GE0/0/8             hybrid       1       U: 1
GE0/0/9             hybrid       1       U: 1
GE0/0/10            hybrid       1       U: 1
GE0/0/11            hybrid       1       U: 1
GE0/0/12            hybrid       1       U: 1
GE0/0/13            hybrid       1       U: 1
GE0/0/14            hybrid       1       U: 1
GE0/0/15            hybrid       1       U: 1
GE0/0/16            hybrid       1       U: 1
GE0/0/17            hybrid       1       U: 1
GE0/0/18            hybrid       1       U: 1
GE0/0/19            hybrid       1       U: 1
GE0/0/20            hybrid       1       U: 1
GE0/0/21            hybrid       1       U: 1
GE0/0/22            hybrid       1       U: 1
GE0/0/23            hybrid       1       U: 1
GE0/0/24            hybrid       1       U: 1
[SW1-vlan8]quit 
[SW1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3
[SW1-port-group]port link-type access
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-port-group]
[SW1-port-group]port default vlan 8
[SW1-GigabitEthernet0/0/1]port default vlan 8
[SW1-GigabitEthernet0/0/2]port default vlan 8
[SW1-GigabitEthernet0/0/3]port default vlan 8
[SW1-port-group]
[SW1-port-group]dis th
#
return
[SW1-port-group]display port vlan active 
T=TAG U=UNTAG
-------------------------------------------------------------------------------
Port                Link Type    PVID    VLAN List
-------------------------------------------------------------------------------
GE0/0/1             access       8       U: 8
GE0/0/2             access       8       U: 8
GE0/0/3             access       8       U: 8
GE0/0/4             hybrid       1       U: 1
GE0/0/5             hybrid       1       U: 1
GE0/0/6             hybrid       1       U: 1
GE0/0/7             hybrid       1       U: 1
GE0/0/8             hybrid       1       U: 1
GE0/0/9             hybrid       1       U: 1
GE0/0/10            hybrid       1       U: 1
GE0/0/11            hybrid       1       U: 1
GE0/0/12            hybrid       1       U: 1
GE0/0/13            hybrid       1       U: 1
GE0/0/14            hybrid       1       U: 1
GE0/0/15            hybrid       1       U: 1
GE0/0/16            hybrid       1       U: 1
GE0/0/17            hybrid       1       U: 1
GE0/0/18            hybrid       1       U: 1
GE0/0/19            hybrid       1       U: 1
GE0/0/20            hybrid       1       U: 1
GE0/0/21            hybrid       1       U: 1
GE0/0/22            hybrid       1       U: 1
GE0/0/23            hybrid       1       U: 1
GE0/0/24            hybrid       1       U: 1
[SW1-port-group]q
[SW1]display ip int brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 1
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 1
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           10.1.10.14/28        down       down      
[SW1]ping 10.1.10.1
  PING 10.1.10.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

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

[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]ping 10.1.10.1
  PING 10.1.10.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

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

[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 8
#
return
[SW1-GigabitEthernet0/0/1] User interface con0 is available



Please Press ENTER.

2 在华三设备上实施VLAN接入

image

[SW1]
[SW1]display vlan brief 
Brief information about all VLANs:
Supported Minimum VLAN ID: 1
Supported Maximum VLAN ID: 4094
Default VLAN ID: 1
VLAN ID   Name                             Port
1         VLAN 0001                        FGE1/0/53(D)   FGE1/0/54(D)   
                                           GE1/0/1(D)   GE1/0/2(D)   GE1/0/3(D)   
                                           GE1/0/4(D)   GE1/0/5(D)   GE1/0/6(D)   
                                           GE1/0/7(D)   GE1/0/8(D)   GE1/0/9(D)   
                                           GE1/0/10(U)   GE1/0/11(U)   
                                           GE1/0/12(U)   GE1/0/13(D)   
                                           GE1/0/14(D)   GE1/0/15(D)   
                                           GE1/0/16(D)   GE1/0/17(D)   
                                           GE1/0/18(D)   GE1/0/19(D)   
                                           GE1/0/20(D)   GE1/0/21(D)   
                                           GE1/0/22(D)   GE1/0/23(D)   
                                           GE1/0/24(D)   GE1/0/25(D)   
                                           GE1/0/26(D)   GE1/0/27(D)   
                                           GE1/0/28(D)   GE1/0/29(D)   
                                           GE1/0/30(D)   GE1/0/31(D)   
                                           GE1/0/32(D)   GE1/0/33(D)   
                                           GE1/0/34(D)   GE1/0/35(D)   
                                           GE1/0/36(D)   GE1/0/37(D)   
                                           GE1/0/38(D)   GE1/0/39(D)   
                                           GE1/0/40(D)   GE1/0/41(D)   
                                           GE1/0/42(D)   GE1/0/43(D)   
                                           GE1/0/44(D)   GE1/0/45(D)   
                                           GE1/0/46(D)   GE1/0/47(D)   
                                           GE1/0/48(D)   XGE1/0/49(D)   
                                           XGE1/0/50(D)   XGE1/0/51(D)   
                                           XGE1/0/52(D)   
[SW1]          
[SW1]vlan 8
[SW1-vlan8]name QCNA
[SW1-vlan8]description QCNA
[SW1-vlan8]int
[SW1-vlan8]q
[SW1]interface range GigabitEthernet 1/0/10 to GigabitEthernet 1/0/12
[SW1-if-range]port link-type access 
[SW1-if-range]port access vlan 8
[SW1-if-range]exit
[SW1]display vlan brief
Brief information about all VLANs:
Supported Minimum VLAN ID: 1
Supported Maximum VLAN ID: 4094
Default VLAN ID: 1
VLAN ID   Name                             Port
1         VLAN 0001                        FGE1/0/53(D)   FGE1/0/54(D)   
                                           GE1/0/1(D)   GE1/0/2(D)   GE1/0/3(D)   
                                           GE1/0/4(D)   GE1/0/5(D)   GE1/0/6(D)   
                                           GE1/0/7(D)   GE1/0/8(D)   GE1/0/9(D)   
                                           GE1/0/13(D)   GE1/0/14(D)   
                                           GE1/0/15(D)   GE1/0/16(D)   
                                           GE1/0/17(D)   GE1/0/18(D)   
                                           GE1/0/19(D)   GE1/0/20(D)   
                                           GE1/0/21(D)   GE1/0/22(D)   
                                           GE1/0/23(D)   GE1/0/24(D)   
                                           GE1/0/25(D)   GE1/0/26(D)   
                                           GE1/0/27(D)   GE1/0/28(D)   
                                           GE1/0/29(D)   GE1/0/30(D)   
                                           GE1/0/31(D)   GE1/0/32(D)   
                                           GE1/0/33(D)   GE1/0/34(D)   
                                           GE1/0/35(D)   GE1/0/36(D)   
                                           GE1/0/37(D)   GE1/0/38(D)   
                                           GE1/0/39(D)   GE1/0/40(D)   
                                           GE1/0/41(D)   GE1/0/42(D)   
                                           GE1/0/43(D)   GE1/0/44(D)   
                                           GE1/0/45(D)   GE1/0/46(D)   
                                           GE1/0/47(D)   GE1/0/48(D)   
                                           XGE1/0/49(D)   XGE1/0/50(D)   
                                           XGE1/0/51(D)   XGE1/0/52(D)   
8         QCNA                             GE1/0/10(U)   GE1/0/11(U)   
                                           GE1/0/12(U)   
[SW1]          
[SW1]
[SW1]