ホームポジションの高さが低くなっているキーボード

ある有名メーカーのキーボードにはホームポジションであるFとJのキーに突起等をつけずにかすかに高さをさげて識別できるようにしているものがある。

私も使っているのだがいつものように突起を探してなでても見つからないので何だコレはと怒ったのであるが、言われてみてよく見てみたらたしかに少しへこんでいて触るとなんとなくわかる。

どうやら昔はすべてのキーボードがそうだったようで、最近違うものも作り始めたため混在しているようだ。

慣れた人にはそちらがいいらしいが、私はそのメーカー以外にそんなキーボードをみたことがない。私はUIにこだわるメーカーが好きである。しかし独自性にこだわるのは嫌いだ。そういう点ではソニーやIBMのUIは親切で節度があって常識的なので好きだ。

恥ずかしい思い出

これはかなり恥ずかしい思い出であるが・・・
社会人になって2,3年たって、金がなくて困っていたときの話。

JCBとかUCとかのクレジットカードの枠も使い切ってしまい、どうしようもなくなっていたとき、スポーツ新聞の広告で、文句はわすれたが、限度いっちゃった人にもお金貸します、みたいなのを見つけて電話した。

そして、電話口で、今借りてる融資先と金額を教えてくれと言われて全部正直に話し、審査して折り返し電話しますといわれ、審査を待つ。

しばらくして電話がかかってきて、カネを貸すことはできないがパソコンをローンで買う契約をしてもらえばそれを現金で買い取る、ということを言われた。

そして店と商品名まで指定された。ソなんとかで、N○○のNSRとかいうのを買えば、10万で買い取るというのである。

わたしはソなんとかへ行って、指定されたNSRとかいうPCを見つけた。そして店員にこれください、と言った。店員はちょっとびっくりしたが、「21万8000円になります」ときっぱりと言った。この価格は今でもはっきり覚えている。

そしてわたしは買取屋に指示されたとおりに「ローンにしてください」と言って、かなり長いローンにした。10回以上だったのは間違いない。

そしてそのノートPCを持って、指定された受け渡し場所へ行った。

しばらくして、わたしより少し若いぐらいの、ちょっと無精ひげのある男がやってきて、新品のパソコンと引き換えにわたしは10万円を手にした。その男は今にして思えば、か『馬鹿だなこいつ』という顔をしていた。わたしは10万円を手にいれて、その後何をしたのか、覚えていない。


似たようなことがもうひとつある。それもこの頃だったと思うが、この前か後かは覚えていない。

同じような状況になってやはりスポーツ新聞の広告を見て電話したら、新宿にあるビルの一室に呼ばれた。

そしてそこでやはり融資状況をあらいざらい打ち明けると、やはりローンで買い物をするように指示された。

しかしこのときは1品を買ってそれを現金と引き換えるのではなく、引き落とし日までに先方から振り込むということであった。

さすがのわたしもこれは危険すぎると思い、「こんなことをいっては失礼かもしれませんが」と前置きをして、「もし振り込まれなかったとしてもわたしは文句を言うことができないですからこれは受け入れられません」と丁重に断ってその場を去った。

そのとき相手は「振り込まないなんてそんなことはありませんよ」と静かに対応していたが、その冷静さが逆にあやしかった。


パソコンとはもうまったく関係ない話になってしまったがついでなのでもうひとつ。

東スポの広告。社名もはっきり覚えている。勤め人に最適な副業、月収15万も可能などとある。宅配のレンタルビデオ業で、50万円でビデオ50本を仕入れて、それをレンタルする。

50万はローンで払う。ビデオは剥がしたらわかるようになっているシールで封をされ、見た分だけの料金を払う。1本500円。5本のテープを箱に入れて配る。

まずは顧客獲得から始まる。近所にチラシを配る。当然そこには自分の連絡先も記している。1000枚だったかな。そのチラシも買い取るのである。自転車に乗って自宅周辺のアパートなど、単身者のいそうなところに投函する。

結局、会員となったのは一人であった。5本を全部見て2500円、それが毎週でも1万円にしかならない。大赤字である。

そもそも、大事な商品であるビデオが非常に粗悪品であった。何本か見てみたが、レンタルもしてないような、ホテルで流されているような最低の品質である。女優も無名のものばかり。あ、申し遅れましたが当然アダルトビデオです。

そしてその大切なたった一人の会員様も、せいぜい1、2本しか見ない。しかも回収に行っても留守なことが多くて、ぜんぜんペイしない。

最終的には会員がやめたかわたしが廃業したかは忘れたが、50万がほぼ全額「授業料」として借金になった。


これまた副業という広告が出ていて、説明会に行ってみたら、30万円の布団を買い、同じものを5人に買うようにすすめ、もし買えばいくらかがバックされ、さらにその紹介者が紹介した人も買えば・・・・といういわゆるマルチ商法だったことがある。

わたしはその仕組みを聞いて、別に矛盾を見つけたりマルチだから違法だとかは思わなかったが、もしそんなことが可能なら別に布団なんか買わなくても上納金だけを納めればすむじゃないか・・・などと思って、その場から去った。

後から自宅に電話がかかってきて念をおされたが断ると、「そうですか、では地道に稼いでください」とイヤミを言われた。



catalyst 2900 での etherchannel

できないと思い込んでいたのだが、
(config-if) port group 1

と、複数I/Fでやれば束ねることができるようだ。
ただし pagpとかlacpはサポートしていないのでstaticにしか設定できない。
ちなみに私はこの二つのプロトコルをパグピー、ラクピーと呼んでいる。
いまだかつてこの用語が会話にでてきたことはない。
「リンクアグリゲーション」なら出てきたが。
しかしたぶん、みんなパグピー、ラクピーと呼んでいるはずだ。

htmlタグの置換

最近秀丸で正規表現による検索や置換をするようになってきたのだが、ひとつわからないことがある。多分、簡単にできる方法があると思うので、メモしておく。たとえば、htmlタグの閉じるタグ、なんと呼ぶのかわからないが、
</div>とか、</a>とかいうタグ。

このタグがあったら、その後ろで改行したいというとき。検索するのは、 </.*> とやればよい。しかし、それを置換するときに、</.*>\n とすると、.*の部分を検索対象文字列に置き換えてはくれない。
・・・わかりました。
検索:(</.*>)
置換:\1\n

\1というのは、()で囲った検索内容を変数とするものです。複数あれば、\1,\2...と使えます。yy/mm/ddを yy年mm月dd日に置換するような場合に使います。これは便利だ。多分viとかでも同様のやり方があるはず。
...
\1とかはlinuxも同じだ、と思ったら、</.*>がうまくいかない。1回目はうまくいくが、連続すると/なしの普通のタグが引っかかってしまう。

素人

ハングアップしたら原因を突き止めようとするのが素人とにかく上げるのが玄人

MSをけなしながら違法コピーのWindowsを使うのが素人カネを払ってWindowsを使い続けるのが玄人

わざわざIE以外のブラウザをいれるのが素人ツールバーすら入れないのが玄人

不具合に怒って改善を求めるのが素人違うものを使うのが玄人

ハングアップしたらあせるのが素人ののしるのが玄人

パソコンをこの子と呼ぶのが素人これと呼ぶのが玄人

サポートセンターに電話して文句を言うのが素人イヤミを言うのが玄人ののしるのは野蛮人

Windowsをシャットダウンする時

家のPCのキーボードにはWindowsキーがない。

会社のにはある。

会社では電源を切る時に、Windowsキー、U、Enterを順に押しているが、家ではそれができない。

スタートボタンを押してシャットダウンをクリックするのは結構面倒である。そこでWindowsキーのついたキーボードに換えてみた。

ところが、Vistaでは、windowsキーを押すと、新しくできた検索窓にカーソルがフォーカスされていて、Uでシャットダウンできないのである。

右矢印キーを3回くらい押して下矢印でシャットダウンを選ぶ必要がある。めんどくさい。

以前、delphiで起動するとPCを無条件シャットダウンするものをつくったのだが、それが必要なようだ。

それを使うのならキーボードを換える必要はなかった。

dot1xについて(答えなし)、trunkについて

2950を2台落とした。3550のEMIが99000円で落とせる。買いだとは思うがもう無理だ。

dot1x認証の話がでてくるのだが、なんだかよくわからない。外部サーバに認証してもらうということだが、どういう仕組みなんだろう?aaaサーバとradiusサーバって違うのか?aaaサーバのひとつがradiusサーバなのか?aaaサーバってapacheみたいにfreeで提供されてるのか?
どうやって立てるのか?

古いスレで上書きしてしまったのでもう一度書く。

ciscoがtaggedではなくtrunkと呼ぶ理由は、dot1qより前(?)にislというカプセル化方式を使っていたからである。islもタグといえなくもないが。
「複数のVLANを物理的に一本の線に通す」と言う意味でtrunkと呼ぶのである。それを実現するための技術が tagであり、islである、と言うことである。

HSRPとportfastの実験

 2514_1       2514_2
  |.101        |.102
  |            |
  |   (.100)   |
  |            |
  |   ------   |
  +---+ SW +---+
      ------
        |      192.168.1.0/24
    pc

2514_1
priority:100 (default)
preemptあり

2514_2
priority:90
preemptなし



この状態から 2514_1をダウンさせる。
2514_2#debug standby events
HSRP Events debugging is on
2514_2#
2514_1がリンクダウン
2514_2#
00:13:15: SB1: Et0 Standby: c/Active timer expired (192.168.1.101)
00:13:15: SB1: Et0 Active router is local, was 192.168.1.101
00:13:15: SB: Et0 Remove active hash 192.168.1.101 (vIP 192.168.1.100)
00:13:15: SB: Et0 Add passive hash 192.168.1.101
00:13:15: SB: Et0 Add active hash 192.168.1.102 (vIP 192.168.1.100)
00:13:15: SB1: Et0 Standby router is unknown, was local
00:13:15: SB1: Et0 Standby - Active
00:13:15: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Standby -> Active
00:13:15: SB1: Et0 Redundancy "hsrp-Et0-1" state Standby -> Active
00:13:15: SB: Et0 Redirect adv stop
00:13:15: SB1: Et0 Changing interface MAC address to 0000.0c07.ac01
2514_2#
2514_2#sho standby
Ethernet0 - Group 1
Local state is Active, priority 90
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 1.140
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is unknown
Virtual mac address is 0000.0c07.ac01
8 state changes, last state change 00:00:19
IP redundancy name is "hsrp-Et0-1" (default)
2514_2がactiveになった。

ここで2514_1がリンクアップすると、

2514_2#
00:14:14: SB1: Et0 Active: j/Coup rcvd from higher pri router (100/192.168.1.101)
00:14:14: SB1: Et0 Active router is 192.168.1.101, was local
00:14:14: SB: Et0 Remove active hash 192.168.1.102 (vIP 192.168.1.100)
00:14:14: SB: Et0 Remove passive hash 192.168.1.101 (frc 0)
00:14:14: SB: Et0 Add active hash 192.168.1.101 (vIP 192.168.1.100)
00:14:14: SB1: Et0 Active -> Speak
00:14:14: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Active -> Speak
00:14:14: SB1: Et0 Redundancy "hsrp-Et0-1" state Active -> Speak
00:14:14: SB: Et0 Redirect adv start
00:14:24: SB1: Et0 Speak: d/Standby timer expired (unknown)
00:14:24: SB1: Et0 Standby router is local
00:14:24: SB1: Et0 Speak -> Standby
00:14:24: SB1: Et0 Redundancy "hsrp-Et0-1" state Speak -> Standby
priorityが高い2514_1が現れ、preemptが設定されているため、
2514_1がactiveになり、2514_2はstandbyになる。

2514_1#sho standby
Ethernet0 - Group 1
Local state is Active, priority 100, may preempt
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.044
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.102, priority 90 expires in 8.620
Virtual mac address is 0000.0c07.ac01
11 state changes, last state change 00:02:53
IP redundancy name is "hsrp-Et0-1" (default)
2514_2#sho standby
Ethernet0 - Group 1
Local state is Standby, priority 90
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 2.064
Virtual IP address is 192.168.1.100 configured
Active router is 192.168.1.101, priority 100 expires in 7.828
Standby router is local
10 state changes, last state change 00:00:12
IP redundancy name is "hsrp-Et0-1" (default)
2台のルータのhsrpのconfigは以下のとおり。
2514_1#sho run
Building configuration...

!
interface Ethernet0
ip address 192.168.1.101 255.255.255.0
standby 1 ip 192.168.1.100
standby 1 preempt
!

2514_2#sho run
Building configuration...

interface Ethernet0
ip address 192.168.1.102 255.255.255.0
standby 1 ip 192.168.1.100
standby 1 priority 90
!
2をdownさせるとstandbyがいなくなるだけで、1はactiveのまま。

2514_2をupさせると、preemptが設定されてはいるが、1のほうがpriorityが高いのでやはり1がactiveのまま。

2514_2がup
2514_1#
00:40:46: SB1: Et0 Hello in 192.168.1.102 Active pri 90 ip 192.168.1.100
00:40:46: SB1: Et0 Active: h/Hello rcvd from lower pri Active router (90/192.168.1.102)
00:40:49: SB1: Et0 Redundancy group hsrp-Et0-1 state Active -> Active
00:40:52: SB1: Et0 Redundancy group hsrp-Et0-1 state Active -> Active
00:40:56: SB1: Et0 Standby router is 192.168.1.102
2514_1#
2514_1#sho standby
Ethernet0 - Group 1
Local state is Active, priority 100
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 2.498
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.102, priority 90 expires in 7.912
Virtual mac address is 0000.0c07.ac01
14 state changes, last state change 00:02:59
IP redundancy name is "hsrp-Et0-1" (default)
ではここから1をdown&upさせたらどうなるか。
1がdownすると当然2がactiveになるが、1をupさせるとpriorityの高い1がactiveになった。
1にはpreemptを設定していないのに・・・・
2514_2#
00:41:49: SB1: Et0 Standby: c/Active timer expired (192.168.1.101)
00:41:49: SB1: Et0 Active router is local, was 192.168.1.101
00:41:49: SB: Et0 Remove active hash 192.168.1.101 (vIP 192.168.1.100)
00:41:49: SB: Et0 Add passive hash 192.168.1.101
00:41:49: SB: Et0 Add active hash 192.168.1.102 (vIP 192.168.1.100)
00:41:49: SB1: Et0 Standby router is unknown, was local
00:41:49: SB1: Et0 Standby -> Active
00:41:49: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Standby -> Active
00:41:49: SB1: Et0 Redundancy "hsrp-Et0-1" state Standby -> Active
00:41:49: SB: Et0 Redirect adv stop
00:41:49: SB1: Et0 Changing interface MAC address to 0000.0c07.ac01
2514_2#
2514_2#sho stand
Ethernet0 - Group 1
Local state is Active, priority 90, may preempt
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 1.584
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is unknown
Virtual mac address is 0000.0c07.ac01
26 state changes, last state change 00:00:33
IP redundancy name is "hsrp-Et0-1" (default)
2514_1がup

2514_1#
00:43:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
00:43:31: SB: Et0 Interface up
00:43:31: SB: Et0 Starting minimum interface delay (1 secs)
00:43:32: SB: Et0 Interface min delay expired
00:43:32: SB1: Et0 Init: a/HSRP enabled
00:43:32: SB1: Et0 Init -> Listen
00:43:32: SB1: Et0 Redundancy "hsrp-Et0-1" state Init -> Backup
00:43:32: SB: Et0 Redirect adv start
00:43:42: SB1: Et0 Listen: c/Active timer expired (unknown)
00:43:42: SB1: Et0 Listen -> Speak
00:43:42: SB1: Et0 Redundancy "hsrp-Et0-1" state Backup -> Speak
00:43:52: SB1: Et0 Speak: d/Standby timer expired (unknown)
00:43:52: SB1: Et0 Standby router is local
00:43:52: SB1: Et0 Speak -> Standby
00:43:52: SB1: Et0 Redundancy "hsrp-Et0-1" state Speak -> Standby
00:43:52: SB1: Et0 Standby: c/Active timer expired (unknown)
00:43:52: SB1: Et0 Active router is local
00:43:52: SB: Et0 Add active hash 192.168.1.101 (vIP 192.168.1.100)
00:43:52: SB1: Et0 Standby router is unknown, was local
00:43:52: SB1: Et0 Standby -> Active
00:43:52: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Standby -> Active
00:43:52: SB1: Et0 Redundancy "hsrp-Et0-1" state Standby -> Active
00:43:52: SB: Et0 Redirect adv stop
00:43:52: SB1: Et0 Changing interface MAC address to 0000.0c07.ac01
00:43:58: SB1: Et0 Hello in 192.168.1.102 Active pri 90 ip 192.168.1.100
00:43:58: SB1: Et0 Active: h/Hello rcvd from lower pri Active router (90/192.168.1.102)
00:44:01: SB1: Et0 Redundancy group hsrp-Et0-1 state Active -> Active
00:44:04: SB1: Et0 Redundancy group hsrp-Et0-1 state Active -> Active
00:44:08: SB1: Et0 Standby router is 192.168.1.102
2514_1#2514_1#sho standby
Ethernet0 - Group 1
Local state is Active, priority 100
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 1.010
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.102, priority 90 expires in 9.536
Virtual mac address is 0000.0c07.ac01
17 state changes, last state change 00:00:22
IP redundancy name is "hsrp-Et0-1" (default)
では、両方preemptを消して見よう。
こうすると1を down upさせても 2がactiveのままになるはず。

2514_1がdown
2514_2#debug stand eve
HSRP Events debugging is on

01:00:31: SB1: Et0 Standby: c/Active timer expired (192.168.1.101)
01:00:31: SB1: Et0 Active router is local, was 192.168.1.101
01:00:31: SB: Et0 Remove active hash 192.168.1.101 (vIP 192.168.1.100)
01:00:31: SB: Et0 Add passive hash 192.168.1.101
01:00:31: SB: Et0 Add active hash 192.168.1.102 (vIP 192.168.1.100)
01:00:31: SB1: Et0 Standby router is unknown, was local
01:00:31: SB1: Et0 Standby -> Active
01:00:31: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Standby -> Active
01:00:31: SB1: Et0 Redundancy "hsrp-Et0-1" state Standby -> Active
01:00:31: SB: Et0 Redirect adv stop
01:00:31: SB1: Et0 Changing interface MAC address to 0000.0c07.ac01
2514_2#
2514_2#sho stand
Ethernet0 - Group 1
Local state is Active, priority 90
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.396
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is unknown
Virtual mac address is 0000.0c07.ac01
34 state changes, last state change 00:00:14
IP redundancy name is "hsrp-Et0-1" (default)
2514_1がup
2514_2#
01:01:26: SB1: Et0 Active: j/Coup rcvd from higher pri router (100/192.168.1.101)
01:01:26: SB1: Et0 Active router is 192.168.1.101, was local
01:01:26: SB: Et0 Remove active hash 192.168.1.102 (vIP 192.168.1.100)
01:01:26: SB: Et0 Remove passive hash 192.168.1.101 (frc 0)
01:01:26: SB: Et0 Add active hash 192.168.1.101 (vIP 192.168.1.100)
01:01:26: SB1: Et0 Active -> Speak
01:01:26: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Active -> Speak
01:01:26: SB1: Et0 Redundancy "hsrp-Et0-1" state Active -> Speak
01:01:26: SB: Et0 Redirect adv start
01:01:36: SB1: Et0 Speak: d/Standby timer expired (unknown)
01:01:36: SB1: Et0 Standby router is local
01:01:36: SB1: Et0 Speak -> Standby
01:01:36: SB1: Et0 Redundancy "hsrp-Et0-1" state Speak -> Standby
2514_2#
2514_2#sho stand
Ethernet0 - Group 1
Local state is Standby, priority 90
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 1.296
Virtual IP address is 192.168.1.100 configured
Active router is 192.168.1.101, priority 100 expires in 7.560
Standby router is local
36 state changes, last state change 00:01:08
IP redundancy name is "hsrp-Et0-1" (default)
あれ、おかしいな、1がactiveになった・・・

これは、2台のルータを接続しているcatalystのポートがデフォルト設定のままのため、link upまでに30秒かかっていることが原因と思われる。portfastを設定して即時リンクアップするようにしたら1が復帰しても2がactiveのままになった。

では、portfastを設定した状態で、priorityの低い2だけにpreemptを設定した場合をもう一度やってみる。

まず、1:active, 2:standyで、1をdown upさせた場合。
2514_2#sho stand
Ethernet0 - Group 1
Local state is Standby, priority 90, may preempt
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.750
Virtual IP address is 192.168.1.100 configured
Active router is 192.168.1.101, priority 100 expires in 9.340
Standby router is local
10 state changes, last state change 00:00:13
IP redundancy name is "hsrp-Et0-1" (default)
2514_1がDOWN
2514_2#
00:16:35: SB1: Et0 Standby: c/Active timer expired (192.168.1.101)
00:16:35: SB1: Et0 Active router is local, was 192.168.1.101
00:16:35: SB: Et0 Remove active hash 192.168.1.101 (vIP 192.168.1.100)
00:16:35: SB: Et0 Add passive hash 192.168.1.101
00:16:35: SB: Et0 Add active hash 192.168.1.102 (vIP 192.168.1.100)
00:16:35: SB1: Et0 Standby router is unknown, was local
00:16:35: SB1: Et0 Standby -> Active
00:16:35: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Standby -> Active
00:16:35: SB1: Et0 Redundancy "hsrp-Et0-1" state Standby -> Active
00:16:35: SB: Et0 Redirect adv stop
00:16:35: SB1: Et0 Changing interface MAC address to 0000.0c07.ac01
2514_2#
2514_2#sho stand
Ethernet0 - Group 1
Local state is Active, priority 90, may preempt
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 2.712
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is unknown
Virtual mac address is 0000.0c07.ac01
11 state changes, last state change 00:00:09
IP redundancy name is "hsrp-Et0-1" (default)
2514_1がup
2514_2#sho stand
Ethernet0 - Group 1
Local state is Active, priority 90, may preempt
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 2.684
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.101, priority 100 expires in 9.036
Virtual mac address is 0000.0c07.ac01
11 state changes, last state change 00:00:55
IP redundancy name is "hsrp-Et0-1" (default)
1のほうがpriorityが高いが、preemptを設定していないので、2がactiveのままとなる。

では、preemptを設定した2をdown upさせる。

2514_2がdown
2514_2#
00:17:53: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to down
00:17:53: SB: Et0 Interface down
00:17:53: SB1: Et0 Active: b/HSRP disabled
00:17:53: SB1: Et0 Active router is unknown, was local
00:17:53: SB: Et0 Remove active hash 192.168.1.102 (vIP 192.168.1.100)
00:17:54: SB1: Et0 Standby router is unknown, was 192.168.1.101
00:17:54: SB1: Et0 Active -> Init
00:17:54: %STANDBY-6-STATECHANGE: Ethernet0 Group 1 state Active -> Init
00:17:54: SB1: Et0 Redundancy "hsrp-Et0-1" state Active -> Init
2514_2#
2514_2#sho standby
Ethernet0 - Group 1
Local state is Init (interface down), priority 90, may preempt
Hellotime 3 sec, holdtime 10 sec
Virtual IP address is 192.168.1.100 configured
Active router is unknown
Standby router is unknown
12 state changes, last state change 00:00:06
IP redundancy name is "hsrp-Et0-1" (default)
2514_2#


2514_1#debug stand eve
HSRP Events debugging is on
2514_1#2514_1#sho stand
Ethernet0 - Group 1
Local state is Active, priority 100
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.096
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is unknown
Virtual mac address is 0000.0c07.ac01
14 state changes, last state change 00:00:43
IP redundancy name is "hsrp-Et0-1" (default)
2514_2がup
2514_1#2514_1#sho stand
Ethernet0 - Group 1
Local state is Active, priority 100
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.038
Virtual IP address is 192.168.1.100 configured
Active router is local
Standby router is 192.168.1.102, priority 90 expires in 8.944
Virtual mac address is 0000.0c07.ac01
14 state changes, last state change 00:01:27
IP redundancy name is "hsrp-Et0-1" (default)
00:19:18: SB1: Et0 Standby router is 192.168.1.102
2にはpreemptを設定してあるが、priorityが1より低いため、その機能は有効にならない。

HSRPはRFC2281、VRRPはRFC2338で定義(?)されている。
しかし2281はCategory: informationalで、2338は Proposal Standardである。
HSRPはcisco独自の規格であり、VRRPは汎用化されたためにそうなっているようであるが、
VRRPはHSRPを元に作られたようで、動きもそっくりなようだ。

・・・

やっぱり実際に設定して動かして見ないとわかんないね。
portfastとのカラミでおかしなことになるのもいい勉強になった。

priority値の優先順位

priority値はいろんなプロトコルで使われるが、大きいほうが優先されるの場合と逆の場合がある。STPのroot bridge検出は小さいほうがrootになる。HSRPのpriorityは大きいほうがactiveになる。hop countによるloopの検出も、IPは減算して0になったら検出し、LDPのloop検出は加算してmax countを超えたら検出する。こういうのって、どっちにするかって、何か基準があるのだろうか?

<大きいほうが優先されるもの>
  HSRPのactive/standby
  OSPFのrouter IDによるDRの選択
  OSPFのpriority

<小さいほうが優先されるもの>
  STPのroot bridge検出

STPの実験

pty:32768
mac:0004.2xxx.0ec0
   +----+10
   |24_1+--------------+
   +--+-+              |
      |2               |
      |                |
      |2               |10(X)
   +--+-+           +--+-+
   |24_2+-----------+12_1|
   +----+6         6+----+
  pty:32768            pty:32768
  mac:0003.fxxx.8580   mac:0004.9xxx.23c0
  ROOT

デフォルトの設定だと、24_2のMACが最小なのでルートになる。

各switchでの、show spanning-treeの結果(最初の部分だけ)
cata2924_01#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0004.2xxx.0ec0 ※自分のmac
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32768, address 0003.fe67.8580 ※root bridgeのMAC
Root port is 14, cost of root path is 19
Topology change flag not set, detected flag not set, changes 15
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0





cata2924_02#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0003.fxxx.8580 ※自分のMAC
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree ※自分がrootである
Topology change flag not set, detected flag not set, changes 14
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 1, topology change 0, notification 0

cata2912_01#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0004.9xxx.23c0 ※自分のMAC
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32768, address 0003.fxxx.8580 ※rootのMAC
Root port is 18, cost of root path is 19
Topology change flag not set, detected flag not set, changes 14
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0

ここでdebugを有効にしてから、24_1と12_1間のケーブルを抜いて、さして見る。
cata2924_01#debug spantree events
Spanning Tree event debugging is on
cata2924_01#
02:48:08: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to down
02:48:08: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
02:48:08: ST: FastEthernet0/10 vlan 1 -> blocking
02:48:09: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down
02:48:16: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to up
02:48:16: ST: FastEthernet0/10 vlan 1 -> listening
02:48:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to up
02:48:31: ST: FastEthernet0/10 vlan 1 -> learning
02:48:47: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
02:48:47: ST: FastEthernet0/10 vlan 1 -> forwarding
cata2924_01#

listening -> learning -> forwarding まで15秒ずつ、合計30秒かかっている。 15というのはforward delay の値である。それでは、24_1で、forward delayの値を変えて見よう。
cata2924_01(config)#spanning-tree forward-time 18

cata2924_01#
02:52:07: %SYS-5-CONFIG_I: Configured from console by consolesho spa
cata2924_01#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0004.2xxx.0ec0
Configured hello time 2, max age 20, forward delay 18
Current root has priority 32768, address 0003.fxxx.8580
Root port is 14, cost of root path is 19
Topology change flag not set, detected flag not set, changes 20
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0

2箇所あるforward delayのうち、Configuredで始まる行の方だけが、変更した値になっている。それではまた先ほどのようにケーブルを抜き差ししてみよう。
cata2924_01#

02:54:17: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to down
02:54:17: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
02:54:17: ST: FastEthernet0/10 vlan 1 -> blocking
02:54:18: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down
02:54:23: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to up
02:54:23: ST: FastEthernet0/10 vlan 1 -> listening
02:54:24: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to up
02:54:38: ST: FastEthernet0/10 vlan 1 -> learning
02:54:53: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
02:54:53: ST: FastEthernet0/10 vlan 1 -> forwarding

各stateの間隔は15秒のままである。他のスイッチのshow spanning-treeの結果をみても、15秒のままになっている。timerの値はrootで変更しなければ反映しない。
cata2924_02#conf t

Enter configuration commands, one per line. End with CNTL/Z.
cata2924_02(config)#spanning-tree forward-time 18
cata2924_02(config)#end
cata2924_02#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0003.fxxx.8580
Configured hello time 2, max age 20, forward delay 18
We are the root of the spanning tree
Topology change flag not set, detected flag not set, changes 20
Times: hold 1, topology change 38, notification 2
hello 2, max age 20, forward delay 18
Timers: hello 0, topology change 0, notification 0

forward delayの変更が反映された。 他のスイッチでもConfiguredのところは各自のconfigのままで、 下のほうにある値に反映されている。
cata2924_01#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0004.2xxx.0ec0
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32768, address 0003.fxxx.8580
Root port is 14, cost of root path is 19
Topology change flag not set, detected flag not set, changes 22
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 18
Timers: hello 0, topology change 0, notification 0





cata2912_01#sho spanning-tree

Spanning tree 1 is executing the IEEE compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address 0004.9xxx.23c0
Configured hello time 2, max age 20, forward delay 15
Current root has priority 32768, address 0003.fe67.8580
Root port is 18, cost of root path is 19
Topology change flag not set, detected flag not set, changes 20
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 18
Timers: hello 0, topology change 0, notification 0

もう一度ケーブルの抜き差しをしてみると
cata2924_01#

03:05:10: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to down
03:05:10: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
03:05:10: ST: FastEthernet0/10 vlan 1 -> blocking
03:05:11: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to down
03:05:14: %LINK-3-UPDOWN: Interface FastEthernet0/10, changed state to up
03:05:14: ST: FastEthernet0/10 vlan 1 -> listening
03:05:15: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to up
03:05:32: ST: FastEthernet0/10 vlan 1 -> learning
03:05:51: ST: sent Topology Change Notice on FastEthernet0/2 vlan 1
03:05:51: ST: FastEthernet0/10 vlan 1 -> forwarding

各stateの間隔が18秒になった。 timer値を変える場合はrootで変えなければならない。 ただし、むやみに変えるのはよくないそうです。

秀丸とvi

パソコンについては、何かをしたいからそのために必要なものを買う、ということよりも、とりあえず買ってみて、何ができるんだろうと模索するところがある。オタクと違うのは、ただ高性能を追求するのではなく、最終的には道具として使用するところである。

わたしはログファイルなどを検索したり置換したりするときはいつも秀丸を使っていたのだが、何万行もあるログから、その半分くらいの行を置換したときに、高速化しても20分くらいたっても終わらなかった。行頭が特定の文字+:で始まる行を削除しようとして、下記のような正規表現を指定した。

^ETHER:.*

時間がかかりすぎるので中断して、cygwinのviでやってみたら、数秒程度で終わった。

秀丸の弱点はほとんどないと思っていたのだが、これは意外だった。正規表現処理が遅いのだろうか?

viはとっかかりは悪いが使い込めばなんでもできることがわかってくる。

Macがいいらしい

Mac使ってる人多いですねえ。私なんかMacは終わったと思ってるんですが。もちろん売れてるのは知ってますけど、趣味で買ってるだけじゃないかとか思ってるんですがなんかそうじゃないみたい。Mac使うくらいならLinux使おうと思うけど。使ってみようかなと思うこともあるけど高いし。仕事で使った限りでは全然魅力を感じなかった。

以前一緒に仕事をしていた先輩にMacファンがいて、毎日のようにMacはいい、Windowsはクソだみたいに言っていたが、ある日、「でもMacは重いんだよね」ともらしていた。こりゃ相当重いんだなと思った。