Cisco 1812Jに管理VLAN設定

更新:2020/09/16
はじめに
 Cisco(シスコ) 1812Jを、CCNAの勉強用に手に入れたので初期設定を含めて、スイッチポートにipアドレスを振ってtelnetできるようになるまで過程のメモです。


初期化
Router#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete

// vlanの設定が残っているか確認する
Router#show flash:
-#- --length-- -----date/time------ path
1     17489068 Dec 1 2012 04:24:28 +00:00 c181x-advipservicesk9-mz.124-6.T11.bin
2         3423 Sep 7 2012 01:03:46 +00:00 cpconfig-1811-1812.cfg
3      3000320 Sep 7 2012 01:04:04 +00:00 cpexpress.tar
4         1038 Sep 7 2012 01:04:16 +00:00 home.shtml
5       122880 Sep 7 2012 01:04:26 +00:00 home.tar
6          660 Sep 15 2020 14:47:08 +00:00 vlan.dat //「vlan.dat」が、あったら消す

44560384 bytes available (20627456 bytes used)

Router#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]

// 残ってるvlanの設定を消す
Router#reload

System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm]
︙
// 再起動するまで、しばらく待つ
︙
初期設定
// ホストネームを変更
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname 1812J
1812J(config)#

// イネーブルシークレットパスワード
1812J(config)#enable secret {パスワード}

// ・コンソールパスワード
// ・タイムアウトの無効化
// ・デバッグ文によるコマンド入力の中断を防ぐ
1812J(config)#line console 0
1812J(config-line)#password {パスワード}
1812J(config-line)#login
1812J(config-line)#exec-timeout 0 0
1812J(config-line)#logging synchronous
1812J(config-line)#exit

// ・仮想端末パスワード
// ・タイムアウトの無効化
// ・デバッグ文によるコマンド入力の中断を防ぐ
// ・telnetの許可
1812J(config)#line vty 0 4
1812J(config-line)#password {パスワード}
1812J(config-line)#login
1812J(config-line)#exec-timeout 0 0
1812J(config-line)#logging synchronous
1812J(config-line)#transport input telnet
1812J(config-line)#exit
インターフェースにipアドレスを設定する
// VLANの作成
1812J#vlan database
1812J(vlan)#vlan 100
1812J(vlan)#exit

// VLANにipアドレスを設定
1812J#configure terminal
1812J(config)#interface vlan 100 // さっき作ったVLAN
1812J(config-if)#ip address 192.168.2.100 255.255.255.0 //割り当てたいipアドレスと、そのサブネットマスク
1812J(config-if)#no shutdown
1812J(config-if)#exit

// インターフェースにVLANを割り当てる
1812J(config)#interface FastEthernet 9
1812J(config-if)#switchport mode access
1812J(config-if)#switchport access vlan 100
関連記事