忍者ブログ
ネットワークセキュリティやってます。技術よりも趣味と雑談が多めのブログです。最近はオンライン英会話にはまっています。

2024-04

カレンダー
03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
アーカイブ
カウンター
ブログ内検索
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

先日紹介した3560コンフィギュレーションガイドで気になった機能「SmartPortマクロ」のメモです。
ちょうど、今IEWBのラボ19をやっているところで偶然にもこの設定に関する内容がありました。

SmartPortマクロとは、
共通の設定を保存および共有するに便利なもの。

例えば、スイッチのいくつかのポートに対して以下の共通設定を行うとする

switchport mode access
switchport access vlan 10
switchport port-security
switchport port-security maximum 2
switchport port-security mac-address sticky
switchport port-security aging type inactivity
switchport port-security violation shutdown

各ポートに対して上のような7個のコマンドをそれぞれに対して投入する必要がある。
途中で入力ミスがあるとうまくスイッチが働いてくれません。
なので、こういう時にSmartPortマクロを使えば簡単に設定できるわけです。
さらに、define interface を使えば複数のインターフェースを一括して設定できるので、従来と比べて打ち込むコマンドライン数がちょっと増えるだけで全てのポートに同様な設定が入るわけ。

例として、Fastether 0/1 - 8 までの8個のポートに対して先程の設定をしてみます。

Fa0/1 からFa0/8までをF1to8と名づけて束ねる
M3560-C(config)#define interface-range F1to8 fastEthernet 0/1 - 8
SmartPortマクロの中身、変数は$で始まる、Perlみたいですね
M3560-C(config)#macro name ALLPORT
Enter macro commands one per line. End with the character '@'.
switchport mode access
switchport access vlan $vlan
switchport port-security
switchport port-security maximum $max
switchport port-security mac-address sticky
switchport port-security aging type inactivity
switchport port-security violation shutdown
@
一括設定の適用
M3560-C(config)#interface range macro F1to8
M3560-C(config-if-range)#macro apply ALLPORT $vlan 10 $max 2
最後に#sh runで確認する
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/2
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/3
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/4
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/5
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/6
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/7
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT 
 dot1x pae authenticator
 dot1x reauthentication
!
interface FastEthernet0/8
 switchport access vlan 10
 switchport mode access
 switchport port-security maximum 2
 switchport port-security
 switchport port-security aging type inactivity
 switchport port-security mac-address sticky
 macro description ALLPORT
 dot1x pae authenticator
 dot1x reauthentication

こんな感じでSmartPortマクロの便利さを分かっていただけたとおもいます。
もっと詳しくは3560コンフィギュレーションガイドの11章で。

PR
この記事にコメントする
お名前:
タイトル:
文字色:
メールアドレス:
URL:
コメント:
パスワード:   Vodafone絵文字 i-mode絵文字 Ezweb絵文字
この記事へのトラックバック
この記事にトラックバックする:
著書




プロフィール
HN:
ぜん吉
性別:
男性
職業:
割と自由なリーマン
趣味:
海外出張
自己紹介:
2006年のCCNA合格を皮切りにCCIE-RSを含めて数々のシスコ資格をパスし、2009年に念願の海外受験(ドバイ)でCCIE-SCを取得。そして、2010年に目標だったトリプルCCIEを香港の地にて達成した。今はネットワークセキュリティやデータ分析などをやっています。

■2006年の目標
CCNA(達成)

■2007年の目標
CCNP(達成)
CCDA(達成)
CCDP(達成)
CCIP(達成)

■2008年の目標
CCSP(達成)
CCIE-RS(達成)
TOEIC700点(達成)

■2009年の目標
CCIE-Sec(達成)
TOEIC800点(達成)
JNCIA-JUNOS(達成)

■2010年の目標
JNCIA-M(達成)
CCIE-SP(達成)
JNCIS-M(達成)
JNCIA-EX(達成)
JNCIS-SEC(達成)

■2011年の目標
異動(未達成)

■2012年の目標
異動(未達成)
TOEIC850点(達成)

■2013年の目標
異動(達成)
CCIE更新(達成)

■2015年の目標
本を出す(達成)

■2017年の目標
TOEIC900(達成)
TOEIC950(達成)

■2018年の目標
英検1級(達成)

■2019年の目標
海外勤務








英会話







忍者ブログ [PR]
by 桜花素材サイト様. . . .