

conf t
!
hostname RT1
!
interface Ethernet0/0
ip address 10.1.10.1 255.255.255.0
no shutdown
!
logging console
!
end
conf t
!
hostname RT2
!
interface Ethernet0/0
ip address 10.1.20.2 255.255.255.0
no shutdown
!
logging console
!
end
conf t
!
hostname RT3
!
interface Ethernet0/0
no shutdown
!
interface Ethernet0/0.10
encapsulation dot1Q 10
ip address 10.1.10.3 255.255.255.0
no shutdown
!
interface Ethernet0/0.20
encapsulation dot1Q 20
ip address 10.1.20.3 255.255.255.0
no shutdown
!
logging console
!
end
conf t
!
hostname SW1
!
vlan 10,20
!
interface Ethernet0/0
switchport access vlan 10
switchport mode access
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 20
switchport mode trunk
!
interface Ethernet0/2
switchport access vlan 20
switchport mode access
!
logging console
!
end
conf t
!
hostname SW2
!
vlan 10,20
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 10,20
switchport mode trunk
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 20
switchport mode trunk
!
logging console
!
end
trunk port において、native vlan という概念があります。
これは、trunk port で送受信したフレームに対して tag を付与しない特別な vlan です。
default では vlan1 が native vlan として割り当てられており、SW 間の管理系通信にも native vlan が使用されます。
今回は native vlan の変更方法に加え、packet capture を行うことで実際に tag が付与されていないことを確認します。
ハンズオンのはじめに SW2 に対して以下の Config を追加してください。
※CML の仕様で export した構成 (config) に vlan を含められません。
SW2(config)#vlan 10,20
今回の構成は SW1 - SW2 間が trunk port になっており、現状は以下にようになっています。
native vlan : 1
allowed vlan : 20
SW1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/1 20
Port Vlans allowed and active in management domain
Et0/1 20
Port Vlans in spanning tree forwarding state and not pruned
Et0/1 20
SW2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Et0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/0 10,20
Et0/1 20
Port Vlans allowed and active in management domain
Et0/0 10,20
Et0/1 20
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 10,20
Et0/1 20
そのため、現在は RT1 - RT3 (VLAN10) は通信できず、RT2 - RT3 (VLAN20) は通信可能な状態となっています。
RT1#ping 10.1.10.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
RT2#ping 10.1.20.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.20.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
今回は SW1 - SW2 間の native vlan を 10 に変更し、SW1 - SW2 間は vlan を tag なしで通信できるように設定を行っていきます。
native vlan は以下の方法で変更が可能です。
また、native vlan を変更した場合は allowed vlan にも追加が必要となります。
(config-if)#switchport trunk native vlan [vlan id]
(config-if)#switchport trunk allowed vlan add [vlan id]
今回は SW1, SW2 に対して以下のように設定を行います。
SW1(config)#interface ethernet0/1
SW1(config-if)#switchport trunk native vlan 10
SW1(config-if)#switchport trunk allowed vlan add 10
SW2(config)#interface ethernet0/1
SW2(config-if)#switchport trunk native vlan 10
SW2(config-if)#switchport trunk allowed vlan add 10
設定後 show command で確認すると、各機器の Ethernet0/1 に設定内容が反映されていることがわかります。
SW1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/1 on 802.1q trunking 10
Port Vlans allowed on trunk
Et0/1 10,20
Port Vlans allowed and active in management domain
Et0/1 10,20
Port Vlans in spanning tree forwarding state and not pruned
Et0/1 10,20
SW2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Et0/1 on 802.1q trunking 10
Port Vlans allowed on trunk
Et0/0 10,20
Et0/1 10,20
Port Vlans allowed and active in management domain
Et0/0 10,20
Et0/1 10,20
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 10,20
Et0/1 10,20
設定が完了したため、RT1 - RT3 (VLAN10) 間で疎通確認を行います。trunk port 間で vlan が許可されたため通信に成功していることがわかります。
RT1#ping 10.1.10.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
続いて本当に tag が付与されていないのか packet capture を行います。
CML の SW1 - SW2 間のケーブルを右クリックするとポップアップが表示されるため、「Packet Capture」をクリックします。

すると新しくコンソールが表示されるため、「START」をクリックします。

この状態でまずは RT2 - RT3 (VLAN20) の疎通確認を行います。
RT2#ping 10.1.20.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.20.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
すると、「Packet Capture」のコンソールに ICMP が表示されました。
一覧から対象通信をクリックすると詳細が見えるため、1つクリックしてみます。
「802.1Q Virtual LAN ID:20」と記載されており、 vlan tag が含まれていることがわかります。


続いて RT1 - RT3 (VLAN10) 間で疎通確認を行います。
※もし packet capture が止まってしまっていたら、疎通確認前に再度
「START」を押してください。
RT1#ping 10.1.10.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
すると、「Packet Capture」のコンソールに ICMP が表示されました。
一覧から対象通信をクリックすると詳細が見えるため、1つクリックしてみます。
「802.1Q Virtual LAN」と記載がなく、 vlan tag が含まれていないことがわかります。


このように、native vlan に指定された vlan は trunk port でも tag が付与されずに処理されることがわかります。
通信フローは以下の通りです。

trunk port や sub interface は一般的に使われるため、VLAN tag による処理を学ぶことは非常に重要です。
通信で経由する各機器で
といった処理を意識していきましょう。
ログインすると、進捗を保存できます。
← 2.2 スイッチポートの設定 に戻る