【技術】CCNP SWITCHを受験する人が覚えておきたいコマンド【試験に出る!】

他になんかあるかな。

show関連

# show vlan [brief]:インターフェースとVLANの紐付け
# show vtp status:VTP関連
# show interfaces [trunk / switchport]:L2インターフェース情報
# show etherchannel summary:イーサチャネル
# show ip interface brief:L3インターフェース情報
# show ip route:ルーティングテーブル
# show standby brief:HSRP

VTP関連

(config)#vtp domain <ドメイン名>:ドメイン名割当
(config)#vtp mode [server / client / transparent]:VTPモード設定

VLAN作成

(config)#vlan <ID>:VLAN作成
(config-vlan)#name <VLANの管理名>:VLANに管理名割当

SVI作成

(config)# interface vlan <ID>:SVI作成
(config-if)# ip address <IP> <mask>:IPアドレス割当
(config-if)# no shutdown:お忘れなく
(config)# ip default-gateway <IP>:デフォルトゲートウェイ設定

アクセスポート

(config-if)# swichport mode access:アクセスポートにする
(config-if)# switchport access vlan <ID>:アクセスポートにVLAN IDを割り当てる

トランクポート

(config-if)# switchport trunk encapsulation [dot1q / isl]:カプセル化プロトコル
(config-if)# switchport mode trunk:トランクポートにする
(config-if)# switchport mode dynamic [desirable / auto]:DTPネゴシエーション
(config-if)# switchport trunk allowed vlan <>:トランクで通すVLANを指定
(config-if)# switchport native vlan <>:タグ付けしないVLANを指定
(config)# vlan dot1q tag native:ネイティブVLANにもタグ付けする

イーサチャネル

(config-if)# channel-protocol [pagp / lacp]:イーサチャネルのプロトコルを明示的に指定
(config-if)# channel-group <> mode [on / desirable / auto / active / passive]:モードの組み合わせを間違えないように

STP設定

(config)# spanning-tree mode [pvst / rapid-pvst / mst]
(config)# spanning-tree vlan <ID> root [primary / secondary]:priorityを24,576 or 28,672に設定
(config)# spanning-tree vlan <ID> priority <値>:4096の倍数で指定
(config-if)# spanning-tree portfast:インターフェースにPortfastを設定
(config-if)# spanning-tree bpduguard enable:インターフェースでBPDUガード有効化
(config-if)# spanning-tree bpdufilter enable:インターフェースでBPDUフィルター有効化
(config)# spanning-tree portfast bpduguard default:BPDUガードをグローバルに有効化
(config)# spanning-tree portfast bpdufilter default:I/Fで有効化する場合と動作が異なるので注意
(config-if)# spanning-tree vlan <> port-priority <値>:ポートプライオリティの指定
(config-if)# spanning-tree guard loop:ループガード有効化

MST設定

(config)# spanning-tree mode mst:MSTモードに変更
(config)# spanning-tree mst configuration:MSTコンフィギュレーションモードへ移行
(config-mst)# instance <番号> vlan <VLAN IDs>:インスタンス番号とVLAN IDのマッピング
(config-mst)# name <>:MSTドメイン名指定
(config-mst# revision <>:リビジョン番号指定

L3関連

(config)# ip routing:ルーティング有効化
(config-if)# no switchport:物理ポートをL3ポートにする
(config-if)# ip address <IP> <mask>:IPアドレスを指定
(config-if)# no shutdown:くどいようですがお忘れなく
(config)# router [rip / ospf / eigrp] <値>:ルーティングプロトコル有効化
(config-router)# network <IP> <wildcard>:ワイルドカードで指定なので注意
(config-router)# no auto-summary:RIP、EIGRPの場合

SPAN関連

(config-vlan)# remote-span:VLANをRSPAN VLANにする
(config)# monitor session <> source [interface / vlan / remote vlan] [encapsulation replicate]:送信元ポート指定
(config)# monitor session <> destination [interface / vlan / remote vlan]:宛先ポート指定
(config)# monitor session <> filter vlan <>:SPANで転送するVLANを絞る時に

VACL

(config)# ip access-list <ACL番号> [permit / deny] [ip / tcp / udp] [host / any / <IP>] [host / any / <IP>] <ポート番号>:IPアクセスリストを作成
(config)# vlan access-map <マップ名> <sequence>:VLANアクセスマップ作成
(config-access-map)# match ip address <ACL番号>:IPアドレスの条件指定
(config-access-map)# action [drop / forward]:条件に一致した場合の動作
(config)# vlan filter <マップ名> vlan-list <VLAN IDs>:VLANアクセスマップをVLANに適用

AAA関連

(config)# aaa new-model:AAA有効化
(config)# radius server <config-name>:サーバー名を指定
(config-radius-server)# address ipv4 <IP> [auth-port]:サーバーのIPアドレスを指定
(config-radius-server)# key <keystring>:サーバーとの共通鍵stringを指定
(config)# aaa group server radius <group-name>:サーバーグループ作成
(config-sg-radius)# server name <config-name>:サーバー名を指定してグループに追加
(config)# radius-server host <IP> key <string>:RADIUSサーバーの登録(旧コマンド)
(config)# aaa authentication login <リスト名> <> <> ...:ログイン認証リスト作成
(config-line)# login authentication <リスト名>:ラインにログイン認証リストを適用

IEEE802.1X

(config)# aaa authentication dot1x default group <グループ名>:IEEE802.1X認証リスト作成
(config)# dot1x system-auth-control:IEEE802.1X有効化
(config-if)# dot1x port-congrol [auto / force-authorized / force-unauthorized]:ポート単位で有効化(旧コマンド)
(config-if)# authentication port-control [auto / force-authorized / force-unauthorized]:ポート単位で有効化(新コマンド)

DHCPスヌーピング

(config)# ip dhcp snooping:DHCPスヌーピング有効化
(config)# ip dhcp snooping vlan <>:DHCPスヌーピングを有効化するVLANを指定
(config-if)# ip dhcp snooping trust:インターフェースを信頼I/Fにする