参考 https://www.infraexpert.com/study/vlanz10.html
VLANの作成とVLAN名の変更
(config)#
vlan [vlan番号]
(config-vlan)#
name [vlan名]
accessポート設定
(config-if)#
switchport mode access
switchport access vlan [vlan番号]
trunkポート設定
(config-if)#
switchport mode trunk
switchport trunk encapsulation [ dot1q | isl ]
↑このコマンドが通らないときは、dot1qにしか対応していない可能性がある。
allowed VLAN設定
(config-if)#
switchport trunk allowed vlan [vlan番号]
ネイティブVLAN設定
(config-if)#
switchport trunk native vlan [vlan番号]
管理VLAN設定
(config)#
interface vlan [vlan番号]
ip address [IPアドレス] [サブネットマスク]
no shutdown
VLANの削除
`#
delete flash:vlan.dat
reload
コピペ用
# VLANの作成とVLAN名の変更
(config)#
vlan [vlan番号]
(config-vlan)#
name [vlan名]
# accessポート設定
(config-if)#
switchport mode access
switchport access vlan [vlan番号]
# trunkポート設定
(config-if)#
switchport mode trunk
switchport trunk encapsulation [ dot1q | isl ]
↑このコマンドが通らないときは、dot1qにしか対応していない可能性がある。
# allowed VLAN設定
(config-if)#
switchport trunk allowed vlan [vlan番号]
# ネイティブVLAN設定
(config-if)#
switchport trunk native vlan [vlan番号]
# 管理VLAN設定
(config)#
interface vlan [vlan番号]
ip address [IPアドレス] [サブネットマスク]
no shutdown
# VLANの削除
#
delete flash:vlan.dat
reload