Dell Networking SONiC:VLANを作成してトランクに割り当てる方法とスイッチポートにアクセスする方法

Summary: この記事では、VLANを作成し、トランクおよびアクセス スイッチポートに割り当てる方法について説明します。この記事では、Dell SONiC 4.1を実行しているスイッチを使用します。

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

ここでは、概念を示すために標準的なインターフェイス名を使用しています。詳細については、記事「Dell Networking Sシリーズ: インターフェイスの命名に関する詳細については、「基本的なインターフェイス設定 - SONiC 4.0」を参照してください。


目次

  1. 概要
  2. VLANの作成
  3. VLANの範囲を作成します
  4. インターフェイスをアクセス ポートとして設定する
  5. インターフェイスをトランク ポートとして設定する
  6. インターフェイスからのVLANの削除
  7. IPアドレスとMTUの構成


 

概要

仮想ローカル エリア ネットワーク(VLAN)は論理インターフェイスです。これにより、デバイスのグループは、物理的な場所に関係なく、同じネットワーク内にあるかのように通信できます
物理インターフェイスとPortChannelをVLANのメンバーにすることができます。VLAN の範囲は 1 〜 4094 です

覚えておくべきポイント

  • 予約済みVLAN

Dell Enterprise SONiCは、さまざまなプロトコルを使用するために128個のVLANを予約しています。これは 4.0 以降から実装されました。デフォルトでは、SONiC 4.0の予約済みVLANの範囲は3967〜4094です。予約済みVLANの範囲を変更できます。

予約済みVLANの詳細については、記事「Dell Networking Enterprise SONiC予約済みVLAN」を参照してください。

  • スイッチ プロファイル
    • Dell SONiCのデフォルトのスイッチ プロファイルはL3で、VLANはありません。ポートをVLANに割り当てる前に、VLANを作成する必要があります。
    • L2プロファイルにはデフォルトのVLAN 1があり、すべてのポートがデフォルトでこのVLAN 1に割り当てられます。

L2およびL3スイッチ プロファイルの詳細については、記事「Dell Networking SONiC Operating System L2およびL3スイッチ プロファイル」を参照してください。

 

VLANの作成

構成構文

Configuration

説明

admin@DELLSONiC:~$ sonic-cli

Dell Management Framework CLIを起動します。

DELLSONiC# configure terminal

設定モードを起動します

DELLSONiC(config)# interface Vlan <Vlan ID>

VLANの作成

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

VLANを削除します。


VLANの範囲を作成します
 

Configuration

説明

DELLSONiC# configure terminal

設定モードを起動します

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

VLANの範囲の作成

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

VLANの範囲を削除します。



構成例
スイッチでVLAN 10を構成しましょう。
 

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


次のコマンドを使用して、VLANが作成されているかどうかを確認します。

show Vlan 


出力例

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


 

VLANの範囲を作成します

Configuration

説明

DELLSONiC# configure terminal

設定モードを起動します

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

VLANの範囲の作成

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

VLANの範囲を削除します。


構成例

VLAN 30-40の範囲を作成しましょう

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#

 
VLAN 30-40を削除しましょう

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


 

インターフェイスをアクセス ポートとして設定します。

アクセス ポートでは、1つのVLANのみが許可されます。VLANトラフィックへのアクセスはタグなしです。

構成構文

Configuration

説明

DELLSONiC# configure

設定モードを起動します

DELLSONiC(config)# interface Ethernet <Number>

インターフェイスの構成

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

VLANのアクセス ポートとしてポートを割り当てます。

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

ポートからアクセスVLANを削除します。


構成例
VLAN 10 のアクセス ポートとしてポート イーサネット 1/1 を割り当てる必要があるとします。以下は設定例です。

 

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


次のコマンドを使用して、構成を確認します。

show Vlan 

And 

show run interface <interface number>


出力例
 

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


 

インターフェイスをトランク ポートとして設定します。

トランク ポートには、複数のタグ付きVLANと1つのタグなしVLAN(ネイティブVLAN)を設定できます。

覚えておくべきポイント

  • VLANは、インターフェイスに割り当てる前に作成する必要があります
  • 1つのインターフェイスで同じVLANのタグ付けとタグなしVLANを使用することはできません
  • インターフェイスには、アクセス VLANまたはタグなしVLAN(ネイティブVLAN)を1つだけ割り当てることができます。 
  • 次のコマンドを使用して、インターフェイス内の既存のVLANにVLANを追加できます。
 
switchport trunk allowed VLAN add <Vlan id/Range of vlan>
 

警告:switchport trunk allowed VLAN<VLAN id/VLAN の範囲>コマンドは、インターフェイスに存在するすべての VLAN を指定された VLAN に書き換えます。このコマンドは注意して使用してください。

構成構文

Configuration

説明

DELLSONiC# configure

設定モードを起動します

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

インターフェイスの構成

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

VLANまたはVLANの範囲をトランク ポートに許可します。VLAN範囲を指定するには、個々のVLAN IDとVLAN IDの範囲を区切って<1..4094> (-)または(,)を使用します。例:20,70-100,142

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

すべてのVLANを許可(オプション)。

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

(オプション。注意して使用)インターフェイス内のすべての既存のVLAN設定を書き換え、指定されたVLAN/VLANの範囲を許可します。 

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

タグなしVLANをポート(ネイティブVLAN)に割り当てます(オプション)。


構成例
イーサネット1/1インターフェイスのアクセス ポート(タグなしnative-vlan)として、VLAN 10タグ付きVLAN 20とVLAN 1を割り当ててみましょう。以下は設定例です。

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


次のコマンドを使用して、構成を確認します。
 

show vlan and show run interface <interface id>


出力例

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#


 

インターフェイスからVLANを削除します。

構成構文

Configuration

説明

DELLSONiC# configure

設定モードを起動します

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

インターフェイスの構成

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

トランク ポートからVLANまたはVLANの範囲を削除します。VLAN範囲を指定するには、個々のVLAN IDとVLAN IDの範囲を区切って<1..4094> (-)または(,)を使用します。例:20,70-100,142

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

トランク ポートからタグなし(アクセス)を削除します。


サンプル設定

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


 

IPアドレスとMTUを設定します。

デフォルトでは、VLAN はレイヤ 2 以上にあります。IPv4アドレスとIPv6アドレスはありません。IPv4またはIPv6アドレスをVLANに手動で割り当てることができます

覚えておくべきポイント

  • VLAN MTU を設定する前に、まず VLAN メンバーで MTU を設定します。VLANのすべてのメンバーは、同じMTU値を持つ必要があります。タグ付きメンバーは、パケット タグを考慮するために、タグなしメンバーよりも 4 バイト高いリンク MTU を持つ必要があります。
  • インターフェイスに複数のIPv6アドレスを設定できます。
  • VLANでセカンダリIPアドレスを設定できます


構成構文

Configuration

説明

DELLSONiC# configure

設定モードを起動します

DELLSONiC(config)# interface Vlan <ID>

インターフェイスの構成

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

IPアドレスを追加します。

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

IPアドレスを削除します。

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

IPv6 アドレスの追加

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

IPv6アドレスを削除します。

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

MTU(1312から9216)を変更します。デフォルト:9100


サンプル設定
 

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


次のコマンドを使用して、構成を確認します。

show interface vlan <vlan id>


出力例

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.