今日は実証実験つき。

やっぱり実際にやってみるっていうのは大切です。 ま、シミュレーターですが。

PCを4台用意して相互に疎通確認をする、というものだったんですが、

今思えば3台でもよかったんだよなぁ。

・・・あ、2台でもできるか。


宝石ブルー スタティックVLAN

スタティックVLANとはスイッチのポートそれぞれにVLANを割り当てる方式。「ポートVLAN」とも呼ばれます。

ポートが所属するVLANをスイッチの設定で固定(スタティック)させるのが特徴で、ポートに接続する機器が変わってもVLANはかわることはありません。

各ポートは、ポートをVLAN番号に関連付けるPVID(Port VLAN ID)を受け取ります。


宝石ブルー スタティックVLANの設定
実験:同じネットワークアドレスメモ を設定したPC4台を、2台ずつ別々のVLANを割り振った

スイッチポートに繋ぐ。

通常同じネットワークアドレスならば4台のPCが相互に疎通できるはずだが、

VLANで仕切られているならば疎通はできなくなるはず。


ポートにVLAN100を設定したポートにPC1とPC2を、

VLAN200を設定したポートにPC3とPC4を接続。


PC1(192.168.0.1/24)からPC2(192.168.0.2/24)とPC3(192.168.0.3/24)それぞれにPingしてみる。

BCMSN_002  ※図2 スタティックVLAN実験環境

※VLANを定義します。
switch>ena
switch#vlan database
switch(vlan)#
vlan 100 name vlan0100

VLAN 100 added:
Name: vlan0100
switch(vlan)#vlan 200 name vlan0200
VLAN 200 added:
Name: vlan0200
switch(vlan)#exit
APPLY completed.
Exiting....

※定義したVLANが登録されています。
switch#show vlan

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
100 vlan0100 active
200 vlan0200 active

1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

※インターフェースにVLANを割り当てます。
switch#conf t
Enter configuration commands, one per line. End with CNTL/Z
switch(config)#
interface fastethernet 0/1
switch(config-if)#
switchport access vlan 100
switch(config-if)#
no shut
switch(config-if)#
exit


switch(config)#int fa 0/2
switch(config-if)#switchport access vlan 100
switch(config-if)#no sh
switch(config-if)#no shutdown
switch(config-if)#exit

switch(config)#int fa 0/3
switch(config-if)#switchport access vlan 200
switch(config-if)#no sh
switch(config-if)#exit

switch(config)#int fa 0/4
switch(config-if)#switchport access vlan 200
switch(config-if)#no sh
switch(config-if)#exit

switch(config)#exit

※VLANが割り当てられていることを確認します。
switch#sh vlan

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
100 vlan0100 active Fa0/1, Fa0/2
200 vlan0200 active Fa0/3, Fa0/4
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

switch#


[ここからはエンドデバイス(PC)のコマンドプロンプトです]

※IPアドレス「192.168.0.1」のエンドデバイスからPINGを打ちます。

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

C:\>ping 192.168.0.2

Pinging 192.168.0.2 with 32 bytes of data:

Reply from 192.168.0.2 ;bytes=32 time=22ms TTL=254 ←疎通OK!
Reply from 192.168.0.2 ;bytes=32 time=22ms TTL=254
Reply from 192.168.0.2 ;bytes=32 time=22ms TTL=254
Reply from 192.168.0.2 ;bytes=32 time=22ms TTL=254

Ping Statistics for 192.168.0.2:
Packets Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 22ms, Maximum = 23ms, Average = 22ms
C:\>ping 192.168.0.3

Pinging 192.168.0.3 with 32 bytes of data:

Request timed out. 
←VLAN IDが異なるエンドデバイスのため、疎通ができません。
Request timed out.
Request timed out.
Request timed out.

Ping Statistics for 192.168.0.3:
Packets Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.0.4

Pinging 192.168.0.4 with 32 bytes of data:

Request timed out. 
←VLAN IDが異なるエンドデバイスのため、疎通ができません。
Request timed out.
Request timed out.
Request timed out.

Ping Statistics for 192.168.0.4:
Packets Sent = 4, Received = 0, Lost = 4 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>


設定できるVLAN番号は1~1005。

スイッチがVTPトランスペアレントモードで設定されている場合は1~4094を使用できます。

(VTPについては近日紹介)


VLANの設定情報はVLANデータベースと呼ばれ、「vlan.dat」というコンフィグレーションメモ ファイルとは別のファイルでフラッシュメモリに保管されます。