VLAN

ちょっと、後で整理致します。
適当にメモ程度で書いておきます。


Console(config)#vlan database 4-170
Console(config-vlan)#vlan 2 name R&D media ethernet state active 4-170
Console(config-vlan)#end
Console#show vlan 4-177

【レポートの追加】


Console(config)#interface ethernet 1/1 4-124
Console(config-if)#switchport allowed vlan add 2 tagged 4-175
Console(config-if)#exit
Console(config)#interface ethernet 1/2
Console(config-if)#switchport allowed vlan add 2 untagged
Console(config-if)#exit
Console(config)#interface ethernet 1/13
Console(config-if)#switchport allowed vlan add 2 tagged

【余分なポート削除】


Console(config-if)#switchport allowed vlan remove 2

次の例は、ポート 1 が VLAN 3 に追加されないようにする方法を示しています。
VLAN 情報表示

show vlan

このコマンドでは、VLAN 情報を表示します。
構文
show vlan [id vlan-id | name vlan-name]
? id - VLAN ID の前に付くキーワードです。
 - vlan-id - 構成された VLAN の ID です(範囲:1 〜 4094、先頭に 0 は付けません)。
? name - VLAN 名の前に付くキーワードです。
 - vlan-name - 1 〜 32 文字の ASCII ストリングです。
デフォルト設定
すべての VLAN を表示します。
コマンド モード

Normal Exec、Privileged Exec
Console(config)#interface ethernet 1/1
Console(config-if)#switchport forbidden vlan add 3

no switchport forbidden vlan

switchport forbidden vlan remove 1

作業履歴
【VLAN作成】


Console#configure
Console(config)#vlan database
Console(config-vlan)#vlan 10 name VPN(192.168.156.0/24) media ethernet state active
Console(config-vlan)#end

【VLAN設定】


Console#configure
Console(config)#interface ethernet 1/1
Console(config-if)#switchport allowed vlan add 10
Console(config-if)#switchport native vlan 10
Console(config-if)#switchport allowed vlan remove 1
Console(config-if)#end

【VLAN内容確認】


Console#show vlan
VLAN Type Name Status Ports/Channel groups
---- ------- ---------------- --------- ----------------------------------------
1 Static DefaultVlan Active Eth1/ 2 Eth1/ 3 Eth1/ 4 Eth1/ 5 Eth1/ 6
Eth1/ 7 Eth1/ 8 Eth1/ 9 Eth1/10 Eth1/11
Eth1/12 Eth1/13 Eth1/14 Eth1/15 Eth1/16
Eth1/17 Eth1/18 Eth1/19 Eth1/20 Eth1/21
Eth1/22 Eth1/23 Eth1/24
10 Static VPN(192.168.0.0/24) Active Eth1/ 1

【固定IPの設定】


Console#configure
Console(config)#interface vlan 10
Console(config-if)#ip address 192.168.156.15 255.255.255.0
Console(config-if)#exit
Console(config)#ip default-gateway 192.168.156.1
Console(config)#end

Console#show ip interface
IP address and netmask: 192.168.156.15 255.255.255.0 on VLAN 10,
and address mode: User specified.