メモのページ - チラシの裏メモ 3枚目

通信技術や気になった事を黙々とメモし続ける

Catalyst6503のConfigテンプレ (SUP32編)

家に鎮座するCatalyst6503のConfigのテンプレ。

初期化後やconfigのバックアップを誤って消去してしまった場合に、以下を貼り付け。
ただし、以下の出力内容はCatalyst6503 IOSバージョン12.2(33)SXJ8のデフォルト設定ではない。
これまでに居た複数の案件見てきたデータセンタのコアSWに入っていた設定を、Home Lab用にカスタマイズした内容になっている。
Routing、ACL、SNMP、NTP、TACACS等一部の設定は省略している。

環境
・IOSバージョン:12.2(33)SXJ8
(s3223-ipservicesk9_wan-mz.122-33.SXJ8.bin)
・SUP:WS-SUP32-GE-3B
・筐体:WS-C6503

以下はshow configの出力結果。
デフォルト設定何だっけ?という場合はshow running-config allコマンド(allオプション付き)を打つ。

MI-CAT6503-S32-SW-01#show configuration
!
!
upgrade fpd auto

!!FPD(Field-Programmable Device)自動Up Gradeが有効
config-register 0x2102
!!NVRAMからConfigを読み込むようにする (念の為の設定)
version 12.2
service nagle
!!TCP接続ではキー入力毎ではなくある程度貯めてから送信
no service pad
!!PAD(Packet Assembler/Disassembler)とAccess Server間の接続を無効
service tcp-keepalives-in
!!停止したinteractive sessionによってVTYが解放されない状態を防ぐ
service tcp-keepalives-out
!!停止したinteractive sessionによってVTYが解放されない状態を防ぐ
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
!!Command出力の際にTime Stampを表示
!!Log出力の際にEvent発生時刻を表示
service password-encryption
!!Login Passwordを暗号化
service sequence-numbers
!!Log出力の際にSequence番号を表示
service counters max age 10
!!SystemがInterface等の統計値を最大10秒間保持する
no service dhcp
!!DHCP Serviceの無効化
no service config
!!起動時にNW上からConfigを読み込む必要が無い為に無効にする
no service tcp-small-servers
no service tcp-small-servers

!!TCP/UDP Smallサーバ機能は使用しない為無効にする
!
hostname MI-CAT6503-S32-SW-01
!
boot system flash disk0:s3223-ipservicesk9_wan-mz.122-33.SXJ8.bin
boot system flash sup-bootdisk:s3223-ipservicesk9_wan-mz.122-33.SXJ8.bin

!!起動させたいバージョンおよびFeature SetのIOSファイルを指定
!!disk0:(CF Card Slot)とsup-bootdisk(Mother Board上のCF Card Slot)の両方を指定した場合は、sup-bootdisk:で指定したIOSがシステムに読み込まれる
!!STPを使用するレガシィなNW構成、且つIPX/AppleTalk/DECnet等は不要である為、Feature Setはadventerprisek9ではなくipservicesk9で充分。
logging buffered 40960 debugging
!!Log Messageを内部バッファに40960byte保存
logging rate-limit console 10
!!Consoleに出力されるMessageをlogging severity level10で制限
logging monitor informational
!!TerminalへのLog出力レベルが10
enable secret cisco
!
username cisco secret cisco
!
aaa authentication login default local

!!!AAA認証によるログインを有効にする
!
aaa new-model
 !!!AAA認証が有効
aaa session-id common
clock timezone JST 9
  
!!出力される時刻を日本時間に
ip subnet-zero !!Subnet0が有効
no ip source-route !!IP Source Routingが無効
no ip gratuitous-arps
!!宛先MAC Addressが送信元MAC Addressと同じになるMappingをしない
!
!
!
ip cef table event-log size 1024

!!CEF Event Logを1024byte保存
no ip bootp server
!!BOOTP Serviceを無効
ip tcp path-mtu-discovery
!!Path MTU Discoveryが有効
no ip domain-lookup
!!Domain Nameからの名前解決Serviceが無効
ip domain-name hoge.net
!!上記で名前解決Serviceを無効にしているが、認証設定などで上記の行は必要な場合有り。hoge.netの所は任意の文字列でOK
vtp mode transparent
!!VTP Modeを透過(Transparent)にする
mls ip multicast consistency-check type rp-sp
!!L3 SwitchingにおけるShort Cut整合性を検査
no mls acl tcam share-global
!!ACL TCAMリソースを共有
!
!
!
!

!! 以下は、err-disableでポートが閉塞した際の自動復旧設定
!! err-disable発生後60秒で自動復旧する
errdisable recovery cause udld
errdisable recovery cause bpduguard
errdisable recovery cause channel-misconfig
errdisable recovery cause pagp-flap
errdisable recovery cause dtp-flap
errdisable recovery cause link-flap
errdisable recovery cause l2ptguard
errdisable recovery cause dhcp-rate-limit
errdisable recovery cause unicast-flood
errdisable recovery cause arp-inspection
errdisable recovery interval 60
!
!
!
redundancy
main-cpu
auto-sync running-config

!!startup-configをStandby SUPと同期、SlUPが1枚だけなら不要な設定
mode sso  
!!SSO(Stateful Switch Over)機能を有効
!
spanning-tree mode rapid-pvst

!!RSTP(Rapid-PVST)が有効
spanning-tree portfast bpduguard default
!!PortFastが設定されているポートでBPDU Guard機能が有効
spanning-tree extend system-id
!!拡張System IDが有効
spanning-tree pathcost method long
!!PortのSTP Path Costに32bit値を使用
diagnostic bootup level complete
!!Bootup時のオンライン診断を完全実施
diagnostic cns publish cisco.cns.device.diag_results
!!CNS診断結果をRemote Network Applicationに送信
diagnostic cns subscribe cisco.cns.device.diag_commands
!!CNS診断結果をRemote Network Applicationから受信
fabric timer 15
!!Fabricのdrop counterのTime Stampやpeak utilizationのPolling Timeを設定
!
vlan internal allocation policy ascending
!!拡張範囲にある内部VLANを1006から上方向に割当て
!
!
!
!

!!以下はLoopbackインターフェース
interface Loopback0
ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx

!!Loopbackインターフェースは,OSPFやEIGRPやBGPのrouter-idや管理用インターフェースやTFTPによるファイル転送用インターフェースとして使用
no ip redirects
no ip proxy-arp
no ip unreachable
logging event link-status
!

!!以下はtrunk/access, Port-channelインターフェース
!!VLAN1は使用しない
interface xxxxxx
description xxxxxx
switchport
switchport trunk encapsulation dot1q
switchport trunk native vlan
![VLAN1以外]
switchport trunk allowed vlan ![VLAN ID]
switchport mode trunk
no ip address
logging event link-status

!!インターフェースのLink Up/Downをsyslogに出力させる
logging event trunk-status1
!!Trunkのステータス変化をsyslogに出力させる
load-interval 30
!!インターフェースのLoad計算に利用するデータの計測間隔を指定
channel-group x mode active
no shutdown
!

!!以下はL3 インターフェース
!!bandwidthとdelayはEIGRPを喋るインターフェースにて設定
interface xxxxxx
description xxxxxx
bandwidth xxxxxx
ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
no ip redirects

!!ICMPリダイレクトメッセージ(パケットの転送先を通知)を無効化
no ip proxy-arp
!!代理ARP機能を無効化
no ip unreachable
!!ICMP到達不能通知を送信元に返さない
logging event link-status
load-interval 30
delay xxx
no shutdown
!

!!以下は未使用インターフェース
!!VLAN1は使用せず1000など使用されなさそうなVLAN IDを付ける
!!未使用な物理Interfaceはセキュリティ上の観点より基本的に閉塞で
interface xxxxxx
description Unused Port
switchport
switchport access vlan 1000
switchport mode access
logging event link-status
load-interval 30
shutdown

!
!

!!Vlan1は未使用
interface Vlan1
no ip address
shutdown
!

!! SVI
!!VLAN Databaseに載っている全てのVLANにIP Addressを設定する必要はない
interface Vlan xxx
description xxxxxx
bandwidth xxxxxx
ip address xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
no ip redirects
no ip proxy-arp
logging event link-status
load-interval 30
delay xxx
no shutdown
!
!
!
ip classless

!!Default Route使用時にRouting Tableに無いSubnet宛てにトラヒックを転送
no ip forward-protocol udp netbios-ns
!!DHCP Relay Agent機能でNETBIOS-NS ServiceのUDP Broadcast転送無効
no ip forward-protocol udp netbios-dgm
!!DHCP Relay Agent機能でNETBIOS-DGM ServiceのUDP Broadcast転送無効
!
no ip http server
 !!HTTP Serviceを無効(Catalyst6500へのHTTP接続を無効)
no ip http secure-server !!HTTPS Serviceを無効(Catalyst6500へのHTTPS接続を無効) 
!
logging trap notifications

!!Notificationレベル以上のLogをSyslog Serverへ出力
logging monitor informational
!!TerminalへのSyslog出力レベルを情報メッセージ以上のものにする
logging facility local4
!!Syslog Serverに出力するSyslogレベルを警告以上のものにする
logging source-interface Loopback 0
!!Syslog情報をSyslog Serverに送信する際、Loopback 0 Interfaceを使用 (論理Interface推奨)
!
!
dial-peer cor custom

!!CORをDial Peerに適用する有意な名前を割当
!
!
!
banner motd ^
////////////////////////////////////////
Hostname:MI-CAT6503-S32-SW-01
System Name:Catalyst 6503
Firmware ver:12.2(33)SXJ8
Location:Mitaka,Tokyo
////////////////////////////////////////
^

!!Bannerは商用環境ではIOSバージョンや設置位置の記載は不要
!
line con 0
exec time-out 5 0

!!ログイン後から自動的にログアウトされるまでの時間を指定
password cisco
login authentication default

!!Local Database(username 〜で指定したUserIDとパスワード)でログイン
line vty 0 4
exec time-out 5 0

!!ログイン後から自動的にログアウトされるまでの時間を指定
password cisco
login authentication default

!!Local Database(username 〜で指定したUserIDとパスワード)でログイン
transport input telnet ssh
transport input telnet ssh

!!!ログイン方法の指定
line vty 5 15
exec time-out 5 0

!!ログイン後から自動的にログアウトされるまでの時間を指定
password cisco
login authentication default

!!Local Database(username 〜で指定したUserIDとパスワード)でログイン
transport input telnet ssh
transport input telnet ssh

!!!ログイン方法の指定
!
no cns aaa enable
end
!


....ところで、自分の環境にて動作しているIP Service版(s3223-ipservicesk9_wan-mz.122-33.SXJ8.bin)と、機能フル搭載なAdvanced Enterprise Services版(s3223-adventerprisek9_wan-mz.122-33.SXJ8.bin)を比較すると、IP Service版側で有効に出来ない主な機能は以下のとおり。

AToM
Apple Talk
BACP (Bandwidth Allocation Control Protocol)
DLSw
IPX
MPLS
Multi-Protocol BGP
NetFlow version9 Export Format
VPLS
VPNSM

これらの機能が不要であれば、欲張ってAdvanced Enterprise Service版にせずIP Service版で充分。
後で使うかもしれない? それは要件定義が不十分という事。