VLAN, trunk, VLANIF (SVI) on Huawei switch

Download as PDF

Today I want to show you:

  • How to configure VLANs
  • How to add interface to a VLAN
  • How to establish 802.1q trunk between two Ethernet switches and filter VLANs
  • How to configure VLANIF (VLAN interface or simply SVI).

Look at the following topology.

huawei vlan_trunk_vlanif_topology

Let’s assume that we want to configure two switches, which are connected via Ethernet link. Both switches have PCs connected to them. We want to allow PC101 to be able to reach PC102 and PC201 to be able to reach PC202.To do so, we need to add two different VLANs, configure Ethernet trunk between switches and add PCs to the correct VLAN.

Let’s start with SW1 switch configuration.

First I have to add two VLANs 100 and 200, and describe these VLANs labnario100 and labnario200 respectively (description is optional). Both switches should be configured at exactly the same way, so SW2 configuration is omitted.

<labnariosw1>system-view
[labnariosw1]vlan 100	
[labnariosw1-vlan100]description labnario100
[labnariosw1-vlan100]vlan 200
[labnariosw1-vlan200]description labnario200

Let’s verify VLAN configuration:

[labnariosw1]display 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(U)     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)     
100  common  
200  common  

VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
100  enable  default       enable  disable    labnario100                       
200  enable  default       enable  disable    labnario200

As the second step, I want to configure 802.1q trunk between SW1 and SW2 and filter VLANs, which can pass through this trunk (VLAN filtering is optional):

[labnariosw1-GigabitEthernet0/0/10]port link-type trunk
[labnariosw1-GigabitEthernet0/0/10]port trunk allow-pass vlan 100 200

Let’s verify, if our trunk interface is configured correctly:

[labnariosw1]display port vlan 
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    hybrid       1     -                                   
GigabitEthernet0/0/2    hybrid       1     -                                   
GigabitEthernet0/0/3    hybrid       1     -                                   
GigabitEthernet0/0/4    hybrid       1     -                                   
GigabitEthernet0/0/5    hybrid       1     -                                   
GigabitEthernet0/0/6    hybrid       1     -                                   
GigabitEthernet0/0/7    hybrid       1     -                                   
GigabitEthernet0/0/8    hybrid       1     -                                   
GigabitEthernet0/0/9    hybrid       1     -                                   
GigabitEthernet0/0/10   trunk        1     1 100 200
GigabitEthernet0/0/11   hybrid       1     -                                   
GigabitEthernet0/0/12   hybrid       1     -                                   
GigabitEthernet0/0/13   hybrid       1     -                                   
GigabitEthernet0/0/14   hybrid       1     -                                   
GigabitEthernet0/0/15   hybrid       1     -                                   
GigabitEthernet0/0/16   hybrid       1     -                                   
GigabitEthernet0/0/17   hybrid       1     -                                   
GigabitEthernet0/0/18   hybrid       1     -                                   
GigabitEthernet0/0/19   hybrid       1     -                                   
GigabitEthernet0/0/20   hybrid       1     -                                   
GigabitEthernet0/0/21   hybrid       1     -                                   
GigabitEthernet0/0/22   hybrid       1     -                                   
GigabitEthernet0/0/23   hybrid       1     -                                   
GigabitEthernet0/0/24   hybrid       1     -

There is also more specific command:

[labnariosw1]display port vlan GigabitEthernet 0/0/10
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/10   trunk        1     1 100 200

You can also filter VLANs which can pass through the trunk:

[labnariosw1-GigabitEthernet0/0/10]undo port trunk allow-pass vlan 1
[labnariosw1]display port vlan GigabitEthernet 0/0/10
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/10   trunk        1     100 200

As you see, Ge0/0/10 interface is working as a 802.1q trunk. Only VLANs 100 and 200 can pass through this trunk link.

Now we can configure access ports which are connected to PCs:

[labnariosw1]interface GigabitEthernet 0/0/1
[labnariosw1-GigabitEthernet0/0/1]port link-type access
[labnariosw1-GigabitEthernet0/0/1]port default vlan 100
[labnariosw1-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/2
[labnariosw1-GigabitEthernet0/0/2]port link-type access
[labnariosw1-GigabitEthernet0/0/2]port default vlan 200

Let’s verify our VLANs and ports configuration again:

[labnariosw1]display port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    access       100   -                                   
GigabitEthernet0/0/2    access       200   -                                   
GigabitEthernet0/0/3    hybrid       1     -                                   
GigabitEthernet0/0/4    hybrid       1     -                                   
GigabitEthernet0/0/5    hybrid       1     -                                   
GigabitEthernet0/0/6    hybrid       1     -                                   
GigabitEthernet0/0/7    hybrid       1     -                                   
GigabitEthernet0/0/8    hybrid       1     -                                   
GigabitEthernet0/0/9    hybrid       1     -                                   
GigabitEthernet0/0/10   trunk        1     100 200
GigabitEthernet0/0/11   hybrid       1     -                                   
GigabitEthernet0/0/12   hybrid       1     -                                   
GigabitEthernet0/0/13   hybrid       1     -                                   
GigabitEthernet0/0/14   hybrid       1     -                                   
GigabitEthernet0/0/15   hybrid       1     -                                   
GigabitEthernet0/0/16   hybrid       1     -                                   
GigabitEthernet0/0/17   hybrid       1     -                                   
GigabitEthernet0/0/18   hybrid       1     -                                   
GigabitEthernet0/0/19   hybrid       1     -                                   
GigabitEthernet0/0/20   hybrid       1     -                                   
GigabitEthernet0/0/21   hybrid       1     -                                   
GigabitEthernet0/0/22   hybrid       1     -                                   
GigabitEthernet0/0/23   hybrid       1     -                                   
GigabitEthernet0/0/24   hybrid       1     -   

[labnariosw1]display 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/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(U)     
                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)                                     
100  common  UT:GE0/0/1(U)            
             TG:GE0/0/10(U)           
200  common  UT:GE0/0/2(U)            
             TG:GE0/0/10(U)           

VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
100  enable  default       enable  disable    labnario100                       
200  enable  default       enable  disable    labnario200

When both switches are configured, we can check if our PCs can ping each other. Remember that PC101 and PC102 are both in a VLAN 100 and PC201 with PC202 are both in a VLAN 200. So let’s start with PC101:

PC101>ping 192.168.100.2

Ping 192.168.100.2: 32 data bytes, Press Ctrl_C to break
From 192.168.100.2: bytes=32 seq=1 ttl=128 time=15 ms
From 192.168.100.2: bytes=32 seq=2 ttl=128 time=32 ms
From 192.168.100.2: bytes=32 seq=3 ttl=128 time=47 ms
From 192.168.100.2: bytes=32 seq=4 ttl=128 time=46 ms
From 192.168.100.2: bytes=32 seq=5 ttl=128 time=16 ms

--- 192.168.100.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 15/31/47 ms

PC101>ping 192.168.200.1

Ping 192.168.200.1: 32 data bytes, Press Ctrl_C to break
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable

PC101>ping 192.168.200.2

Ping 192.168.200.2: 32 data bytes, Press Ctrl_C to break
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable
From 192.168.100.1: Destination host unreachable

PC101 can successfully ping PC102 as both are in a VLAN 100. It can not ping PCs 201 and 202 which are configured in VLAN 200. Let’s check connectivity in VLAN 200:

PC201>ping 192.168.200.2

Ping 192.168.200.2: 32 data bytes, Press Ctrl_C to break
From 192.168.200.2: bytes=32 seq=1 ttl=128 time=46 ms
From 192.168.200.2: bytes=32 seq=2 ttl=128 time=16 ms
From 192.168.200.2: bytes=32 seq=3 ttl=128 time=63 ms
From 192.168.200.2: bytes=32 seq=4 ttl=128 time=46 ms
From 192.168.200.2: bytes=32 seq=5 ttl=128 time=47 ms

--- 192.168.200.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 16/43/63 ms

PC201 can successfully ping PC202. It means that our VLANs, trunk and access ports are configured correctly.

As the last step I want to show you, how to configure VLAN interface.

VLAN interface is a Layer3 virtual interface configured on a switch, which belongs to a specific VLAN. It is sometimes called a “SVI” (Switched Virtual Interface). If there is no VLANIF configured, it is not possible to ping any device connected to that VLAN. This is because IP packets must have source IP address to be able to reach remote device and come back to our switch.

I will configure VLANIF 100 on both SW1 and SW2:

[labnariosw1]interface Vlanif 100
[labnariosw1-Vlanif100]ip add 192.168.100.101 255.255.255.0

[labnariosw2]interface Vlanif 100
[labnariosw2-Vlanif100]ip add 192.168.100.102 255.255.255.0

Now I should have full IP connectivity between all my devices configured in VLAN 100. This means that PC101, PC102, SW1 and SW2 can ping each other:

[labnariosw1]ping 192.168.100.1
  PING 192.168.100.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.100.1: bytes=56 Sequence=1 ttl=128 time=50 ms
    Reply from 192.168.100.1: bytes=56 Sequence=2 ttl=128 time=1 ms
    Reply from 192.168.100.1: bytes=56 Sequence=3 ttl=128 time=20 ms
    Reply from 192.168.100.1: bytes=56 Sequence=4 ttl=128 time=20 ms
    Reply from 192.168.100.1: bytes=56 Sequence=5 ttl=128 time=1 ms

  --- 192.168.100.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 1/18/50 ms

[labnariosw1]ping 192.168.100.2
  PING 192.168.100.2: 56  data bytes, press CTRL_C to break
    Reply from 192.168.100.2: bytes=56 Sequence=1 ttl=128 time=60 ms
    Reply from 192.168.100.2: bytes=56 Sequence=2 ttl=128 time=10 ms
    Reply from 192.168.100.2: bytes=56 Sequence=3 ttl=128 time=40 ms
    Reply from 192.168.100.2: bytes=56 Sequence=4 ttl=128 time=40 ms
    Reply from 192.168.100.2: bytes=56 Sequence=5 ttl=128 time=30 ms

  --- 192.168.100.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/36/60 ms

[labnariosw1]ping 192.168.100.102
  PING 192.168.100.102: 56  data bytes, press CTRL_C to break
    Reply from 192.168.100.102: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 192.168.100.102: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 192.168.100.102: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 192.168.100.102: bytes=56 Sequence=4 ttl=255 time=50 ms
    Reply from 192.168.100.102: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 192.168.100.102 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/42/50 ms
Advertisements

19 thoughts on “VLAN, trunk, VLANIF (SVI) on Huawei switch

  1. lasa

    Hello…Great examples and very helpful.. So I want to learn how to set up css and cluster set up? could you help me for this.. Thanks a lot.

    Reply
  2. mozez

    Hi just stumbled across your blog; we recently received various huawei switches in a new building. My question is do you have any documentation on inter-vlan routing. If you have done write pls forgive me but I am still going through all your posts. So far very informative. Thanks for the share… Keep up the good work!

    Reply
  3. udayakumar

    hi,
    I am new to Huawei!!!
    I config vlan and trunk. and connected to CISCO core. I was working fine sometime. after some time the connection was lose. an thing is I cant enter IP address for manage the switch. I assign as management vlan to 211. when I enter by interface vlanif I try to give the ip it giving the err.
    “Can not create this interface because the interface number of this type has reached its maximum.”

    pls help
    thanks advance

    Reply
    1. labnario Post author

      Hi,

      You didn’t mention what platform you use and which software. Based on the information you wrote I cannot find what is the problem.

      Reply
  4. Solid Gold Suleyman

    how do you do a snake test with Huawei switch? I have an Ixia. I want traffic to ingress on port 1 of Huawei switch. Port 1&2 are on VLAN 2. Cat-5 cable connects port 2 to port 3. Port 3&4 are on VLAN 3. port 4 cable connects to port 5 Etc. At port 24 goes back to Ixia. I tried setting ports as access but traffic will not flow through.

    Reply
    1. labnario Post author

      Sorry but I haven’t used a snake test. To be honest, this is the first time I heard about such test. I also asked my CCIE friend if he knows about this test on Cisco. He doesn’t. This test is not used by customers. Maybe it is used by some testers in laboratory. Anyway I am wondering if STP is disabled on this switch.

      Reply
    2. piter_s

      Hi,
      if your switch is configured correctly, this test should work. Try connecting Ixia to switch eth0/1 and 0/2 (both in same VLAN) and check if this works. If yes, connect eth0/2 to 0/3 and Ixia RX to eth0/4 and check again (eth0/1-2 in one VLAN, eth0/3-4 in next VLAN). This should works also. If not, probably your switch is configured incorrectly.

      Reply
    1. labnario Post author

      It depends of the model of switch you have. You can use stack card or service ports connection to configure stack.

      Stack card connection:
      S5710-LI
      S5700-SI
      S5700-EI

      Service port connection:
      S2750
      S5700-P-LI (with GE uplink ports)
      S5700-TP-LI (with GE uplink ports)
      S5700-X-LI (with 10GE uplink ports)
      S5710-EI
      S5700-HI
      S6700

      Stacking incapable:
      S5710-HI
      S5700S-LI

      You can find all information about stack configuration here: http://support.huawei.com/ehedex/hdx.do?docid=DOC1000021452&lang=en (chapter: stack configuration).

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s