Dell Networking SONiC: Een VLAN maken en toewijzen aan trunk- en toegangspoorten

Summary: In dit artikel wordt uitgelegd hoe u een VLAN maakt en deze toewijst aan trunk- en toegangspoorten. In dit artikel wordt een switch gebruikt waarop Dell SONiC 4.1 wordt uitgevoerd.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

We gebruiken standaard interface-naamgevingen om de concepten te demonstreren. Lees het artikel Dell Networking S-serie: Basic Interface Configuration - SONiC 4.0 voor meer informatie over interfacenaamgeving


Inhoudsopgave

  1. Inleiding
  2. VLAN maken
  3. Een reeks Vlan's maken
  4. Een interface configureren als toegangspoort
  5. Een interface configureren als trunkpoort
  6. VLAN uit een interface verwijderen
  7. IP-adres en MTU configureren


 

Inleiding

Virtual Local Area Networks (VLAN's) zijn logische interfaces. Hiermee kan een groep apparaten communiceren alsof ze zich in hetzelfde netwerk bevinden, onafhankelijk van de fysieke locatie.
Physical interface en PortChannel kunnen lid zijn van Vlan. Het VLAN-bereik is van 1-4094.

Punten om te onthouden

  • Gereserveerd VLAN

Dell Enterprise SONiC reserveert 128 VLAN's voor gebruik van de verschillende protocollen. Dit is geïmplementeerd vanaf 4.0 en later. Standaard is het gereserveerde VLAN-bereik voor SONiC 4.0 3967 - 4094. U kunt het gereserveerde vlan-bereik wijzigen.

Zie het artikel Dell Networking Enterprise SONiC gereserveerde VLAN voor meer informatie over gereserveerde VLAN.

  • Profiel wisselen
    • Het standaard switchprofiel in Dell SONiC is L3 en heeft geen VLAN. We moeten een VLAN maken voordat we een poort aan een VLAN toewijzen.
    • Het L2-profiel heeft standaard VLAN 1 en alle poorten zijn standaard toegewezen aan dit VLAN 1.

Raadpleeg het artikel Dell Networking SONiC besturingssysteem L2- en L3-switchprofielen voor meer informatie over het L2- en L3-switchprofiel.

 

VLAN maken

Configuratiesyntaxis

Configuratie

Toelichting

admin@DELLSONiC:~$ sonic-cli

Maak kennis met de CLI van Dell Management Framework.

DELLSONiC# configure terminal

Activeer de configuratiemodus

DELLSONiC(config)# interface Vlan <Vlan ID>

VLAN maken

DELLSONiC(config)# no interface Vlan <Vlan ID> 

Remove a VLAN.


Een reeks Vlan's maken
 

Configuratie

Toelichting

DELLSONiC# configure terminal

Activeer de configuratiemodus

DELLSONiC(config)# interface range create Vlan <Vlan ID-Vlan ID>

Reeks VLAN's maken

DELLSONiC(config)# no interface Vlan <Vlan ID-Vlan ID>

Een reeks VLAN's verwijderen.



Voorbeeldconfiguratie
Laten we VLAN 10 op de switch configureren.
 

admin@DELLSONiC:~$ sonic-cli 
DELLSONiC# configure terminal 
DELLSONiC(config)# interface Vlan 10 
DELLSONiC(config-if-Vlan10)# end


Gebruik de onderstaande opdracht om te controleren of het VLAN is gemaakt.

show Vlan 


Voorbeeldresultaat

DELLSONiC# show Vlan
Q: A - Access (Untagged), T - Tagged
NUM        Status      Q Ports            Autostate   Dynamic
10         Inactive                       Enable


 

Een reeks Vlan's maken

Configuratie

Toelichting

DELLSONiC# configure terminal

Activeer de configuratiemodus

DELLSONiC(config)# interface range create Vlan <Vlan ID-Vlan ID>

Reeks VLAN's maken

DELLSONiC(config)# no interface Vlan <Vlan ID-Vlan ID>

Een reeks VLAN's verwijderen.


Voorbeeldconfiguratie

Laten we een reeks Vlan's 30-40 maken

admin@sonic:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface range create Vlan 30-40
DELLSONiC(config-if-range-vl**)# exit
DELLSONiC(config)# exit
DELLSONiC# show Vlan
Q: A - Access (Untagged), T - Tagged
NUM        Status      Q Ports            Autostate   Dynamic
30         Inactive                        Enable
31         Inactive                        Enable
32         Inactive                        Enable
33         Inactive                        Enable
34         Inactive                        Enable
35         Inactive                        Enable
36         Inactive                        Enable
37         Inactive                        Enable
38         Inactive                        Enable
39         Inactive                        Enable
40         Inactive                        Enable
DELLSONiC#

 
Laten we de Vlans 30-40 verwijderen

DELLSONiC# configure
DELLSONiC(config)# no interface Vlan 30-40
DELLSONiC(config)# end


 

Configureer een interface als toegangspoort.

Toegangspoort staat slechts één VLAN toe. De toegang tot VLAN-verkeer is untagged.

Configuratiesyntaxis

Configuratie

Toelichting

DELLSONiC# configure

Activeer de configuratiemodus

DELLSONiC(config)# interface Ethernet <Number>

Interface configureren

DELLSONiC(conf-if-Ethernet/PoX)# switchport access Vlan X

Wijs een poort toe als toegangspoort van VLAN.

DELLSONiC(conf-if-Ethernet/PoX)# no switchport access vlan

Verwijder toegangs-VLAN uit poort.


Voorbeeldconfiguratie
Stel dat we Port Ethernet 1/1 moeten toewijzen als toegangspoort van VLAN 10. Hieronder vindt u de voorbeeldconfiguratie.

 

DELLSONiC# configure
DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# switchport access Vlan 10
DELLSONiC(config-if-Eth1/1)# end
DELLSONiC#


Gebruik de onderstaande opdrachten om de configuratie te controleren.

show Vlan 

And 

show run interface <interface number>


Voorbeeldresultaat
 

DELLSONiC# show Vlan
Q: A - Access (Untagged), T - Tagged
NUM        Status      Q Ports            Autostate   Dynamic
10         Inactive    A  Eth1/1           Enable      No
DELLSONiC# show running-configuration interface Eth 1/1
!
interface Eth1/1
mtu 9100
no shutdown
switchport access Vlan 10


 

Configureer een interface als trunkpoort.

Trunkpoort kan meerdere getagde VLAN en één untagged VLAN (native VLAN) hebben.

Punten om te onthouden

  • Het VLAN moet worden gemaakt voordat het aan een interface kan worden toegewezen
  • Hetzelfde VLAN kan niet worden getagd en untagged VLAN in één interface
  • Er kan slechts één toegangsVLAN of VLAN zonder tag (Native VLAN) worden toegewezen in een interface. 
  • U kunt de volgende opdracht gebruiken om VLAN toe te voegen aan bestaande VLAN's in de interface.
 
switchport trunk allowed VLAN add <Vlan id/Range of vlan>
 

LET OP: Met de opdracht switchport trunk kan VLAN <Vlan id/bereik van vlan> alle VLAN's in de interface herschrijven met gespecificeerde VLAN's. Wees voorzichtig bij het gebruik van deze opdracht.

Configuratiesyntaxis

Configuratie

Toelichting

DELLSONiC# configure

Activeer de configuratiemodus

DELLSONiC(config)# interface Ethernet/Portchannel <number>

Interface configureren

DELLSONiC(conf-if-Ethernet/PoX)# switchport trunk allowed VLAN add <Vlan id/Range of vlan> 

Sta VLAN of een reeks VLAN's toe aan de trunkpoort. Als u een VLAN-bereik wilt opgeven, gebruikt u <1..4094> (-) of (,) gescheiden afzonderlijke VLAN-ID's en bereiken van VLAN-ID's; bijvoorbeeld 20,70-100,142

DELLSONiC(conf-if-Ethernet/PoX)#switchport trunk allowed Vlan all

Alle VLAN's toestaan (optioneel).

DELLSONiC(conf-if-Ethernet/PoX)#switchport trunk allowed Vlan <Vlan id/Range of vlan>

(Optioneel. Voorzichtig gebruiken) Herschrijft alle bestaande VLAN-configuraties in de interface en staat het opgegeven vlan/bereik van VLAN's toe. 

DELLSONiC(conf-if-Ethernet/PoX)# switchport access Vlan <Vlan id>

Wijs VLAN zonder tags toe aan poort (native VLAN) (optioneel).


Voorbeeldconfiguratie
Wijs VLAN 10 met tag en VLAN 20 toe als toegangspoort (native vlan zonder tags) op de Ethernet 1/1-interface. Hieronder vindt u de voorbeeldconfiguratie.

DELLSONiC# configure
DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# switchport trunk allowed Vlan add 10
DELLSONiC(config-if-Eth1/1)# switchport access Vlan 20
DELLSONiC(config-if-Eth1/1)# end


Gebruik de volgende opdracht om de configuratie te controleren.
 

show vlan and show run interface <interface id>


Voorbeeldresultaat

DELLSONiC# show Vlan
Q: A - Access (Untagged), T - Tagged
NUM        Status      Q Ports            Autostate   Dynamic
10         Inactive    T  Eth1/1           Enable      No
20         Inactive    A  Eth1/1           Enable      No​​
DELLSONiC# show running-configuration interface Eth 1/1
!
interface Eth1/1
mtu 9100
no shutdown
switchport access Vlan 20
switchport trunk allowed Vlan 10
DELLSONiC#


 

Remove VLAN from an interface.

Configuratiesyntaxis

Configuratie

Toelichting

DELLSONiC# configure

Activeer de configuratiemodus

DELLSONiC(config)# interface Ethernet/Portchannel <number>

Interface configureren

DELLSONiC(conf-if-Ethernet/PoX)# switchport trunk allowed Vlan remove <Vlan id/range> 

Verwijder VLAN of een reeks VLAN's uit een trunkpoort. Als u een VLAN-bereik wilt opgeven, gebruikt u <1..4094> (-) of (,) gescheiden afzonderlijke VLAN-ID's en bereiken van VLAN-ID's; bijvoorbeeld 20,70-100,142

DELLSONiC(conf-if-Ethernet/PoX)# no switchport access Vlan

Verwijder niet-gelabelde (toegang) uit de trunkpoort.


Voorbeeldconfiguratie

DELLSONiC# configure
DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# switchport trunk allowed Vlan remove 10
DELLSONiC(config-if-Eth1/1)# no switchport access Vlan
DELLSONiC(config-if-Eth1/1)# end


 

Configureer het IP-adres en MTU.

Een VLAN bevindt zich standaard in laag twee of meer. Het heeft geen IPv4- en IPv6-adres. We kunnen het IPv4- of IPv6-adres handmatig aan een VLAN toewijzen.

Punten om te onthouden

  • Configureer eerst de MTU op VLAN-leden voordat u VLAN MTU configureert. Alle leden van een VLAN moeten dezelfde MTU-waarde hebben. Getagde leden moeten een link MTU hebben die 4 bytes hoger is dan die van niet-getagde leden om rekening te houden met de pakkettag.
  • U kunt meerdere IPv6-adressen configureren op een interface.
  • U kunt een secundair IP-adres in een VLAN configureren


Configuratiesyntaxis

Configuratie

Toelichting

DELLSONiC# configure

Activeer de configuratiemodus

DELLSONiC(config)# interface Vlan <ID>

Interface configureren

DELLSONiC(conf-if-VlanX)#ip address <IP address/mask>

Voeg IP-adres toe.

DELLSONiC(conf-if-VlanX)#no ip address

Verwijder het IP-adres.

DELLSONiC(conf-if-VlanX)#ipv6 address <ipv6–address/prefix-length>

IPv6-adres toevoegen

DELLSONiC(conf-if-VlanX)#no ipv6 address

Verwijder het IPv6-adres.

DELLSONiC(conf-if-VlanX)#mtu <MTU ID>

MTU wijzigen (1312 naar 9216). Standaard: 9100


Voorbeeldconfiguratie
 

DELLDELLSONiC# configure
DELLSONiC(config)# interface Vlan 10
DELLSONiC(conf-if-Vlan10)# mtu 1500
DELLSONiC(conf-if-Vlan10)# ip address 10.0.0.1/24
DELLSONiC(conf-if-Vlan10)# ipv6 address a::b/64
DELLSONiC(conf-if-Vlan10)# end


Gebruik de volgende opdracht om de configuratie te controleren.

show interface vlan <vlan id>


Voorbeeldresultaat

DELLSONiC# show interface Vlan 10
Vlan10 is up, line protocol is down
Hardware is Vlan, address is 0c:6e:4a:87:00:0a
IPV4 address is 10.0.0.2/24
Mode of IPV4 address assignment: MANUAL
IPV6 address is a::b/64,fe80::e6e:4aff:fe87:a/64
Mode of IPV6 address assignment: MANUAL
IP MTU 1500 bytes
Time since last interface status change: 01:28:39

Affected Products

Enterprise SONiC Distribution, PowerSwitch S6000 ON, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S6100-ON, PowerSwitch Z9100-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON
Article Properties
Article Number: 000217901
Article Type: How To
Last Modified: 29 Sep 2023
Version:  6
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.