2015年12月11日金曜日

やっとOSPF

リンクステート型がルーティングテーブルまでに踏む段取り

・ネイバーとアージャセンシー関係でテーブル作成

・リンクステートアドヴァタイズメントを集めて
 トポロジーテーブル(Link State Database)につっこんで
 トポロジーマップを作成

・SPFアルゴリズム-Dijkstra's alogrithmを発動しツリーを作成

・ツリーから最短パスを求めてルーティングテーブルに上げる


こんな掃きだめよりイージスさんのこちらのページで。http://www.infraexpert.com/study/ospfz1.html


エドガーデイクストラさんについてはこちらで。


30分間隔のアップデートでLSA交換で差分のみ

OSPF Hello は 224.0.0.5 デフォは10秒弱毎

OPSF Id をループバック有効の状態で一度プロセスを稼働させると、ループバックIDを削除しても、従来のループバックのIDでネイバーにHelloが届く。

スタブなOSPFルータだとこのような

OSPF-Router#debug ip ospf packet
OSPF packet debugging is on
OSPF-Router#
*Dec 10 13:09:22.879: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:09:32.671: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:09:42.667: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:09:52.271: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:10:01.863: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:10:11.135: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:10:20.907: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:10:29.971: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1
*Dec 10 13:10:39.791: OSPF-1 PAK  : rcv. v:2 t:1 l:48 rid:172.19.19.2 aid:0.0.1.21 chk:8C3B aut:0 auk: from FastEthernet1


OSPFのコスト=100(Mbps)割ることのリンクのバンドウィドゥセ


とりあえず debug ip OSPF packets で見えるタイプだけ。

タイプ1 Router LSA
タイプ4 ASBR Summary LSA
タイプ5 AS External LSA


自Q.「次の中から、OSPFの特徴として誤っているものを挙げよ。」

 1. 非・引きこもり
 2. リンクステート型
 3. 漸次集合することについて短時間
 4. コスト(帯域幅を計算値に使ったOSPF独自の値)をメトリックに使用
 5. クラスレスルーティング
 6. ABRとASBRで手動で経路を集約できる
 7. LSA交換仲間単位で分割や階層化が可能
 8. 差分だけマルチキャストでアップデート


 自A. 私は問題の出題者にはなれそうにない。


OSPF Version 2 は、この先いったい何回続くだろう。



余談:

ケンバジェンスはアメリカ英語らしい。のかな?


OSPFでは syslog 使わんとやっとれんので、ちゃんと揃えとかんと。

conf t
service timestamps debug datetime msec localtime
service timestamps log datetime msec localtime
clock timezone JST 9 0
ntp server なんちゃら
end
wr mem
show log











2015年12月10日木曜日

RIPの設定

いつものごとくイージス様から
http://www.infraexpert.com/study/distancevector6.html


ip rip send version  [ 1 | 2 | 1 2 ]
ip rip receive version  [ 1 | 2 | 1 2 ]

それからCiscoのデフォは、受信2、送信1なので、1を明示的に指定するとデフォと動きが変わるとのこと。また、デフォに戻すためには no version 2 と設定する必要があると。

なるほど・・・・・・。

また、ヴァージョン2においても自動集約が有効なので ノー オーさまりが必須とのこと。

次に、基本のところでpassive-interfaceが出てこないと思ったらここに。


以下箇条書き。


・まきしまむパスズのデフォは4、6までは設定可能でそれ以上は?

・default-information originate
 これもさすがに書いたことがないし、耳にしたこともない。

・v2では、インターフェース上で、任意の経路集約が可能。

 (config)#いんたーふぇーす なんちゃら
 (config-if)#あいぴー さまり-あどれす ぅりっぷ 172.16.0.0 255.255.248.0
  <--ここでは仮にクラスCサブネットを21ビット集約

 ただし、制約なしに集約できるわけではなく、クラス古境界をまたいで集約はNGとのこと。

・オフセットリストでホップ数加算

GW-Router(config)#router rip
GW-Router(config-router)#offset-list ?
  <0-99>       Access list of networks to apply offset (0 selects all networks)
  <1300-1999>  Access list of networks to apply offset (expanded range)
  WORD         Access-list name

GW-Router(config-router)#offset-list 10 ?
  in   Perform offset on incoming updates
  out  Perform offset on outgoing updates

GW-Router(config-router)#offset-list 10 out ?
  <0-16>  Offset

GW-Router(config-router)#offset-list 10 out 7 ?
  Async              Async interface
  Auto-Template      Auto-Template interface
  BRI                ISDN Basic Rate Interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  GigabitEthernet    GigabitEthernet IEEE 802.3z
  LISP               Locator/ID Separation Protocol Virtual Interface
  LongReachEthernet  Long-Reach Ethernet interface
  Loopback           Loopback interface
  Lspvif             LSP virtual interface
  Multilink          Multilink-group interface
  Null               Null interface
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-Template   Virtual Template interface
  Virtual-TokenRing  Virtual TokenRing
  Vlan               Vlan IEEE 802.1q
  vmi                Virtual Multipoint Interface
  <cr>

GW-Router(config-router)#offset-list 10 out 7 vlan 1
GW-Router(config-router)#

Edge-Router#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is 172.19.19.254 to network 0.0.0.0

C        172.16.1.0/24 is directly connected, Vlan1
L        172.16.1.2/32 is directly connected, Vlan1
      192.168.150.0/29 is subnetted, 1 subnets
R        192.168.150.168 [120/8] via 172.16.1.254, 00:00:00, Vlan1



・シリアルインターフェースに対する定期アップデートの停止…トリガーアップデート
Edge-Router(config)# interface interface-id
Edge-Router(config-router)# ip rip triggered


・検証
Edge-Router(config)#
Edge-Router(config)#router rip
Edge-Router(config-router)#validate-update-source ?
  <cr>

Edge-Router(config-router)#validate-update-source
Edge-Router(config-router)#no validate-update-source
Edge-Router(config-router)#validate-update-source

When a router running Routing Information Protocol (RIP) receives an update from a neighboring router, it checks whether the source of the update belongs to the same network or sub-network as the receiving interface. If they are the same, the routes are accepted for installing into the routing table. Otherwise, the update is dropped.


・アップデートパケットの送出間隔

Edge-Router(config-router)#output-delay ?
  <8-50>  Delay in milliseconds

Edge-Router(config-router)#output-delay 50
Edge-Router(config-router)#
Edge-Router(config-router)#output-delay 60
                                       ^
% Invalid input detected at '^' marker.

Edge-Router(config-router)#


・RIPネイバーの設定とセットでパッシブインターフェース化

Edge-Router(config-router)#neighbor 172.16.11.254
Edge-Router(config-router)#passive-interface vlan 1
Edge-Router(config-router)#



・RIPネイバーとの認証

Edge-Router(config)#key chain rip277keychain
Edge-Router(config-keychain)#key 120
Edge-Router(config-keychain-key)#key-string 0 ripneighorkeystring
Edge-Router(config-keychain-key)#end


Edge-Router(config)#interface vlan 1




Edge-Router(config-if)#ip rip ?
  advertise       Specify update interval
  authentication  Authentication control
  initial-delay   Specify initial delay interval
  receive         advertisement reception
  send            advertisement transmission
  v2-broadcast    send ip broadcast v2 update

Edge-Router(config-if)#ip rip authentication ?
  key-chain  Authentication key-chain
  mode       Authentication mode

Edge-Router(config-if)#ip rip authentication mode ?
  md5   Keyed message digest
  text  Clear text authentication

Edge-Router(config-if)#ip rip authentication mode md5 ?
  <cr>

Edge-Router(config-if)#ip rip authentication mode md5
Edge-Router(config-if)#ip rip ?
  advertise       Specify update interval
  authentication  Authentication control
  initial-delay   Specify initial delay interval
  receive         advertisement reception
  send            advertisement transmission
  v2-broadcast    send ip broadcast v2 update

Edge-Router(config-if)#ip rip authentication key-chain rip277keychain
Edge-Router(config-if)#






GW-Router(config)#key chain rip277keychain
GW-Router(config-keychain)#key 120
GW-Router(config-keychain-key)#key-string 0 ripneighorkeystring
GW-Router(config-keychain-key)#interface vlan 1
GW-Router(config-if)#ip rip authentication mode md5
GW-Router(config-if)#ip rip authentication key-chain rip277keychain


surpress
http://ejje.weblio.jp/content/suppress


indicate
http://ejje.weblio.jp/content/indicate

likewise
http://ejje.weblio.jp/content/likewise




















ディスタンスベクタ

distance
http://ejje.weblio.jp/content/distance

単に遠いのではなく空間的な広がりがありつつ概念的な何らかの隔たりがある距離。

vector
http://ejje.weblio.jp/content/vector


何らかの意思があって進む方向。


さておき、ディスタンスベクタにおけるルーティングアップデートを構成するいくつかの要素/機能について、以下ざっくり(*)若干ジョーキングな趣で。

* ざっくりと言っても糞芸人がDQNトークを繰り返すDQN番組とは無関係ですので念のため。



・すぷりっとほらいずん

「ねぇ、ウチの子がねぇ、こんななのよ!」
「あらぁ、あなたの子ったら、そんななのねぇ!」
「そう、ウチの子ったら、こんなだわ!」
「あらぁ、あなたの子が、まさかそんなねぇ!」

ママ友のストリートトークのようなショボくて不毛な無限カウントは、ルータの世界では起こさないということ。

 
・るーとぽいずにんぐ

「ねぇねぇ聞いてよ、ウチのダンナこんなことやらかしたの!信じられる!?」

 アタシの不幸はみんなの不幸、共感強制イイネ原理主義者の拡散希望。

ルータの世界では、インターフェースがダウンしたルータこの情報を他に伝え、伝えられたルータはぽっしびりだうん扱い。

 
・ぽいずんりばーす

「アンタのダンナやらかしたって、まだやらかしたまんまなんでしょ。」


ルータはぽっしびりだうんを保持するのみならず、最大めとりくでアップデート。地平線ぱっかーん機能が有効であるとこういった折り返しは起こさないっぽいが、毒染め返しは例外のようだ。


・ ほーるどだうんたいまー

「あいつダンナがやらかしたから今メンドクサイなー、しばらく無視しとこ。」

もしくは

「おしゃべり糞女のあいつが、しばらく静かだなー。このまんま無視しとこ。」


無視フラグを立ててから完全に忘れるまでの時間は、人それぞれで相手次第。

ディスタンスベクタでは、アップデート途絶~無効タイマがたいむいずあっぷな後にホールドダウンタイマーが作動。もしくは、ルートポイズニングなアップデートを受け取って作動。



・とりがーあっぷでーと

「ねぇ!うちのダンナぱくられなくて済んだの!!」
「アイツのダンナ、ぱくられなかったんだってさー。」
「ぱくられなかったて聞いたわ。つるんでた別の奴の話は聞いてないけど。」
「つるんでたのはどうなったんだろねー。別に聞かないけどさー。」

ママ友の拡散希望はただでさえ性質が悪いのに、メールやツィッターやSNSがさらにスマホで活用されるようになってよりいっそう悪質に。とりわけ、事件や事故ほか社会問題において情弱デマガセをまるのみ拡散希望するのが、つくづく害。

ルータでは、ステータスが変わったルートについてのみ直ちにアップデートが伝播。リンクダウンのアップデートはもとより、ポイズニング/リバースもまた。



他にメモとしては、

・R2におけるルートポイズニンでのポッシビリィダウンは、show ip routeで見れない場合もあってその際は show ip rip databaseを見る必要がある、とのこと。

・ルートポイズニンご直ちにポッシビリィダウンでホールドダウンタイマ作動

・インヴァリッドタイマのデフォは180秒にホールドダウンタイマも180秒


それからイージスさんの教えとして3点

・possibly down は  possibly なので
 ルーティングは参照されるしフォワーディングもされる

・possibly down時には 元のルータから大きなメトリックでアップデートがなされても無視
 それどころか従来と同じメトリックでアップデートがなされてもガン無視

3点というより2点目の後半として

・じゃあより小さなメトリックがきたら!?
 ホールドダウンタイマ停止-->ルーティングテーブル更新



RIPタイマーの設定については、

RIP-Router(config)#router rip
RIP-Router(config-router)#timers ?
  basic  Basic routing protocol update timers

RIP-Router(config-router)#timers basic ?
  <1-4294967295>  Interval between updates for RIP

RIP-Router(config-router)#timers basic 120 ?
  <1-4294967295>  Invalid

RIP-Router(config-router)#timers basic 120 720 ?
  <0-4294967295>  Holddown

RIP-Router(config-router)#timers basic 120 720 720 ?
  <1-4294967295>  Flush

RIP-Router(config-router)#timers basic 120 720 720 1440

RIP-Router(config-router)#


な順番。


タイマーの動作とルーティングテーブル上の状況については、自分が受ける立場、自分が送る立場をそれぞれに図にして掲載したいところなんですがこれは年末年始にでも。年末年始は、むしろ普段よりずっと忙しいんですがね。賀詞交歓会の後の酔い覚ましタイムにでも。




2015年12月9日水曜日

ダイナミックNAT PAT

・ウチの商品を使うにあたってはウチの商品についてカネを払って勉強しろ
・ウチの商品についてミスリードやイクゥイフィカルなテストに合格しろ
・ウチのテストの合格者を何人以上抱えないとオタクとの取引条件は・・・

まるでおマフィアなお商売にお虫唾が走り、しばらくお作法のお稽古をおさぼりさせていただきましたでございます。お商売もさることながら、お商品そのもののおユーザビリティもお酷いのですが。聊かお古いお話ですので現在はさすがにおマシになっているのではないでしょうか。


さておき。

まず、ぷーる。


NAT-Router(config)#ip nat pool CiscoDynamicNATtest 172.29.15.65 172.29.15.94 prefix-length 24

続いて対象ソース。

NAT-Router(config)#access-list 15 permit 172.31.11.0 0.0.0.255


プールとそーすの関連付け。

NAT-Router(config)#ip nat inside source list 15 pool CiscoDynamicNATtest


んでもってNAT対象の出入り口ないんたーふぇーすで作動設定。

NAT-Router(config)#interface FastEthernet 0
NAT-Router(config-if)#ip nat inside
NAT-Router(config-if)#exit
NAT-Router(config)#interface VLAN 1
NAT-Router(config-if)#ip nat outside
NAT-Router(config-if)#end


ところがテストpingが通らない。しばらく悩んだが問題は2つあった。ひとつは、セキュアG/W側のEIGRPの設定において、認証について設定項目が不十分だったこと。 もうひとつは、NAT後のアドレス体系についてEIGRPに再配をしていなかったこと。

で、とりあえずアドレス体系から修正しようとしたところ、


NAT-Router(config)#no ip nat pool CiscoDynamicNATtest 172.29.15.65 172.29.15.94 prefix-length 24

%Pool CiscoDynamicNATtest in use, cannot destroy

プールをいきなり削除はできないようだ。次に、

NAT-Router(config)#no ip nat inside source list 15 pool CiscoDynamicNATtest

Dynamic mapping in use, do you want to delete all entries? [no]: yes

こちらは可能だった。あらためて既存のプール設定を削除し、アドレス体系を修正したプールを設定。


さて、仮想サブネットの再配はどうするか。ここは手を抜いて次のPAT。ダイナミックの設定から手抜きで変更するには、プールとACLの紐づけを外して、outsideの定義を書き換えればいいだけか!?

(config)#$de source list 15 pool CiscoDynamicNATtest overload
%Dynamic mapping in use, cannot change

怒られた。と、遊んでいる場合ではない。

NAT-Router(config)#$ynamicNATtest 172.31.15.10 172.31.15.247 prefix-length 24
%Pool CiscoDynamicNATtest in use, cannot destroy
NAT-Router(config)#no ip nat inside source list 15 pool CiscoDynamicNATtest

Dynamic mapping in use, do you want to delete all entries? [no]: yes
NAT-Router(config)#
NAT-Router(config)#
NAT-Router(config)#$ynamicNATtest 172.31.15.65 172.31.15.94 prefix-length 24
NAT-Router(config)#no ip nat inside source list 15 pool CiscoDynamicNATtest
%Dynamic mapping not found
NAT-Router(config)#interface FastEthernet0
NAT-Router(config-if)#no ip nat inside
NAT-Router(config-if)#interface Vlan1
NAT-Router(config-if)#no ip nat outside
*Dec  8 16:16:22.703: %IP_VFR-7-FEATURE_STATUS_IN: VFR(in) is being used by other features. Will be disabled when no other feature needs VFR support on interface FastEthernet0


NAT-Router(config-if)#ip nat inside source list 15 pool CiscoDynamicNATtest overload
NAT-Router(config-if)#interface FastEthernet0
NAT-Router(config-if)#ip nat inside
NAT-Router(config-if)#interface Vlan1
NAT-Router(config-if)#ip nat outside
NAT-Router(config)#exit


ここで、dynamicの設定をPATのつもりで突っ込んでしまっていたので削除。図らずもPATのpoolでの設定がこういうもの、と知ることになったが。
 NAT-Router(config-if)#ip nat inside source list 15 pool CiscoDynamicNATtest overload

単純にoutsideのインターフェースでPAT。

NAT-Router(config)#ip nat inside source list 15 interface vlan 1 overload



#show ip nat statistics
Total active translations: 0 (0 static, 0 dynamic; 0 extended)
Peak translations: 9, occurred 02:03:59 ago
Outside interfaces:
  Vlan1
Inside interfaces:
  FastEthernet0
Hits: 366  Misses: 0
CEF Translated packets: 30, CEF Punted packets: 336
Expired translations: 86
Dynamic mappings:
-- Inside Source
[Id: 4] access-list 15 interface Vlan1 refcount 0

Total doors: 0
Appl doors: 0
Normal doors: 0
Queued Packets: 0


それから、


debug ip nat

変換前後のIPアドレスとポート番号を確認。そして、

NAT-Router#show ip nat statistics
Total active translations: 3 (0 static, 3 dynamic; 3 extended)
Peak translations: 9, occurred 02:07:54 ago
Outside interfaces:
  Vlan1
Inside interfaces:
  FastEthernet0
Hits: 428  Misses: 0
CEF Translated packets: 80, CEF Punted packets: 348
Expired translations: 89
Dynamic mappings:
-- Inside Source
[Id: 4] access-list 15 interface Vlan1 refcount 3

Total doors: 0
Appl doors: 0
Normal doors: 0
Queued Packets: 0
NAT-Router#
NAT-Router#
NAT-Router#clear ip nat translation ?
  *                   Delete all dynamic translations
  esp                 Encapsulating Security Payload
  forced              Delete all dynamic translations (forcefully)
  inside              Inside addresses (and ports)
  outside             Outside addresses (and ports)
  piggyback-internal  Delete all dynamic translations created off of
                      piggyback-data
  tcp                 Transmission Control Protocol
  udp                 User Datagram Protocol
  vrf                 Clear entries of VRF instance

NAT-Router#clear ip nat translation *
NAT-Router#
NAT-Router#
NAT-Router#show ip nat statistics
Total active translations: 0 (0 static, 0 dynamic; 0 extended)
Peak translations: 9, occurred 02:08:19 ago
Outside interfaces:
  Vlan1
Inside interfaces:
  FastEthernet0
Hits: 428  Misses: 0
CEF Translated packets: 80, CEF Punted packets: 348
Expired translations: 89
Dynamic mappings:
-- Inside Source
[Id: 4] access-list 15 interface Vlan1 refcount 0

Total doors: 0
Appl doors: 0
Normal doors: 0
Queued Packets: 0
NAT-Router#


clearはソース指定でもデスティネーション指定でも、アスタリスクでごっそりでも可。


次に、NATエントリの有効時間指定。


NAT-Router(config)#ip nat translation timeout ?
  <0-536870>  Timeout in seconds
  never       Never timeout

NAT-Router(config)#ip nat translation ?
  arp-ping-timeout        Specify timeout for WLAN-NAT ARP-Ping
  dns-timeout             Specify timeout for NAT DNS flows
  finrst-timeout          Specify timeout for NAT TCP flows after a FIN or RST
  icmp-timeout            Specify timeout for NAT ICMP flows
  max-entries             Specify maximum number of NAT entries
  port-timeout            Specify timeout for NAT TCP/UDP port specific flows
  pptp-timeout            Specify timeout for NAT PPTP flows
  routemap-entry-timeout  Specify timeout for routemap created half entry
  syn-timeout             Specify timeout for NAT TCP flows after a SYN and no
                          further data
  tcp-timeout             Specify timeout for NAT TCP flows
  timeout                 Specify timeout for dynamic NAT translations
  udp-timeout             Specify timeout for NAT UDP flows

NAT-Router(config)#


・outsideのソースNATでホストルートまたは、natコマンドの末尾にadd route、もしくは構成が単純でこれらを考えずともよいか、いろいろ。

・双方向NATはトゥわいすNAT、注意事項はoutsideのソースNATと同じか。

また、ルートマップ使用で宛先毎にソースを変えるとき、ルートマップ中のソース変換アドレスが next hop として指定されることに若干違和感が、これは私の中の問題だが。



2015年12月5日土曜日

マジックパケット

マジックパケット ≈ 典型的にはサーバに対してオールFのブロードキャストの後にサーバのMACアドレスを連続で送って、眠っているサーバを起こすパケット。

とは、誤3blog-wiseな認識であって激しく間違っているかも。詳しくは、こんな場末の吹き溜まりではなくてこちら様で。

@IT Tech TIPS: Wake On LANでコンピュータを起動する
http://www.atmarkit.co.jp/ait/articles/0602/25/news014.html

相手のMACアドレスを送りつける回数は16回だった。そして、イーサとIPの宛先はブロードキャストでUDPの任意とのこと、なるほど。


同一のブロードキャストドメインでなく、VLAN間をまたぐための設定例はこちら。
http://www.cisco.com/cisco/web/support/JP/100/1008/1008564_catl3-wol-vlans-j.html

この設定例ではUDPの7番になっているが、どうだろう、先のアットマークITさんのWebコンテンツ中ではポート番号についての記載はなかったが。








2015年12月4日金曜日

NATの入り口

まずここから。

<Inside PC> -------- <NAT Inside--Router--NAT Outside> -------- <Outside PC>
S: Inside Local D: Inside Global
                                                                   D: Outside Local  S: Outside Global

次にテストの構成いめーじ。

PC

プライベートVLANを収容するL2

NATなルータ

セキュアG/Wなルータ

WANルータ



作業チェック
・L2に位置付ける機器の no ip routing
・プライベートVLANに接続するPCのifconfig
・NATルータで変換するアドレスの考慮


static変換について、変換前後の設定1行を追加したところこちら。

%LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up

NVI; NAT 仮想インターフェイス … NAT Virtual Interface
http://www.cisco.com/cisco/web/support/JP/docs/UGAS/AS5200UniversalAccessServers/AS5200UniversalAccessServ/RCS/001/iadnat_addr_consv.html?bid=0900e4b182529657

これは保留で、とりあえずふつうにルーティングできる状態へ。

と思ったが、L2とNATルータ間が通らない。L2は先日プライベートVLANのpromiscuousな ポートでNATルータへ接続しようと、イージスさんが例を書かれてたビジネスホテルのようないめーじで、NATルータのVLAN間ルーティングなインターフェースに接続してみたのだがどうもよろしくない。encupslationの問題かもしくはVLAN IDの問題か、などとも思ったが、ふつうに switchport trunk allowd vlan どれどれ、の設定においてはOKで、switchport mode private-vlan promiscuous ではNG。


NATに取り掛かるまでに手間取り過ぎ。悠長に構えている場合ではない。





 





2015年12月1日火曜日

PEAPならぬPREP それからSDNならぬSDS

PREPと書くとついラグビーのプロップも連想するが、よもやまさか、こんなに "ぶーむ" になるとは驚いた。


日本人の、軽薄ジコチューな群がり・チヤホヤ手のひら返しは、おそろしく見苦しいがおそらくラグビーでも再現することだろう。かつてあれほど騒がれた・・・何とは敢えて言わないが、醜態は数限りない。


さておき、PREPとSDS。UNIX系OSでもネットワークでもなく、プレゼンの基礎的概念。プレゼンの基礎というよりは中学生程度な話だが。

PREP
http://www.atmarkit.co.jp/ait/articles/1510/27/news013.html

Point
Reason
Example
Point



SDS
http://www.atmarkit.co.jp/ait/articles/1510/27/news013_2.html

Summary
Detail
Summary



もじりネタそれぞれについては次に。

PEAP
https://technet.microsoft.com/ja-jp/library/cc754179.aspx

SDN
http://www.atmarkit.co.jp/ait/articles/1308/02/news006.html




2015年11月29日日曜日

.1Qイン.1Q ACLからDHCPまで

いつもお世話になっているイージスさんから。

IEEE802.1q トンネリング
ダブルタグ

なる手法のお話。WANサービスについて部分的に言及なさっているが、キャリアの仕様がユーザに明かされることはないので、詳細は、当該サービスの関係者でないと知りようがない。誤3 blog 程度なここでは無縁の世界。

ただ、毎度毎度の乱筆メモの程度で書くなら。

・IEEE802.1ad
・スタックするので1522オーバーの対応必須
・トンネリングとはいってもカプセル化はしてない
・現在は MAC in MAC のさらに先

メモ錯ではないWebコンテンツはこちら。

IEEE802.1adについて NTTから
http://www.ntt.co.jp/journal/0601/files/jn200601054.pdf

Road to ネットワークスペシャリスト
http://ipnetwork.web.fc2.com/spb/spbm.html


さておきACL。

・試験における格言らしき
標準ACLは宛先に近い場所に設定、拡張ACLは送信元に近い場所に設定するのが推奨

お作法というやつ。

・ワイルドカードの解説は厳密には…

厳密に書こうとしたら恐ろしく面倒、且つ教えた/おぼえたところで全く実践的でないという点でたいへんに共感。

 ・番号付き拡張ACLは100-199と2000-2699

2000番台は書いたことがない、2000-2699か。

 ・gt と lt そして neq と range

gt は何かで書いたおぼえがうっすらと。range は けっこう機会があった。neq は自分が設定どうこう以前に、目にしたことさえただの一度もない。

・established は RSTパケットも対象。

知らんかった。。。


・名前付き拡張ACLのシーケンス番号は10,20…

名前付きを一から書いたことがないので練習。

Router-ACL(config)#ip access-list ?
  extended    Extended Access List
  helper      Access List acts on helper-address
  log-update  Control access list log updates
  logging     Control access list logging
  resequence  Resequence Access List
  standard    Standard Access List

Router-ACL(config)#ip access-list ex
Router-ACL(config)#ip access-list extended tutorial
Router-ACL(config-ext-nacl)#permit tcp 172.16.1.0 0.0.0.255 any neq 445 established log

(略)


番号は accesss-list うんちゃらだが、名前付きは ip access-list extentedである点も知らなかった。

・show プロトコル access-list
・show interfaceから見るACL状況

・拡張アクセスリスト(番号)に挿入可能
・ip access-list extented から no sequence-number で部分削除も可能

・access-class をアウトバウンドで使用すると宛先のチェックになる!!!


自分が浅はか過ぎていろいろヤバイ。。


DHCPについて

Discover
Offer
Request
ACK

クライアントはブロードキャスト、サーバはユニキャスト。当たり前のことだが「えっと」 と間を置かないと出てこない時点でショボイ。


・DHCPはコンフィグに見えないがserviceとして扱われている

L3-PrivateVLAN(config)#no service ?
  compress-config        Compress the configuration file
  config                 TFTP load config files
  dhcp                   Enable DHCP server and relay agent
  disable-ip-fast-frag   Disable IP particle-based fast fragmentation
  exec-callback          Enable exec callback
  exec-wait              Delay EXEC startup on noisy lines
  finger                 Allow responses to finger requests
  hide-telnet-addresses  Hide destination addresses in telnet command
  linenumber             enable line number banner for each exec
  nagle                  Enable Nagle's congestion control algorithm
  old-slip-prompts       Allow old scripts to operate with slip/ppp
  pad                    Enable PAD commands
  password-encryption    Encrypt system passwords
  password-recovery      Disable password recovery
  prompt                 Enable mode specific prompt
  pt-vty-logging         Log significant VTY-Async events
  sequence-numbers       Stamp logger messages with a sequence number
  slave-log              Enable log capability of slave IPs
  tcp-keepalives-in      Generate keepalives on idle incoming network
                         connections
  tcp-keepalives-out     Generate keepalives on idle outgoing network
                         connections
  tcp-small-servers      Enable small TCP servers (e.g., ECHO)
  telnet-zeroidle        Set TCP window 0 when connection is idle
  timestamps             Timestamp debug/log messages
  udp-small-servers      Enable small UDP servers (e.g., ECHO)

L3-PrivateVLAN(config)#no service


Router(config)#no service ?
  alignment              Control alignment correction and logging
  call-home              Enable call-home service
  compress-config        Compress the nvram configuration file
  config                 TFTP load config files
  counters               Control aging of interface counters
  dhcp                   Enable DHCP server and relay agent
  disable-ip-fast-frag   Disable IP particle-based fast fragmentation
  exec-callback          Enable exec callback
  exec-wait              Delay EXEC startup on noisy lines
  finger                 Allow responses to finger requests
  hide-telnet-addresses  Hide destination addresses in telnet command
  linenumber             enable line number banner for each exec
  nagle                  Enable Nagle's congestion control algorithm
  old-slip-prompts       Allow old scripts to operate with slip/ppp
  pad                    Enable PAD commands
  password-encryption    Encrypt system passwords
  prompt                 Enable mode specific prompt
  pt-vty-logging         Log significant VTY-Async events
  sequence-numbers       Stamp logger messages with a sequence number
  slave-log              Enable log capability of slave IPs
  tcp-keepalives-in      Generate keepalives on idle incoming network
                         connections
  tcp-keepalives-out     Generate keepalives on idle outgoing network
                         connections
  tcp-small-servers      Enable small TCP servers (e.g., ECHO)
  telnet-zeroidle        Set TCP window 0 when connection is idle
  timestamps             Timestamp debug/log messages
  udp-small-servers      Enable small UDP servers (e.g., ECHO)

Router(config)#no service


・設定の解説にあたっては除外アドレスから始める


さぞトラブルがあったことだろうとお察しを。


入力のお作法の確認。

L2-QoS(config)#ip dhcp ?
  conflict                   DHCP address conflict parameters
  database                   Configure DHCP database agents
  excluded-address           Prevent DHCP from assigning certain addresses
  limited-broadcast-address  Use all 1's broadcast address
  ping                       Specify ping parameters used by DHCP
  pool                       Configure DHCP address pools
  relay                      DHCP relay agent parameters
  smart-relay                Enable Smart Relay feature
  snooping                   DHCP Snooping

L2-QoS(config)#ip dhcp excluded-address ?
  A.B.C.D  Low IP address

L2-QoS(config)#ip dhcp excluded-address 172.17.1.254 172.18.1.2


ここで、excluded設定についてもお作法を試したところ、running-config にこのような結果が。

!
no aaa new-model
clock timezone JST 9
vtp domain vtptest
vtp mode transparent
ip subnet-zero
ip routing
ip dhcp excluded-address 10.0.0.0 10.255.255.255
ip dhcp excluded-address 10.0.0.1 10.255.255.254
ip dhcp excluded-address 11.0.0.0 11.255.255.255
ip dhcp excluded-address 172.16.0.1 172.31.255.254
ip dhcp excluded-address 192.168.0.1 192.168.1.254
ip dhcp excluded-address 0.0.0.1 127.255.255.254
ip dhcp excluded-address 128.0.0.1 191.255.255.254
ip dhcp excluded-address 192.0.0.1 223.255.255.254
ip dhcp excluded-address 224.0.0.1 239.255.255.254
ip dhcp excluded-address 240.0.0.1 255.255.255.254
ip dhcp excluded-address 127.255.255.254 128.0.0.1
ip dhcp excluded-address 191.255.255.254 192.0.0.1
ip dhcp excluded-address 223.255.255.254 224.0.0.1
ip dhcp excluded-address 239.255.255.254 240.0.0.1
!
!

グローバル/プライベートやクラス境界、特殊なアドレス問わず設定可能。また、

L2-QoS(config)#ip dhcp pool TEST
L2-QoS(dhcp-config)#network 172.16.32.0 255.255.255.0
L2-QoS(dhcp-config)#default-router 172.16.31.1
L2-QoS(dhcp-config)#domain-name test.local
L2-QoS(dhcp-config)#lease 1 12
L2-QoS(dhcp-config)#exit
L2-QoS(config)#
L2-QoS(config)#no ip dhcp conflict logging
L2-QoS(config)#


実在するサブネットは、プライベートVLANの学習の際にテストしたVLAN 31、172.16.31.0/24。一方で設定上は実在しないサブネットでも入るし、もっとあからさまにメチャクチャな値でも入ることは入る。もちろん誤動作はしないので、作業場の間違いが起こりうる、というだけのこと。



次にDHCPデータベースの設定について。

L2-QoS(config)# ip dhcp database?
database

L2-QoS(config)# ip dhcp database ?
  WORD  Uniform Resource Locator (URL)

L2-QoS(config)#ip dhcp database TESTURL ?
  timeout      Set the database transfer timeout
  write-delay  Set the database write delay
  <cr>

L2-QoS(config)#ip dhcp database TESTURL write-delay ?
  <60-4294967295>  Seconds

L2-QoS(config)#

この機能の意義について全くわかっちゃいないので、ここでは、設定上はこんなやわ、という程度で。


ここで、先ほどの設定ミス事例を一部修正。

L2-QoS(config)#ip dhcp pool TEST
L2-QoS(dhcp-config)#
L2-QoS(dhcp-config)#network 172.16.31.0 255.255.255.0
L2-QoS(dhcp-config)#exit
L2-QoS(config)#
L2-QoS(config)#
L2-QoS(config)#ip dhcp excluded-address 172.16.31.1 172.16.31.127
L2-QoS(config)#ip dhcp excluded-address 172.16.31.144 172.16.31.255
L2-QoS(config)#

networkで本来のサブネットを追加した。誤った設定も残したままだが、アドレス授受は完了した。


L2-QoS#show ip dhcp ?
  binding   DHCP address bindings
  conflict  DHCP address conflicts
  database  DHCP database agents
  import    Show Imported Parameters
  relay     Miscellaneous DHCP relay information
  server    Miscellaneous DHCP server information
  snooping  DHCP snooping

L2-QoS#show ip dhcp binding
IP address       Client-ID/              Lease expiration        Type
                 Hardware address
172.16.31.128    (MACアドレス)       Mar 02 1993 11:21 PM    Automatic
L2-QoS#
L2-QoS#
L2-QoS#show ip dhcp conflict
IP address        Detection method   Detection time
L2-QoS#
L2-QoS#show ip dhcp database

L2-QoS#
L2-QoS#show ip dhcp import

L2-QoS#
L2-QoS#show ip dhcp relay
% Incomplete command.

L2-QoS#show ip dhcp relay ?
  information  DHCP relay information option

L2-QoS#show ip dhcp relay information
% Incomplete command.

L2-QoS#show ip dhcp relay information  ?
  trusted-sources  List of trusted sources of relay information option

L2-QoS#show ip dhcp relay information  trusted-sources ?
  |  Output modifiers
  <cr>

L2-QoS#show ip dhcp relay information  trusted-sources
List of trusted sources of relay agent information option:

L2-QoS#show ip dhcp server
% Incomplete command.

L2-QoS#show ip dhcp server ?
  statistics  DHCP server statistics

L2-QoS#show ip dhcp server statistics
Memory usage         5180
Address pools        1
Database agents      0
Automatic bindings   1
Manual bindings      0
Expired bindings     0
Malformed messages   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         23
DHCPREQUEST          1
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            1
DHCPACK              1
DHCPNAK              0
L2-QoS#
L2-QoS#
L2-QoS#show ip dhcp snooping ?
  binding   DHCP snooping bindings
  database  DHCP snooping database agent
  |         Output modifiers
  <cr>

L2-QoS#show ip dhcp snooping
Switch DHCP snooping is disabled
DHCP snooping is configured on following VLANs:
none
Insertion of option 82 is enabled
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Interface                    Trusted     Rate limit (pps)
------------------------     -------     ----------------
L2-QoS#


別の機器では、


Router#show dhcp ?
  lease   Show DHCP Addresses leased from a server
  server  Show DHCP Servers we know about


Router#show dhcp lease
Router#
Router#
Router#show dhcp server
   DHCP server: ANY (255.255.255.255)
    Leases:   0
    Offers:   0      Requests: 0     Acks : 0     Naks: 0
    Declines: 0      Releases: 0     Query: 0     Bad: 0
    Forcerenews: 0      Failures: 0

Router#
Router#
Router#show ip dhcp ?
  binding   DHCP address bindings
  conflict  DHCP address conflicts
  database  DHCP database agents
  import    Show Imported Parameters
  pool      DHCP pools information
  relay     Miscellaneous DHCP relay information
  server    Miscellaneous DHCP server information

Router#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
Router#
Router#
Router#show ip dhcp conflict
IP address        Detection method   Detection time          VRF
Router#
Router#
Router#show ip dhcp database
Router#
Router#
Router#show ip dhcp import
Router#
Router#
Router#show ip dhcp pool
Router#
Router#
Router#show ip dhcp relay
% Incomplete command.

Router#show ip dhcp relay ?
  information  DHCP relay information option

Router#show ip dhcp relay information
% Incomplete command.

Router#show ip dhcp relay information  ?
  trusted-sources  List of trusted sources of relay information option

Router#show ip dhcp relay information  trusted-sources
List of trusted sources of relay agent information option:

Router#show ip dhcp server
% Incomplete command.

Router#show ip dhcp server ?
  statistics  DHCP server statistics

Router#show ip dhcp server statistics
Memory usage         0
Address pools        0
Database agents      0
Automatic bindings   0
Manual bindings      0
Expired bindings     0
Malformed messages   0
Secure arp entries   0

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         0
DHCPREQUEST          0
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            0
DHCPACK              0
DHCPNAK              0
Router#


2015年11月28日土曜日

プライベートVLAN

プライマリVLANとセカンダリVLANから成り、

セカンダリVLANはさらにアイソレーテッドVLANとコミュニティVLANから成る。


…トンミヒルトネン!?!!!
(Tommi Hiltunen - Jarkko Niem)


さておき、これらのVLANが使用するポート

 プライマリVLANは promiscuous ポート
 http://ejje.weblio.jp/content/promiscuous

 セカンダリでアイソレーテッドなVLANは isolated ポート

 セカンダリでコミュニティなVLANは community ポート


を使うとのこと。ようけわからんので設定してみる。


VLAN ID の30番台をプライベートVLANにしてみる。

 31は隔離者や閉鎖的コミュ中毒者が入り乱れる混合ポート…外部出入り口

 35は隔離者VLAN
 39は閉鎖的アタシのイエスマンコミュ中毒者向けVLAN


(config)#vlan 31
L2-QoS(config-vlan)#?
VLAN configuration commands:
  are           Maximum number of All Route Explorer hops for this VLAN (or
                zero if none specified)
  backupcrf     Backup CRF mode of the VLAN
  bridge        Bridging characteristics of the VLAN
  exit          Apply changes, bump revision number, and exit mode
  media         Media type of the VLAN
  mtu           VLAN Maximum Transmission Unit
  name          Ascii name of the VLAN
  no            Negate a command or set its defaults
  parent        ID number of the Parent VLAN of FDDI or Token Ring type VLANs
  private-vlan  Configure a private VLAN
  remote-span   Configure as Remote SPAN VLAN
  ring          Ring number of FDDI or Token Ring type VLANs
  said          IEEE 802.10 SAID
  shutdown      Shutdown VLAN switching
  state         Operational state of the VLAN
  ste           Maximum number of Spanning Tree Explorer hops for this VLAN (or
                zero if none specified)
  stp           Spanning tree characteristics of the VLAN
  tb-vlan1      ID number of the first translational VLAN for this VLAN (or
                zero if none)
  tb-vlan2      ID number of the second translational VLAN for this VLAN (or
                zero if none)

L2-QoS(config-vlan)#private-vlan ?
  association  Configure association between private VLANs
  community    Configure the VLAN as a community private VLAN
  isolated     Configure the VLAN as an isolated private VLAN
  primary      Configure the VLAN as a primary private VLAN

L2-QoS(config-vlan)#private-vlan primary ?
  <cr>

L2-QoS(config-vlan)#private-vlan primary
Private VLANs can only be configured when VTP is in transparent mode.

L2-QoS(config-vlan)#


interface vlan でなくて vlan直 というのがまぎらわしい。

とりあえず、VTP を transparent モードにする。
L2-QoS(config-vlan)#exit
L2-QoS(config)#
L2-QoS(config)#vtp ?
  domain     Set the name of the VTP administrative domain.
  file       Configure IFS filesystem file where VTP configuration is stored.
  interface  Configure interface as the preferred source for the VTP IP updater
             address.
  mode       Configure VTP device mode
  password   Set the password for the VTP administrative domain
  pruning    Set the adminstrative domain to permit pruning
  version    Set the adminstrative domain to VTP version

L2-QoS(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
L2-QoS(config)#

変更終了。

ひとつ前に戻って、VLAN31をプロミスキャス、VLAN35をアイソレーテッド、VLAN39をコミュニティに設定。ここでプライマリVLANとセカンダリVLANの概念を思い出す必要があって

 プライマリ…プロミスキャス

 セカンダリ…アイソレーテッドとコミュニティ


であって、セカンダリの二つはプロミスキャスを介さないと外部と通信できないのでプライマリVLANに所属させなければいけないということに。



L2-QoS(config)#
L2-QoS(config)#vlan 31
L2-QoS(config-vlan)#private-vlan association ?
  WORD    VLAN IDs of the private VLANs to be configured
  add     Add a VLAN to private VLAN list
  remove  Remove a VLAN from private VLAN list

L2-QoS(config-vlan)#private-vlan association add ?
  WORD  VLAN IDs of the private VLANs to be configured

L2-QoS(config-vlan)#private-vlan association add 35,39
L2-QoS(config-vlan)#
L2-QoS(config-vlan)#exit


次に、セカンダリ側での設定は必要ないのか試してみると、



L2-QoS(config)#vlan 35
L2-QoS(config-vlan)#private-vlan association ?
  WORD    VLAN IDs of the private VLANs to be configured
  add     Add a VLAN to private VLAN list
  remove  Remove a VLAN from private VLAN list

L2-QoS(config-vlan)#private-vlan association add 36-38
Command rejected: invalid private vlan association between vlan35 and vlan36. VLAN 35 is not a primary VLAN.
L2-QoS(config-vlan)#
L2-QoS(config-vlan)#
L2-QoS(config-vlan)#private-vlan association add 31
Command rejected: invalid private vlan association between vlan35 and vlan31. VLAN 31 is a primary VLAN.
L2-QoS(config-vlan)#private-vlan association Kakuri-VLAN
Command Rejected: invalid VLAN list

L2-QoS(config-vlan)#

invalid assciation に invalid VLANリストと。



続いて、物理ポートの割り当て。

L2-QoS(config)#interface FastEthernet 0/31
L2-QoS(config-if)#switchport mode ?
  access        Set trunking mode to ACCESS unconditionally
  dot1q-tunnel  set trunking mode to TUNNEL unconditionally
  dynamic       Set trunking mode to dynamically negotiate access or trunk mode
  private-vlan  Set the mode to private-vlan host or promiscuous
  trunk         Set trunking mode to TRUNK unconditionally

L2-QoS(config-if)#switchport mode private-vlan ?
  host         Set the mode to private-vlan host
  promiscuous  Set the mode to private-vlan promiscuous

L2-QoS(config-if)#switchport mode private-vlan promiscuous ?
  <cr>

L2-QoS(config-if)#switchport mode private-vlan promiscuous
L2-QoS(config-if)#
L2-QoS(config-if)#switchport ?
  access         Set access mode characteristics of the interface
  backup         Set backup for the interface
  block          Disable forwarding of unknown uni/multi cast addresses
  host           Set port host
  mode           Set trunking mode of the interface
  nonegotiate    Device will not engage in negotiation protocol on this
                 interface
  port-security  Security related command
  priority       Set appliance 802.1p priority
  private-vlan   Set the private VLAN configuration
  protected      Configure an interface to be a protected port
  trunk          Set trunking characteristics of the interface
  voice          Voice appliance attributes
  <cr>

L2-QoS(config-if)#switchport private-vlan ?
  association       Set the private VLAN association
  host-association  Set the private VLAN host association
  mapping           Set the private VLAN promiscuous mapping

L2-QoS(config-if)#switchport private-vlan association ?
  host     Set the private VLAN host association
  mapping  Set the private VLAN promiscuous mapping

L2-QoS(config-if)#switchport private-vlan ?
  association       Set the private VLAN association
  host-association  Set the private VLAN host association
  mapping           Set the private VLAN promiscuous mapping

L2-QoS(config-if)#switchport private-vlan mapping ?
  <1006-4094>  Primary extended range VLAN ID of the private VLAN promiscuous
               port mapping
  <2-1001>     Primary normal range VLAN ID of the private VLAN promiscuous
               port mapping

L2-QoS(config-if)#switchport private-vlan mapping 31 ?
  WORD    Secondary VLAN IDs of the private VLAN promiscuous port mapping
  add     Add a VLAN to private VLAN list
  remove  Remove a VLAN from private VLAN list

L2-QoS(config-if)#switchport private-vlan mapping 31 add ?
  WORD  Secondary VLAN IDs of the private VLAN promiscuous port mapping

L2-QoS(config-if)#switchport private-vlan mapping 31 add 35,39


これでプライマリ/プロミスキャスの設定は終わり!? 次に、セカンダリ/アイソレーテッドの割り当て。

L2-QoS(config-if)#interface FastEthernet 0/35
L2-QoS(config-if)#
L2-QoS(config-if)#switchport mode private-vlan host
L2-QoS(config-if)#switchport private-vlan ?
  association       Set the private VLAN association
  host-association  Set the private VLAN host association
  mapping           Set the private VLAN promiscuous mapping

L2-QoS(config-if)#switchport private-vlan mapping 31 add 35
L2-QoS(config-if)#


続いてセカンダリ/コミュニティのポート割り当ては、アイソレーテッドと同一。


結果的に running-config に表れるところとしては、

VLAN周り

!
vlan 31
  private-vlan primary
  private-vlan association 35,39
!
vlan 32-34
!
vlan 35
  private-vlan isolated
!
vlan 36-38
!
vlan 39
  private-vlan community
!
vlan 40-136
!
!

インターフェース周り

!
interface FastEthernet0/31
 switchport private-vlan mapping 31 35,39
 switchport mode private-vlan promiscuous
!
interface FastEthernet0/32
!
interface FastEthernet0/33
!
interface FastEthernet0/34
!
interface FastEthernet0/35
 switchport private-vlan host-association 31 35
 switchport mode private-vlan host
!
interface FastEthernet0/36
 switchport private-vlan host-association 31 35
 switchport mode private-vlan host
!
interface FastEthernet0/37
!
interface FastEthernet0/38
!
interface FastEthernet0/39
 switchport private-vlan host-association 31 39
 switchport mode private-vlan host
!
interface FastEthernet0/40
 switchport private-vlan host-association 31 39
 switchport mode private-vlan host
!


さらに、SVIへのマッピングのところ。

L2-QoS(config)#interface vlan 31
L2-QoS(config-if)#
L2-QoS(config-if)#private-vlan mapping ?
  WORD    Secondary VLAN IDs of the private VLAN SVI interface mapping
  add     Add a VLAN to private VLAN list
  remove  Remove a VLAN from private VLAN list

L2-QoS(config-if)#private-vlan mapping add 35,39
L2-QoS(config-if)#
L2-QoS(config-if)#
*Mar  1 14:39:54.063: %PV-6-PV_MSG: Created a private vlan mapping, Primary 31, Secondary 35
*Mar  1 14:39:54.063: %PV-6-PV_MSG: Created a private vlan mapping, Primary 31, Secondary 39
L2-QoS(config-if)#
L2-QoS(config-if)#end
L2-QoS#


running-config 上に追加で表れるところ。


インターフェースVLAN周りで

interface Vlan1
 ip address 172.16.1.1 255.255.255.0
!
interface Vlan31
 no ip address
 private-vlan mapping 35,39
!

とりあえずここまで。





2015年11月27日金曜日

Cisco単独仕様な音声VLANのあたりから

Cisco様の下僕に加えていただいてない私にはまだ理解できない点が

「Cisco音声VLAN 以下の Cisco IP Phone では
  CDP により VLAN と QoS を受けることができる。

太字にするところが違いましたね。「CDP で QoS」 がまだ理解できません。CDPでVLAN、についてはそれでもいくらかお察しもつくのですが。

さておき昨日のおさらいから。

L2-QoS(config)#mls ?
  qos  qos keyword

L2-QoS(config)#mls qos
L2-QoS(config)#
L2-QoS(config)#interface range FastEthernet 0/5 - 6
L2-QoS(config-if-range)#mls ?
  qos  qos command keyword

L2-QoS(config-if-range)#mls
L2-QoS(config-if-range)#mls qos ?
  cos            cos keyword
  dscp-mutation  dscp-mutation keyword
  trust          trust keyword
  vlan-based     vlan-based keyword

L2-QoS(config-if-range)#mls qos trust ?
  cos            cos keyword
  device         trusted device class
  dscp           dscp keyword
  ip-precedence  ip-precedence keyword
  <cr>

L2-QoS(config-if-range)#mls qos trust cos
L2-QoS(config-if-range)#
L2-QoS(config-if-range)#end

基本的な識別についてここまで。


続いて「音声VLANの設定」の部分。まず、インターフェースにおける switchport コマンドのオプションをざっと。

L2-QoS(config-if-range)#switchport ?
  access         Set access mode characteristics of the interface
  backup         Set backup for the interface
  block          Disable forwarding of unknown uni/multi cast addresses
  host           Set port host
  mode           Set trunking mode of the interface
  nonegotiate    Device will not engage in negotiation protocol on this
                 interface
  port-security  Security related command
  priority       Set appliance 802.1p priority
  private-vlan   Set the private VLAN configuration
  protected      Configure an interface to be a protected port
  trunk          Set trunking characteristics of the interface
  voice          Voice appliance attributes
  <cr>

L2-QoS(config-if-range)#

voice のオプションは、Voice あpらいあんす 属性sな設定とのこと。音声や広義の音声トラフィックのためではなく、シスコ電話機商売のための属性オプションという意味であるので誤解があってはならない。


L2-QoS(config-if-range)#switchport voice ?
  vlan  Vlan for voice traffic

L2-QoS(config-if-range)#switchport voice vlan ?
  <1-4094>  Vlan for voice traffic
  dot1p     Priority tagged on PVID
  none      Don't tell telephone about voice vlan
  untagged  Untagged on PVID

L2-QoS(config-if-range)#switchport voice vlan dot1p ?
  <cr>

L2-QoS(config-if-range)#switchport voice vlan dot1p
L2-QoS(config-if-range)#


Ciscoイージスさんの説明だと、

VLAN 指定のVLAN ID
dot1p VLAN ID 0 (ネイティブVLAN)
none タグ無しでCisco IP Phone独自設定
untagged タグ無し ということはCisco IP Phone独自じゃないということで?

ということだが。dot1p でCoS値はどうなる? まだ概要さえ把握できない現在ジブン。

それから、none 設定はrunnning-configには表示されないようだ。


CoS値は扱いがさまざまであるようで、キモオタに媚び気味なアプレシアシリーズだとこういったマッピングも。
http://www.apresia.jp/products/apresialight/configuration/qos/index1.html


それにしても、このblogはますます。

Can you please rephrase your question with examples?

要反省だ。



次は単語メモ。

acronym
http://ejje.weblio.jp/content/acronym



Switch Virtual Interface のあたりから

ip routing 無し

L2#show ip route
Default gateway is not set

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
L2#


ip routing 有

L2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last reso
*Mar  1 0:47:53.141: %SYS-5-CONFIG_I: Configured from console by consolert is not set

     172.1.0.0/24 is subnetted, 1 subnets
C       172.1.1.0 is directly connected, Vlan1
L2#


ルーテッドポートについて

・サブインターフェースを切れない
・イーサチャネルではこれを使う
・no switchport の設定が要る


Cisco音声VLANについて

Cisco IP Phone のボイス向けVLANと IP Phone経由のPC向けVLANとを、アクセスポートで混在させる機能、とのこと。CDPを使う。PCはネイティブVLANで、IP Phoneは音声VLAN、とのこと。マジか!?

interface FastEthernet0/5
 switchport access vlan 88
 switchport mode access
 switchport voice vlan 101
 spanning-tree portfast
!
interface FastEthernet0/6
 switchport access vlan 88
 switchport mode access
 switchport voice vlan 101
 spanning-tree portfast

spanning-tree portfastは、この機材ではでふぉで入るようだ。



続いて優先制御も含めた設定。まず、Cisco様 謹製コンフィギュレーションガイドは、2960の日本語版。
http://www.cisco.com/cisco/web/support/JP/docs/SW/LANSWT-Access/CAT2960SWT/CG/005/swqos.html?bid=0900e4b1825295c6

キホンは IETF の Differentiated Services。IPヘッダのTOSフィールド6ビットで定義。

英語の differentiate
http://ejje.weblio.jp/content/differentiate


もっとも、マーキングのやり方はいろいろで

・ISLヘッダ26バイト中最後の1バイトの中のさらにおしり3ビットが
 IEEE 802.1p Class of Service を伝達できるフィールドのようで
 ここでCoS(.1p Class of Service)指定
 
・.1q の Tag Control Information (TCI) 中の前3ビットが
Priority Code Point なのでここでCoS指定
 * .1q の前半分16ビットは Tag Protocol Identifierで後ろ12ビットはVLAN ID
  http://www.itbook.info/network/vlan3.html

・デフォはゼロなIPヘッダのTOSフィールドで
 a. アタマ3ビットで IP precedence  をかます
 b. 6ビットで Diffrentiated Service Code Point (DSCP)をかます


TOSフィールドについては

N-Studyさんのこちらとか。
http://www.n-study.com/network/qos04.htm

ASCIIのこれとか。
http://ascii.jp/elem/000/000/449/449327/index-4.html



3区分4通りがあるそうだが当然ISLは問題外として、どこで誰がマーキングするか次第。マーキングの話はまたコンドとして


L2-QOS(config)#mls qos
L2-QOS(config)#
L2-QOS(config)#
L2-QOS(config)#interface range FastEthernet 0/5 - 6
L2-QOS(config-if-range)#mls ?
  qos  qos command keyword

L2-QOS(config-if-range)#mls qos ?
  cos            cos keyword
  dscp-mutation  dscp-mutation keyword
  trust          trust keyword
  vlan-based     vlan-based keyword

L2-QOS(config-if-range)#mls qos trust ?
  cos            cos keyword
  device         trusted device class
  dscp           dscp keyword
  ip-precedence  ip-precedence keyword
  <cr>

つまるところ設定としては

L2-QOS(config-if-range)#mls qos trust cos

または

L2-QOS(config-if-range)#mls qos trust dscp

と仰っているが、QoSをどこでかけるかにもよるか。



QoSはまだまだ続く。




















2015年11月26日木曜日

VTPまわり

こんな状態からスタート。

L2#show vtp
FastEthernet0/1, changed state to upstatus
VTP Version                     : 2
Configuration Revision          : 3
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 132
VTP Operating Mode              : Server
VTP Domain Name                 :
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x7B 0x3B 0xFD 0x2E 0xE1 0xD6 0x87 0x46
Configuration last modified by 172.1.1.8 at 11-25-15 21:15:30
Local updater ID is 172.1.1.8 on interface Vl1 (lowest numbered VLAN interface found)
L2#8#show vtp counters
VTP statistics:
Summary advertisements received    : 0
Subset advertisements received     : 0
Request advertisements received    : 0
Summary advertisements transmitted : 0
Subset advertisements transmitted  : 0
Request advertisements transmitted : 0
Number of config revision errors   : 0
Number of config digest errors     : 0
Number of V1 summary errors        : 0


VTP pruning statistics:

Trunk            Join Transmitted Join Received    Summary advts received from
                                                   non-pruning-capable device
---------------- ---------------- ---------------- ---------------------------
Fa0/46              0                0                0
Fa0/48              0                0                0

L2#show vtp password
The VTP password is not configured.


L2#(config)#vtp mode ?
  client       Set the device to client mode.
  server       Set the device to server mode.
  transparent  Set the device to transparent mode.

L2(config)#vtp mode trans
L2(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.

L2(config)#vtp password vtptest
Setting device VLAN database password to vtptest

L2(config)#no vtp pruning
Cannot modify pruning unless in VTP server mode


と、ここまで。Cisco原理主義でない環境において使う場合の、トランスペアレントモード設定。次からはCisco原理主義な環境においてのシゴト向け。


L2(config)#vtp version いくつ
L2(config)#vtp domain ナニナニ
L2(config)#vtp mode どれどれ
L2(config)#vtp password ほにゃらら

あとは、土着VLANが合致しているか、もしくはtrunkで通っているか。そして、カレントで動的な設定情報にはこれらの設定後の情報は出てこないので、show vtp status で確認。ただし、ルータの場合はrunning-configに出てくるし、そもそもvlan.datを削除しても設定はリセットされないケースもあるようだ。とはいえ、これも古い機材のハナシなので直近はどうだかわからない。
 


テーマは変わって、ルータにサブインターフェースを持たせてVLAN間ルーティングな設定。

Router(config-subif)#ip address 172.31.1.254 255.255.255.0

% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.

VLANトランクを前置きせずにいきなり設定すると怒られる。ここでのお作法は

Router-F(config)#interface fastEthernet 0.1
Router-F(config-subif)#encapsulation dot1Q 11
Router-F(config-subif)#ip address 172.31.11.254 255.255.255.0
Router-F(config-subif)#exit
Router-F(config)#
Router-F(config)#interface FastEthernet 0.2
Router-F(config-subif)#encapsulation dot1Q 12
Router-F(config-subif)#ip address 172.31.12.254 255.255.255.0
Router-F(config-subif)#exit
Router-F(config)#
Router-F(config)#interface fastEthernet 0.3
Router-F(config-subif)#encapsulation dot1Q 13
Router-F(config-subif)#ip address 172.31.13.254 255.255.255.0
Router-F(config-subif)#end


次にL2側でこれらのVLANの設定。ここで再びお行儀悪くtrunkポートの設定から、

L2-F(config)#interface FastEthernet 0/44
L2-F(config-if)#switchport mode trunk
L2-F(config-if)#switchport trunk encapsulation dot1q
L2-F(config-if)#switchport trunk allowed vlan 11,12,13
L2-F(config-if)#exit


前後してVLAN個別のポートの設定。

L2-F(config)#interface FastEthernet 0/11
L2-F(config-if)#switchport mode access
L2-F(config-if)#switchport access vlan 11
L2-F(config-if)#exit
L2-F(config)#
L2-F(config)#interface FastEthernet 0/12
L2-F(config-if)#switchport mode access
L2-F(config-if)#switchport access vlan 12
L2-F(config-if)#exit
L2-F(config)#
L2-F(config)#interface FastEthernet 0/13
L2-F(config-if)#switchport mode access
L2-F(config-if)#switchport access vlan 13
L2-F(config-if)#end


しかしこれだけでは、L2のVLAN<--->ルータのサブインターフェース間の通信が通らない。L2側のPCで見ていると、span関連のトラフィックしか入らない。はてさて。


とりあえずルータ側でサブインターフェースをいっそ削除! と粗暴なマネをしたところこのられる。

VLAN_TABLE_CHANGE: "FastEthernet0.1":DE-ENCAP
VLAN-DEENCAP: "FastEthernet0.1":802.1Q Id 11:Sense=FALSE:
VLAN_ENCAP_FIXUP: "FastEthernet0.1":
 ENCAP TYPE : 802.1Q
VLAN_TABLE_CHANGE: "FastEthernet0.2":DE-ENCAP
VLAN-DEENCAP: "FastEthernet0.2":802.1Q Id 12:Sense=FALSE:
VLAN_ENCAP_FIXUP: "FastEthernet0.2":
 ENCAP TYPE : 802.1Q
VLAN_TABLE_CHANGE: "FastEthernet0.3":DE-ENCAP
VLAN-DEENCAP: "FastEthernet0.3":802.1Q Id 13:Sense=FALSE:
VLAN_TABLE_CHANGE: "FastEthernet0":DE-ENCAP
VLAN-DEENCAP: "FastEthernet0":802.1Q Id 1:Sense=FALSE:
VLAN_ENCAP_FIXUP: "FastEthernet0":
 ENCAP TYPE : 802.1Q
VLAN-ENCAP-EVENT: dot1q removed from VLAN flags on FastEthernet0
VLAN-ENCAP-EVENT: Packet sizes reset on FastEthernet0
VLAN_ENCAP_FIXUP: "FastEthernet0.3":
 ENCAP TYPE : 802.1Q


サブインターフェースとencapslationを再設定。


Router-F(config)#interface FastEthernet 0.1
Router-F(config-subif)#encapsulation dot1Q 11
*Nov 25 22:45:34.499: VLAN_TABLE_CHANGE: "FastEthernet0":ENCAP
*Nov 25 22:45:34.499: VLAN-ENCAP: "FastEthernet0":802.1Q Id 1:
*Nov 25 22:45:34.503: VLAN_ENCAP_FIXUP: "FastEthernet0":
*Nov 25 22:45:34.503:   802.1Q Id 1 : Native:TRUE
*Nov 25 22:45:34.503:   ENCAP TYPE : ARPA
*Nov 25 22:45:34.503: VLAN_TABLE_CHANGE: "FastEthernet0.1":ENCAP
*Nov 25 22:45:34.503: VLAN-ENCAP: "FastEthernet0.1":802.1Q Id 11:
*Nov 25 22:45:34.535: VLAN_ENCAP_FIXUP: "FastEthernet0.1":
*Nov 25 22:45:34.535:   802.1Q Id 11 : Native:FALSE
*Nov 25 22:45:34.535:   ENCAP TYPE : ARPA
Router-F(config-subif)#exit
Router-F(config)#
Router-F(config)#interface FastEthernet 0.2
Router-F(config-subif)#encapsulation dot1Q 12
*Nov 25 22:46:44.027: VLAN_TABLE_CHANGE: "FastEthernet0.2":ENCAP
*Nov 25 22:46:44.027: VLAN-ENCAP: "FastEthernet0.2":802.1Q Id 12:
*Nov 25 22:46:44.027: VLAN_ENCAP_FIXUP: "FastEthernet0.2":
*Nov 25 22:46:44.027:   802.1Q Id 12 : Native:FALSE
*Nov 25 22:46:44.027:   ENCAP TYPE : ARPA
Router-F(config-subif)#exit
Router-F(config)#
Router-F(config)#interface FastEthernet 0.3
Router-F(config-subif)#encapsulation dot1Q 13
*Nov 25 22:48:05.663: VLAN_TABLE_CHANGE: "FastEthernet0.3":ENCAP
*Nov 25 22:48:05.663: VLAN-ENCAP: "FastEthernet0.3":802.1Q Id 13:
*Nov 25 22:48:05.663: VLAN_ENCAP_FIXUP: "FastEthernet0.3":
*Nov 25 22:48:05.663:   802.1Q Id 13 : Native:FALSE
*Nov 25 22:48:05.663:   ENCAP TYPE : ARPAd


.1qの設定一発目は fa0 に対してネイティブVLANの設定が走っている。L2側でもネイティブVLANを通さなければならない仕様だろうか。

ここで、LANケーブルの挿し間違いに気づいた。たいへんに間が抜けたことだが、トラブルシューティングの練習にはなった。











ARPあたりとVLANあたり

例によってイージスさんからこのあたり。
http://www.infraexpert.com/study/gateway1.htm
 
・Juniper SRX が ARPに応答しない
・BIG-IP でバーチャルサーバを設定したケースにおいて iRuleが…

iRuleって何夜年。

TELさんのこちら
http://cn.teldevice.co.jp/product/etcdetail/f5_irule_guide
http://cn.teldevice.co.jp/product/etcdetail/f5_irule_guide/page/2

F5のこれ
http://www.f5networks.co.jp/shared/pdf/irule_atoz.pdf

iRuleの氷山の表面のホコリ程度の理解を得たところで、イージスさんの「例えばアウトバウンド通信に対して送信元アドレス変換を行う定義をiRuleで定義した場合は…」

?

アウトバウンドのソースアドレスのアドレス変換後に対してARPリクエスト??? 3minuts のネット君比で100分の1ぐらい今の私はアタマが弱い。SRX同士のルートベースVPN接続のケースに関してはさらに…阿寒湖れは。


次にVLANあたり。

MAC VLAN、サブネットVLAN、柔軟VLAN。.1xでAD連携な時世でなかった当時のお話。AD連携どころか .1xの設定をやったことがない私にはこれでも十分未知だが。

技評さんから

知られざるActive Directory技術の「舞台裏」
第2回 誰も教えてくれないActive DirectoryとLDAPの「本当の関係」[後編]

http://gihyo.jp/admin/serial/01/ad2010/0002


1.qのところで

Tag Protocol Identifier 16ビット

Priority Code Point 3ビット
Canonical Format Indicator 1ビット…イーサは0

VLAN Identifier 12ビットなので4096


うしろの3つを指して Tag Control Information 、識別子16+制御3情報で16、都合32ビット。イーサフレームとして1522バイト。

 
(生まれた)まんまVLANがタグ無で流す情報は。

・ しすこディスカバリーちゃねるもといプロトコル
・ ポート Aggregation プロトコル
・ しすこ VLANトランクプロトコル
・ 同 ダイナミック…

ねいてぃぶVLANだからね。


ポートのモード設定は、選択はいろいろあるがつまるところアクセスとトランクの2つ、トランクはお約束でたぶんこんなかんじ。

interface Gigabit(Fast)Ethernet0/いくつ
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 92-94,96,99-136
 switchport mode trunk
 switchport nonegotiate


尚、この例で-136にしている理由は、

%SPANTREE_VLAN_SW-2-MAX_INSTANCE: Platform limit of 128 STP instances exceeded.
 
だから。そして追加の場合は switchport trunk allowed vlan に続いて add で

(config-if)#sw t a v ad 79

除外は remove で

(config-if)#sw t a v r 99

, 区切りでVLANひとつひとつ、- で連続するVLAN IDを変更可。また、except や all の指定もあるとのこと。なるほど使いそうにない。設定後の確認は、show vlan や show vlan brief 以外に、switchportについてこのような。


L2#show interfaces fa 0/48  switchport
Name: Fa0/48
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: 77,79,100-136
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL

Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
L2#

プライベートVLANは全く不勉強で何っだけ? 状態。ざっとながめると、VTPでトランスペアレントなアイソレーテッドな区分にしておく、ということで、アイソレーテッドでない場合はコミュニティと。


 switchportについてこのような確認ができる一方で trunk も。

L2#show interfaces fa 0/48  trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/48      on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/48      77,79,100-136

Port        Vlans allowed and active in management domain
Fa0/48      77,79,100-136

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/48      77,79,100-136

L2#


VTPは…Ciscoさまに絶対忠誠を誓って上納金の重荷に耐え続ける分には、まぁ便利なんでしょうけれども。気が乗らないのでこの先はまた明日。



2015年11月25日水曜日

シスコスイッチ 機械操作の基本メモ2


Ternary CAM

ternaryって何やねんですが、Weblioさんではこのように。
http://ejje.weblio.jp/content/ternary

ま、これを言ったら、Content Addressable Memory も 土内屋年ですが。Catalystがそもそもシスコじゃないなんて話は既に何分の1世紀か過去の話です。

さておき、ポートASICがTCAMを内部に持っていて、多機能のようです。 検索はTCAMにのっけて、エントリそのものはSRAMで高速化ちゅーことのようですが、なぜそのような原理が成り立つことやら半導体/ロジックのド素人には見当どころか邪推もできません。

多機能とやらは

・MACアドレステーブル
・マルチキャストテーブル
・たぶんおそらくCEFのAdjacencyテーブル
・FIB/Forwarding Information Base (RFC3222らしい)
・QoS ACL
・セキュリティACL

これらを柔軟に運用できるらしい、という程度の解釈しかしてませんが、これも誤っているかもしれません。

TCAMはさておきCEFについてはこちらなど。
http://gihyo.jp/admin/serial/01/net_prac_tech/0008


Switch Database Management てんぷれーとはまた今度。(のだめ風)


Power Sourcing Equipment ---> Power Device って、うーん。af/at以外にPoE でもCisco 独自モードってうーん*2。VLAN単位に設定するってうーん*3。

#show power inline


LLDPって、Ciscoの世界にたとえるならCDPだったんだナルホド!!! 目から鱗ならぬ目ヤニをぬぐった気分。

Stack関連もまた今度。3750が出てからかれこれ10数年!? 早いなー。


ここで急にIPルーティングに戻って。

ルータ側の初歩はさすがに飛ばすとして、

# route add -net 192.168.193.0/24 gw 172.19.19.2 eth0

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.193.0   172.19.19.2     255.255.255.0   UG    0      0        0 eth0
192.1.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         192.1.1.100   0.0.0.0         UG    0      0        0 eth0

Staticは追加されたものの、 なぜにリンクローカルアドレス16ビットマスクの1行が!? DHCPサーバ機能関係かとも想像するがちょっとさておき。

Staticで一時しのぎをして定期メンテ後に大騒ぎというドタバタ劇をやらかさないためには UnixPower on Networking さんより
http://www.unix-power.net/linux/route.html

network-scripts以下に
route-インターフェース
なファイルを作成して、そこへ
ネットワーク/プレフィックス via 託す先

という作法。













2015年11月24日火曜日

シスコスイッチ 機械操作の基本メモ1

ここでの基本とは

POST: PortASIC CAM Subsystem Tests : Begin
POST: PortASIC CAM Subsystem Tests : End, Status Passed

POST: PortASIC Port Loopback Tests : Begin
POST: PortASIC Port Loopback Tests : End, Status Passed

の文字を読みましょう、という時点から。基本もスタートライン以前です。


#バージョン情報の参照
モデル名
フィーチャー
OSバージョン
ROMバージョン
起動後の経過時間
ブート時に使用したOSファイル名とOSファイルの所在
CPU+DRAMサイズ
シリアルNo.
VLAN数
インターフェース数
商品品番
Ciscoによるブート時の動作指定値(こんふぃぎゅれーしょんれじすた)

#カレントな設定情報
設定ファイルサイズ
OSバージョン
忘れると致命傷な service password-encryption

#インターフェース
show interfaces status
ip default-gateway いくつ
banner motd しゃープ

デフォルト mdx auto
interface range

cle mac- dyn
を投げてもさっぱり消えないmacがあるので何かと思ったら Windows PCが Simple Service Discovery Protocol をまき散らしていた。マルチキャストの 239.255.255.250。ncpa.cpl な設定の中には、SSDPを除外できそうな項目が無い。そこでアヤシそうなプログラムをひとつアンインストールしてみたら、それはSSDPとは無関係で、しかもWiresharkのデータ解析に使う(Wiresharkそのものではない)ツールだった。無知は愚か、知らないのにやらかすのはよりいっそう愚かだ。

さておき clear mac-address-table の続き。

L2(config)#mac address-table static  macm.acma.cmac vlan 1 interface FastEthernet ?
  <0-0>  FastEthernet interface number


16ビットどっと区切りのVLAN-INTの書式。永続的にキャッシュなんてよっぽど特殊なケースでしかやらんと思うがこれも私が無知なだけの可能性は大。

また、無知誤用な私にはニーズが見えないagingタイム変更。存在しないVLANに対しても設定は入るようだが、試しているのは昔の機器なので今はどうか知らない。

L2(config)#mac address-table aging-time 299 vlan 2


ポートセキュリティは

手動式
制限付き自動式
べとべと式

の3つ。うしろ2つの違いは、copy run starで再起動後に持ち越せるかどうか、と、エージングタイムが無期限になるかどうか。如何せん無知で思考が硬直なので、これらの活用シーンの想像に苦しむ。

無期限の場合はともかくとして、エージングタイムは0-1440分。

それから、上限数はVEN毎のVLAN毎に決まっているらしいがそもそも、VEMって何だ!? な低次元でどうやら

Virtual Ethernet Modul

であるようだ。Nexus系では Virtual Supervisor Module という概念もある。詳しくはしすこ本家のコレで。
http://www.cisco.com/cisco/web/support/JP/docs/SW/DCSWT/Nex1000VSWT/CG/030/b_Cisco_Nexus_1000V_Security_Configuration_Guide_2_1_1_chapter_01011.html?bid=0900e4b182eb8de0

デバイスあたりの上限は8192で、インターフェース毎のでふぉると最大数は1、VLANあたりはでふぉるとの最大数が無いとのこと。VLANの最大数設定はトランクでないと無意味ともある。

まだ、利用シーンが見えない超低次元。あるいは、コルセンのような端末がガッチリ決まっている場所なら有用であるだろうか。


違背冒涜モード(ヴぁいおれーしょんモード)においては


防護
制限
閉鎖

の3つ。前の2つの違いはSNMPトラップ/syslogがあるかどうか、後ろの2つの違いは、ポートを閉める(errdisable)かどうか。


次に、設定のシゴトについて。

L2(config-if)#switchport port-security ?
  aging        Port-security aging commands
  mac-address  Secure mac address
  maximum      Max secure addresses
  violation    Security violation mode
  <cr>

L2(config-if)#switchport port-security
Command rejected: FastEthernet0/3 is a dynamic port.
L2(config-if)#

どうも私が、概念自体ろくにわかっていないか、とてつもなく浅はかであるようで。


(config-if)#switchport port-security mac-address ?
  H.H.H   48 bit mac address
  sticky  Configure dynamic secure addresses as sticky

でふぉは制限付き自動式、このでふぉは、switchport access を設定した後のでふぉ!? ということかもしれない。これを確認するには、アクセスポートの下にリピータHUBをぶら下げて端末2台つないでみればいいか。ああ面倒くさい。
 
と、ここで。端末1台としてCentOS機のほうをリピータHUBにぶら下げてみたのだが、ブートが遅い遅い。

さておき、 端末2台をぶら下げてみたが、2台ともL2越しのでふぉげルータにpingが通る。ダイナミックでインターフェース毎最大がデフォ1ならが1台しかつながらない状況でありそうなものだがそうではない。しかしここで、

switchport mode access

の入力をしていないことに気づいて試したところ

L2(config-if)#switchport mode access
Nov 24 17:39:22.707: PSECURE: psecure_port_dtp_modechange invoked

 invoke the protection of…

で何やら切願されてしまったようだ。また、この状態でpingは2台とも通ったままだ。

L2#show port-security
Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action
                (Count)       (Count)          (Count)
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port)     : 0
Max Addresses limit in System (excluding one mac per port) : 6272

何も検出していない。当該ポートにポートセキュリティの最大数をあらためて設定してみても、

L2(config-if)#switchport port-security maximum 1
L2(config-if)#end
L2#
Nov 24 17:49:53.466: PSECURE: Max addresses per port = 6272
Nov 24 17:49:53.466: PSECURE: Max addresses per port = 6272

 ポート毎の最大は6272ですよというログが。デフォが1でなければ、最大数1の設定もできない?? そんなわけもないのでこちらさま。

Office N-Studyhttp://www.n-study.com/network/2011/10/post_127.html

「restrictのモードは、イーサネットフレームを破棄して、セキュリティ違反があったことをログに残します。」

先の時点ではヴぁいおれーしょんを設定していなかったので、

L2(config-if)#switchport port-security violation restrict

追加。すると


PSECURE: Initializing port-secure sub block
PSECURE: Violation mode is: 1
%SYS-5-CONFIG_I: Configured from console by console
PSECURE: psecure_get_next_mac_from_hat: returning NULL on Fa0/3

from_hatがわからないが、エラーはあがるもののPC2台のPingは落ちない、という状況。

あるいは、時系列的に設定変更以前からのトラフィックだから? んなわけがあるかと思って両PCのLANケーブルを一時抜いてみたが、再び挿すと2台ともPingが通る。また、この際にL2において

#show debug
Port Security:
  All Port Security debugging is on

であるにも関わらず、何らログメッセージが生じない。設定が無効としか思えないが、先のログのように一部の PSECURE: はあがってくる。無効ではない、不完全だということか。ここで

switchport port-security

を再度設定すると、2台のうち1台が Destination Host Unreachableとなった。つまり、

switchport access # vlanは指定しない
switchport port-security

を設定した後、violationを設定して相応の結果になる、ということのようだ。また、この時点においてlog上では


PSECURE: swidb = FastEthernet0/3 mac_addr = PC2のMACアドレス vlanid = 1
PSECURE: Adding 0023.8ba0.35a7 as dynamic on port Fa0/3 for vlan 1
PSECURE: Violation/duplicate detected upon receiving PC2のMACアドレス on vlan 1: port_num_addrs 1 port_max_addrs 1 vlan_addr_ct 1: vlan_addr_max 65535 total_addrs 0: max_total_addrs 6272
PSECURE: Security violation, TrapCount:68
PSECURE: Read:69, Write:70

 延々とこれを吐きまくる。debugを止めていないのか? と思ったが、show debugには何もなく、restrict を protect に変更しても吐き続ける。それどこか、ポートセキュリティによって拒否されたPC2のLANケーブルを切り離してもまだ。

当然、この時点では mac-address-tableにはのってない。それでも、

%PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address PC2のMACアドレス on port FastEthernet0/3.

をおよそ6秒毎に、えんえんと吐き続ける。あるいは、arpテーブルが消えるまで待ってみるか。といっても、

ARP type: ARPA, ARP Timeout 04:00:00

なので、本当に待っているわけにはいかない。これはあらためて。


それから、いーじすさんの設定例中には

L2(config-if) # switchport port-security aging time 30
L2(config-if) # switchport port-security aging type inactivity

inactivity は an inactive volcano や an inactive member というように使われるようで、ここでは不活性後30分、ということかと。おそらくたぶん。