ciscoスイッチ
ユーザモード、特権モード、グローバルモード
Switch>ユーザモードenable
Switch#特権モードconfigure terminal
Switch(config)#
Switch(config)#no ip domain-lookup#ドメイン名検索を閉じる機能
Switch(config-line)#logging synchronous#マウスオプションの構成
Switch(config)#hostname ccna#構成ホスト名
ccna(config)#no hostname ccna#ホスト名のキャンセル
line console 0
exec-timeout 0 0#consoleポート構成exec-timeout 5 30 5分30 s 0構成タイムアウトなし
前のレベルに戻るexit
最初に戻ってendで
#セキュリティ構成ユーザーモードでのユーザーパスワード登録
グローバルモード:
line console 0
password 123456
login
次回ログインしたパスワードを保存します.このパスワードはユーザーモードに入ったときのパスワードです.
特権モードのパスワードの設定:
グローバルモードでenable secret 123456暗号化されたパスワードを構成
#telnetパスワードの設定
Switch(config)#line vty 0 3#最大4人登録可能
Switch(config-line)#pas
Switch(config-line)#password 123456
Switch(config-line)#login
Switch(config-line)#
##################################################################
Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
Switch#w#wrまたはwのどちらでも試してみてください
Building configuration...
[OK]
Switch#
#特権モードでreloadはシステムの再起動を表します
Switch#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch#
#スイッチの管理ポートの構成
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shu
Switch(config-if)#no shutdown
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
Switch(config-if)#
##スイッチのデフォルトゲートウェイの設定
Switch(config)#ip default-gateway 192.168.1.254
Switch(config)#no ip domain-lookup#ドメイン名検索を閉じる機能 line console 0Switch(config-line)#logging synchronous Switch(config-line)#exec-timeout 0 0
セキュリティの追加
#ポートのステータスの表示
Switch#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES manual down down
FastEthernet0/2 unassigned YES manual down down
FastEthernet0/3 unassigned YES manual down down
FastEthernet0/4 unassigned YES manual down down
###############構想を整理する
1.ホスト名の構成
hostname
2.クロック同期
clock timezone GMT 8
3.ルータを構成するmotd
banner motd #Hello , This is a LAB of ccietea.com#
4.consoleポートの構成
R1(config)# line console 0 !! コンソールポートに入る
R1(config-line)# no exec-time !! コンフィギュレーションconsoleはタイムアウトしません.コマンドexec-time 0も使用できます.
R1(config-line)# logging synchronous !! コンソールのログ同期機能を構成し、コマンドラインインタフェースでポップアップされたログ情報がユーザーが入力中の構成コマンドを中断しないようにします.
R1(config-line)# exit
R1(config)# no ip domain lookup !! ドメイン名解析をオフにして、特権モードでコマンドを間違えてドメイン名解析に陥る過程を防ぐ
5.パスワード構成第一consoleポートパスワード特権パスワード
グローバルモード:
line console 0
password 123456
login
次回ログインしたパスワードを保存します.このパスワードはユーザーモードに入ったときのパスワードです.
特権モードのパスワードの設定:
グローバルモードでenable secret 123456暗号化されたパスワードを構成
6.telnetパスワードの設定
R1(config)# line vty 0 4 !! VTY 0-4ラインへ
R1(config-line)# password ccietea !! VTY回線パスワード、すなわちユーザがtelnetを介してルータに登録する際に入力するパスワードを設定する
R1(config-line)# login !! Telnetを本装置にログインさせるにはパスワード検証が必要です
R1(config-line)# exit
Switch>ユーザモードenable
Switch#特権モードconfigure terminal
Switch(config)#
Switch(config)#no ip domain-lookup#ドメイン名検索を閉じる機能
Switch(config-line)#logging synchronous#マウスオプションの構成
Switch(config)#hostname ccna#構成ホスト名
ccna(config)#no hostname ccna#ホスト名のキャンセル
line console 0
exec-timeout 0 0#consoleポート構成exec-timeout 5 30 5分30 s 0構成タイムアウトなし
前のレベルに戻るexit
最初に戻ってendで
#セキュリティ構成ユーザーモードでのユーザーパスワード登録
グローバルモード:
line console 0
password 123456
login
次回ログインしたパスワードを保存します.このパスワードはユーザーモードに入ったときのパスワードです.
特権モードのパスワードの設定:
グローバルモードでenable secret 123456暗号化されたパスワードを構成
#telnetパスワードの設定
Switch(config)#line vty 0 3#最大4人登録可能
Switch(config-line)#pas
Switch(config-line)#password 123456
Switch(config-line)#login
Switch(config-line)#
##################################################################
Switch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Switch#
Switch#w#wrまたはwのどちらでも試してみてください
Building configuration...
[OK]
Switch#
#特権モードでreloadはシステムの再起動を表します
Switch#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch#
#スイッチの管理ポートの構成
interface vlan 1
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shu
Switch(config-if)#no shutdown
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
Switch(config-if)#
##スイッチのデフォルトゲートウェイの設定
Switch(config)#ip default-gateway 192.168.1.254
Switch(config)#
セキュリティの追加
#ポートのステータスの表示
Switch#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/1 unassigned YES manual down down
FastEthernet0/2 unassigned YES manual down down
FastEthernet0/3 unassigned YES manual down down
FastEthernet0/4 unassigned YES manual down down
###############構想を整理する
1.ホスト名の構成
hostname
2.クロック同期
clock timezone GMT 8
3.ルータを構成するmotd
banner motd #Hello , This is a LAB of ccietea.com#
4.consoleポートの構成
R1(config)# line console 0 !! コンソールポートに入る
R1(config-line)# no exec-time !! コンフィギュレーションconsoleはタイムアウトしません.コマンドexec-time 0も使用できます.
R1(config-line)# logging synchronous !! コンソールのログ同期機能を構成し、コマンドラインインタフェースでポップアップされたログ情報がユーザーが入力中の構成コマンドを中断しないようにします.
R1(config-line)# exit
R1(config)# no ip domain lookup !! ドメイン名解析をオフにして、特権モードでコマンドを間違えてドメイン名解析に陥る過程を防ぐ
5.パスワード構成第一consoleポートパスワード特権パスワード
グローバルモード:
line console 0
password 123456
login
次回ログインしたパスワードを保存します.このパスワードはユーザーモードに入ったときのパスワードです.
特権モードのパスワードの設定:
グローバルモードでenable secret 123456暗号化されたパスワードを構成
6.telnetパスワードの設定
R1(config)# line vty 0 4 !! VTY 0-4ラインへ
R1(config-line)# password ccietea !! VTY回線パスワード、すなわちユーザがtelnetを介してルータに登録する際に入力するパスワードを設定する
R1(config-line)# login !! Telnetを本装置にログインさせるにはパスワード検証が必要です
R1(config-line)# exit