アーカイブ

2011年12月

カテゴリ:

Object trackingを利用することで特定のルート情報があるかどうかにより、ルーティングを変更することが可能です。R1, R2, R4はそれぞれF0/0で124.124.124.0/24のネットワークで接続されています。R1はR3にシリアルケーブルで直結(13.13.13.0/24)、R2もR3にシリアルケーブルで直結(23.23.23.0/24)しています。

R1(config-if)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.1   YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config-if)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.2   YES manual up                    up
Serial1/2                  23.23.23.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R4(config-if)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            124.124.124.4   YES manual up                    up
Loopback0                  17.17.4.4       YES NVRAM  up                    up

R1, R2, R4でEIGRPを有効にします。

R1(config)#router eigrp 100
R1(config-router)#no auto-summary
R1(config-router)#network 0.0.0.0

R1とR2にHSRPを設定します。R1を優先的に利用するため、プライオリティを110としました。

R1(config-if)#int f0/0
R1(config-if)#standby 124 ip 124.124.124.254
R1(config-if)#standby 124 priority 110

R2(config-if)#int f0/0
R2(config-if)#standby 124 ip 124.124.124.254

今回はR1が13.13.13.0/24のネットワークを持っているかどうかにより、HSRPのプライオリティを変更します。trackコマンドに続いて、オブジェクト番号を指定します。ここでは1としました。

R1(config)#track ?
  <1-500>     Tracked object
  resolution  Tracking resolution parameters
  timer       Polling interval timers

R1(config)#track 1 ?
  application  Application
  interface    Select an interface to track
  ip           IP protocol
  list         Group objects in a list
  rtr          Response Time Reporter (RTR) entry
  stub-object  Stub tracking object

R1(config)#track 1 ip ?
  route  IP route

R1(config)#track 1 ip route ?
  A.B.C.D  {/nn || A.B.C.D}  Prefix and mask

R1(config)#track 1 ip route 13.13.13.0/24 ?
  metric        Route metric
  reachability  Route reachability state

R1(config)#track 1 ip route 13.13.13.0/24 reachability ?
  <cr>

R1(config)#track 1 ip route 13.13.13.0/24 reachability

track 1がダウンした場合、プライオリティ値を20減らす設定(110-20=90)をstandby 124に設定します。

R1(config-if)#standby 124 track 1 ?
  decrement  Priority decrement
  shutdown   Shutdown group
  <cr>

R1(config-if)#standby 124 track 1 decrement ?
  <1-255>  Decrement value

R1(config-if)#standby 124 track 1 decrement 20
R1(config-if)#do sh track
Track 1
  IP route 13.13.13.0 255.255.255.0 reachability
  Reachability is Up (connected)
    5 changes, last change 00:00:06
  First-hop interface is Serial1/2
  Tracked by:
    HSRP FastEthernet0/0 124

プライオリティ値が高いものが常にActiveになるためにはpreemptの設定が併せて必要です。

R1(config-if)#standby 124 preempt
R2(config-if)#standby 124 preempt

ここで現在の設定を確認するとR1がActiveとなっていることが分かります。

R1(config)#do sh stan bri
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       124  110 P Active  local           124.124.124.2   124.124.124.254
R1(config-if)#do sh standb
FastEthernet0/0 - Group 124
  State is Active
    5 state changes, last state change 00:06:30
  Virtual IP address is 124.124.124.254
  Active virtual MAC address is 0000.0c07.ac7c
    Local virtual MAC address is 0000.0c07.ac7c (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.712 secs
  Preemption enabled
  Active router is local
  Standby router is 124.124.124.2, priority 100 (expires in 7.728 sec)
  Priority 110 (configured 110)
    Track object 1 state Up decrement 20
  Group name is "hsrp-Fa0/0-124" (default)

R1でデバグを有効にし、s0/2をシャットします。

R1(config)#do deb standb
HSRP debugging is on
R1(config)#int s1/2
R1(config-if)#sh

Dec 26 03:52:48.779: HSRP: Fa0/0 Grp 124 Hello  out 124.124.124.1 Active  pri 110 vIP 124.124.124.254
Dec 26 03:52:49.795: HSRP: Fa0/0 Grp 124 Hello  in  124.124.124.2 Standby pri 100 vIP 124.124.124.254
Dec 26 03:53:35.347: %LINK-5-CHANGED: Interface Serial1/2, changed state to administratively down
Dec 26 03:53:36.235: %TRACKING-5-STATE: 1 ip route 13.13.13.0/24 reachability Up->Down
Dec 26 03:53:36.239: HSRP: Fa0/0 Grp 124 Track 1 object changed, state Up -> Down
Dec 26 03:53:36.239: HSRP: Fa0/0 Grp 124 Priority 110 -> 90
Dec 26 03:53:36.347: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to down
Dec 26 03:53:36.831: HSRP: Fa0/0 Grp 124 Hello  out 124.124.124.1 Active  pri 90 vIP 124.124.124.254
Dec 26 03:53:36.851: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 1, from 124.124.124.2
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Coup   in  124.124.124.2 Standby pri 100 vIP 124.124.124.254
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Active: j/Coup rcvd from higher pri router (100/124.124.124.2)
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Active router is 124.124.124.2, was local
Dec 26 03:53:36.855: HSRP: Fa0/0 Nbr 124.124.124.2 active for group 124
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Standby router is unknown, was 124.124.124.2
Dec 26 03:53:36.855: HSRP: Fa0/0 Nbr 124.124.124.2 no longer standby for group 124 (Active)
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Active -> Speak
Dec 26 03:53:36.855: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 124 state Active -> Speak
Dec 26 03:53:36.855: HSRP: Fa0/0 Interface adv out, Passive, active 0 passive 1
Dec 26 03:53:36.855: HSRP: Fa0/0 Grp 124 Redundancy "hsrp-Fa0/0-124" state Active -> Speak
Dec 26 03:53:36.859: HSRP: Fa0/0 Removed 124.124.124.254 from ARP
Dec 26 03:53:36.859: HSRP: Fa0/0 Grp 124 Deactivating MAC 0000.0c07.ac7c
Dec 26 03:53:36.859: HSRP: Fa0/0 Grp 124 Removing 0000.0c07.ac7c from MAC address filter
Dec 26 03:53:36.863: HSRP: Fa0/0 Grp 124 MAC addr update Delete from SMF  0000.0c07.ac7c
Dec 26 03:53:36.867: HSRP: Fa0/0 Grp 124 Hello  out 124.124.124.1 Speak   pri 90 vIP 124.124.124.254
Dec 26 03:53:36.875: HSRP: Fa0/0 IP Redundancy "hsrp-Fa0/0-124" update, Active -> Speak
Dec 26 03:53:36.879: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 0, from 124.124.124.2
Dec 26 03:53:39.835: HSRP: Fa0/0 Grp 124 Hello  in  124.124.124.2 Active  pri 100 vIP 124.124.124.254
Dec 26 03:53:39.871: HSRP: Fa0/0 Grp 124 Hello  out 124.124.124.1 Speak   pri 90 vIP 124.124.124.254

ActiveがR2となることが分かります。

R1(config-if)#do sh stan br
                     P indicates configured to preempt.
                     |
Interface   Grp  Pri P State   Active          Standby         Virtual IP
Fa0/0       124  90  P Standby 124.124.124.2   local           124.124.124.254
R1(config-if)#do sh track
Track 1
  IP route 13.13.13.0 255.255.255.0 reachability
  Reachability is Down (no route)
    6 changes, last change 00:03:38
  First-hop interface is unknown
  Tracked by:
    HSRP FastEthernet0/0 124

カテゴリ:

前回はRIPでユニキャストを利用する例などを確認しました。今回はEIGRPでユニキャストを利用する方法を確認します。

R1とR2で直結しているF0/0でEIGRPを利用します。

R1(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

まずR1とR2で最低限のEIGRPを設定します。

R1(config)#router eigrp 100
R1(config-router)#no auto-summary
R1(config-router)#network 12.12.12.1 0.0.0.0

実行後、設定を確認します。

R1(config-router)#do sh ip ei int
IP-EIGRP interfaces for process 100

                        Xmit Queue   Mean   Pacing Time   Multicast    Pending
Interface        Peers  Un/Reliable  SRTT   Un/Reliable   Flow Timer   Routes
Fa0/0              1        0/0        13       0/1           50           0
R1(config-router)#do sh ip ei nei
IP-EIGRP neighbors for process 100
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   12.12.12.2              Fa0/0             11 00:01:41   13   200  0  4

この時点でのパケットをデバグで確認すると、マルチキャスト(224.0.0.10)が利用されていることが分かります。

R2#deb ip packet detail
IP packet debugging is on (detailed)
R2#
Dec 20 06:18:42.095: IP: s=12.12.12.1 (FastEthernet0/0), d=224.0.0.10, len 60, rcvd 2, proto=88
Dec 20 06:18:44.791: IP: s=12.12.12.2 (local), d=224.0.0.10 (FastEthernet0/0), len 60, sending broad/multicast, proto=88

EIGRPでユニキャストを利用するにはneighborコマンドを利用します。

R1(config-router)#neighbor 12.12.12.2 f0/0

R2(config-router)#neighbor 12.12.12.1 f0/0

実行後、パケットを確認するとマルチキャストではなくユニキャストアドレス(12.12.12.2)が利用されていることが分かります。

Dec 20 06:20:27.563: IP: s=12.12.12.1 (FastEthernet0/0), d=12.12.12.2 (FastEthernet0/0), len 60, rcvd 3, proto=88
Dec 20 06:20:27.735: IP: s=12.12.12.2 (local), d=12.12.12.1 (FastEthernet0/0), len 60, sending, proto=88

カテゴリ:

通常RIPはマルチキャストを利用してルーティング情報を流しますが、ユニキャストやブロードキャストを利用することも可能です。

R1(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2(config)#do sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R1とR2にRIPの設定を行います。

R1(config)#router rip
R1(config-router)#no auto-summary
R1(config-router)#version 2
R1(config-router)#network 12.12.12.1
R1(config-router)#network 17.17.1.1

設定後、デバグ画面を見るとマルチキャスト(224.0.0.9)を利用していることが確認できます。

R2(config-router)#do deb ip rip
RIP protocol debugging is on
Dec 11 05:54:42.151: RIP: received v2 update from 12.12.12.1 on FastEthernet0/0
Dec 11 05:54:42.151:      17.17.1.0/24 via 0.0.0.0 in 1 hops
Dec 11 05:54:52.475: RIP: sending v2 update to 224.0.0.9 via Loopback0 (17.17.2.2)
Dec 11 05:54:52.479: RIP: build update entries
Dec 11 05:54:52.479:    12.12.12.0/24 via 0.0.0.0, metric 1, tag 0
Dec 11 05:54:52.483:    17.17.1.0/24 via 0.0.0.0, metric 2, tag 0

ユニキャストを利用するにはまず、passive-interfaceコマンドでRIPの送信を止めます。そしてneighborコマンドで隣接ルータを指定します。

R1(config-router)#passive-interface f0/0
R1(config-router)#neighbor 12.12.12.2

デバグを確認するとユニキャスト(12.12.12.1)に変更されたことが確認できます。

Dec 11 05:57:46.843: RIP: received v2 update from 12.12.12.1 on FastEthernet0/0
Dec 11 05:57:46.843:      17.17.1.0/24 via 0.0.0.0 in 1 hops
Dec 11 05:58:05.067: RIP: sending v2 update to 12.12.12.1 via FastEthernet0/0 (12.12.12.2)
Dec 11 05:58:05.067: RIP: build update entries

最後にブロードキャストを確認します。まず先ほどのユニキャストの設定を解除します。

R1(config-router)#no passive-interface f0/0
R1(config-router)#no neighbor 12.12.12.2

設定はインターフェース上で行い、ip rip v2-broadcastコマンドを利用します。

R1(config-router)#int f0/0
R1(config-if)#ip rip v2-broadcast

すると、確かにブロードキャスト(255.255.255.255)が利用されることが分かります。

Dec 11 06:00:53.591: RIP: sending v2 update to 255.255.255.255 via FastEthernet0/0 (12.12.12.2)
Dec 11 06:00:53.595: RIP: build update entries
R2(config-router)#do und all
R2(config-router)#do deb ip pac de
IP packet debugging is on (detailed)
R2(config-router)#
Dec 11 06:20:10.495: IP: s=12.12.12.1 (FastEthernet0/0), d=255.255.255.255, len 52, rcvd 2
Dec 11 06:20:10.499:     UDP src=520, dst=520

カテゴリ:

Ciscoルータを利用中、Linuxでよく使うnetstatはないんだっけと思うことがよくあります。そんな時にshow tcpコマンドは近い感じです。

R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.1      YES manual up                    up
Loopback0                  17.17.1.1       YES NVRAM  up                    up

R2#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            12.12.12.2      YES manual up                    up
Loopback0                  17.17.2.2       YES NVRAM  up                    up

R1とR2があり、R1からR2に対してtelnet接続を行います。

R1#telnet 12.12.12.2
Trying 12.12.12.2 ... Open

User Access Verification

Password:
R2>

接続が完了したら、show tcp briefコマンドを実行してみます。netstat -tみたいな感じですね。

R2#show tcp brief
TCB       Local Address               Foreign Address             (state)
6738A76C  12.12.12.2.23               12.12.12.1.27603            ESTAB

ここに表示されるTCB(Transmission Control Block)を指定すると詳細の表示となります。

R2#show tcp tcb 6738A76C
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 255
Local host: 12.12.12.2, Local port: 23
Foreign host: 12.12.12.1, Foreign port: 27603
Connection tableid (VRF): 0

Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x1DFDC0):
Timer          Starts    Wakeups            Next
Retrans            75          0             0x0
TimeWait            0          0             0x0
AckHold            76          4             0x0
SendWnd             0          0             0x0
KeepAlive           0          0             0x0
GiveUp              0          0             0x0
PmtuAger            0          0             0x0
DeadWait            0          0             0x0
Linger              0          0             0x0
ProcessQ            0          0             0x0

iss:  732715540  snduna:  732720033  sndnxt:  732720033     sndwnd:   3023
irs:  636591890  rcvnxt:  636592009  rcvwnd:       4010  delrcvwnd:    118

SRTT: 300 ms, RTTO: 303 ms, RTV: 3 ms, KRTT: 0 ms
minRTT: 12 ms, maxRTT: 300 ms, ACK hold: 200 ms
Status Flags: passive open, active open
Option Flags: 0x400000
IP Precedence value : 6

Datagrams (max data segment is 1460 bytes):
Rcvd: 135 (out of order: 0), with data: 80, total data bytes: 118
Sent: 103 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 98, total data bytes: 4492
Packets received in fast path: 0, fast processed: 0, slow path: 0
Packets send in fast path: 0
fast lock acquisition failures: 0, slow path: 0

show tcp statisticsというコマンドもあります。

R2#show tcp statistics
Rcvd: 217 Total, 0 no port
      0 checksum error, 0 bad offset, 0 too short
      133 packets (246 bytes) in sequence
      0 dup packets (0 bytes)
      0 partially dup packets (0 bytes)
      0 out-of-order packets (0 bytes)
      0 packets (0 bytes) with data after window
      0 packets after close
      0 window probe packets, 2 window update packets
      3 dup ack packets, 0 ack packets with unsend data
      112 ack packets (4973 bytes)
Sent: 166 Total, 0 urgent packets
      7 control packets (including 0 retransmitted)
      142 data packets (4966 bytes)
      0 data packets (0 bytes) retransmitted
      0 data packets (0 bytes) fastretransmitted
      17 ack only packets (14 delayed)
      0 window probe packets, 0 window update packets
0 Connections initiated, 4 connections accepted, 4 connections established
3 Connections closed (including 0 dropped, 0 embryonic dropped)
0 Total rxmt timeout, 0 connections dropped in rxmt timeout
0 Keepalive timeout, 0 keepalive probe, 0 Connections dropped in keepalive

このページのトップヘ

見出し画像
×