移行時のリスク

1  IPアドレスのバッティング→旧機器のIPアドレスと新機器のIPアドレスを設定しますが、
IPアドレスがバッティングした状態でインターフェイスを開放すると、通信ができなくなります。
対策→IPアドレス管理表などで、IPアドレスの管理を徹底する。


2 対象機器の間違い
 事故の件数としては、1番多いケースと言われています。

機器にtelnetSSHでアクセスする時や、物理作業で、機器Aの作業をしないといけないのに、機器Bの作業をしてしまい事故に繋がるケースです。当方も作業手順書で、telnetIPアドレスの第4オクテットを1つ間違えて記載し、大事故に繋がりかけた事があります。また物理作業では、機器Aのケーブルを抜かないといけないのに、機器Bのケーブルを抜くってケースが多いです。また、電源ケーブルを挿したつもりが、しっかり挿さっていなかったケースもあります。

対策→ホスト名や機器にアクセスする時のIPアドレスを徹底。指差し呼称の徹底(昔の現場では指差し呼称を必ずしなければならないルールがありました。)

 

3 ループ
 RSTPを有効にしても、ネットワーク構成やケーブル配線ミス、設定ミスで簡単にループします。

対策→ネットワーク構成やケーブル配線表などの確認を徹底。

 

4 ACLの設定ミス

実際にあったケースですが、東京と大阪でリモート作業を実施していましたが、ACLの設定ミスで、機器にアクセスできなくなりました。2号機からアクセスできたので、事なきを得ましたが、2号機からもアクセスできなかった場合、東京から大阪へダッシュする必要がありました。
対策→ACLの確認や通信要件の確認など。

 

5 設定の投入ミス(省略コマンドの禁止、右クリックの禁止)

 昔の現場で、show run をsh run って省略するのは禁止されていました。実際にshって打って、shutdownコマンドが入ってしまったケースがあるそうです。
 また、tera termで右クリックで設定投入する人を、今まで何人も見たことありますが、コマンドが暴発する可能性があるので、右クリック禁止の設定をいれる。


6 既存管理資料に誤植が含まれている可能性
  既存管理資料を信じて新機器コンフィグを作成したが、資料に誤植が多数含まれてるケース。当方も、顧客作成した資料の構成図が間違っていたことや、
 最近では、検証構成図が間違っており、それが業務の遅延に繋がりました。

対策→既存の資料ではなく、必ずステータス確認を徹底する。

 

7 移行の途中段階で旧・新機器が混在する状況がある場合のルーティング不具合
→意図しない再帰ルートの発生など

 

 

BGP-OSPF 設定例(3)と障害試験

正常経路

ISR5→ISR1→ISR3→ISRv

 

リンク障害 項番1 ISR1 Gi1-ISR3 Gi1 閉塞

ISR5→ISR1→ISR2→ISR4→ISR3→ISR6

 

リンク障害 項番2 ISR5 Gi1-ISR1 Gi3 閉塞

ISR5→ISR2→ISR1→ISR3→ISR6

 

筐体障害 ISR 1 

ISR5→ISR2→ISR1→ISR3→ISR6

 

--------項番1--------

項番1 ISR1 Gi1(リンク障害) 事前 

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms

ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 3 msec 3 msec 3 msec
  2 10.1.13.3 5 msec 4 msec 4 msec
  3 172.16.36.6 4 msec 4 msec *
ISR5#

 

項番1 ISR1 Gi1(リンク障害) 障害

-ISR1-
 conf t
 interface GigabitEthernet1
 shutdown

ISR5
ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/6/8 ms


ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 3 msec 4 msec 3 msec
  2 10.1.12.2 7 msec 4 msec 4 msec
  3 10.1.24.4 5 msec 5 msec 4 msec
  4 10.1.34.3 5 msec 5 msec 5 msec
  5 172.16.36.6 8 msec 7 msec *


ISR5#

項番1 ISR1  Gi1(リンク障害) 復旧

-ISR1-
 conf t
  interface GigabitEthernet1
  no shutdown

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/5/7 ms

ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 4 msec 3 msec 4 msec
  2 10.1.13.3 4 msec 4 msec 4 msec
  3 172.16.36.6 5 msec 5 msec *
ISR5#

--------項番2--------

項番2 ISR1 Gi1(リンク障害) 事前 

 

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/5 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 4 msec 2 msec 2 msec
  2 10.1.13.3 5 msec 3 msec 3 msec
  3 172.16.36.6 5 msec 5 msec *
ISR5#

 

項番2 ISR1 Gi1(リンク障害) 障害
conf t
 interface GigabitEthernet1
 shutdown

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/6 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.25.2 2 msec 2 msec 2 msec
  2 10.1.12.1 4 msec 3 msec 3 msec
  3 10.1.13.3 4 msec 4 msec 5 msec
  4 172.16.36.6 7 msec 7 msec *
ISR5#

 

項番2 ISR1 Gi1(リンク障害) 復旧
conf t
 interface GigabitEthernet1
 no shutdown
 
 ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/5 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 3 msec 3 msec 3 msec
  2 10.1.13.3 3 msec 6 msec 4 msec
  3 172.16.36.6 6 msec 5 msec *
ISR5#

 

項番3 筐体障害 ISR1 Gi1 Gi2 Gi3 閉塞 事前
ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/5 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 3 msec 3 msec 3 msec
  2 10.1.13.3 3 msec 5 msec 4 msec
  3 172.16.36.6 4 msec 4 msec *
ISR5#

 

--------項番3--------


項番3 筐体障害 ISR1 Gi1 Gi2 Gi3 閉塞 障害
ISR1
conf t
 interface GigabitEthernet1
 shutdown
 interface GigabitEthernet2
 shutdown
 interface GigabitEthernet3
 shutdown

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/6 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.25.2 4 msec 3 msec 3 msec
  2 10.1.24.4 3 msec 4 msec 3 msec
  3 10.1.34.3 4 msec 4 msec 6 msec
  4 172.16.36.6 4 msec 4 msec *
ISR5#

 

項番3 筐体障害 ISR1 Gi1 Gi2 Gi3 閉塞 復旧
 ISR1
conf t
 interface GigabitEthernet1
 no shutdown
 interface GigabitEthernet2
 no shutdown
 interface GigabitEthernet3
 no shutdown

ISR5#ping 192.168.6.6 source loopback 1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.6.6, timeout is 2 seconds:
Packet sent with a source address of 192.168.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/5 ms
ISR5#traceroute 192.168.6.6 source loopback 1
Type escape sequence to abort.
Tracing the route to 192.168.6.6
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.15.1 4 msec 3 msec 2 msec
  2 10.1.13.3 3 msec 2 msec 3 msec
  3 172.16.36.6 4 msec 4 msec *
ISR5#


 

 

BGP-OSPF 設定例(2)とステータス確認

構成図

ISR5 (OSPF)

show ip ospf neighbor
show ip ospf interface brief
show ip ospf interface
show ip ospf database

ISR1(BGP)
show ip route bgp
show ip bgp
show ip bgp summary
show ip bgp neighbors 10.1.12.2 advertised-routes
show ip bgp neighbors 10.1.13.3 advertised-routes
show ip bgp neighbors 10.1.13.3 received-routes

 

--------ステータス表示例-------

■ISR5■

ISR5#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.1.24.2         1   FULL/DR         00:00:35    172.16.25.2     GigabitEthernet2
10.1.13.1         1   FULL/DR         00:00:31    172.16.15.1     GigabitEthernet1
ISR5#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo1          1     0               192.168.5.5/24     1     P2P   0/0
Gi2          1     0               172.16.25.5/24     1     BDR   1/1
Gi1          1     0               172.16.15.5/24     1     BDR   1/1
ISR5#show ip ospf interface
Loopback1 is up, line protocol is up
  Internet Address 192.168.5.5/24, Interface ID 12, Area 0
  Attached via Network Statement
  Process ID 1, Router ID 192.168.5.5, Network Type POINT_TO_POINT, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State POINT_TO_POINT
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Can be protected by per-prefix Loop-Free FastReroute
  Can be used for per-prefix Loop-Free FastReroute repair paths
  Not Protected by per-prefix TI-LFA
  Index 1/3/3, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
GigabitEthernet2 is up, line protocol is up
  Internet Address 172.16.25.5/24, Interface ID 8, Area 0
  Attached via Network Statement
  Process ID 1, Router ID 192.168.5.5, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 10.1.24.2, Interface address 172.16.25.2
  Backup Designated router (ID) 192.168.5.5, Interface address 172.16.25.5
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:00
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Can be protected by per-prefix Loop-Free FastReroute
  Can be used for per-prefix Loop-Free FastReroute repair paths
  Not Protected by per-prefix TI-LFA
  Index 1/2/2, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 10.1.24.2  (Designated Router)
  Suppress hello for 0 neighbor(s)
GigabitEthernet1 is up, line protocol is up
  Internet Address 172.16.15.5/24, Interface ID 7, Area 0
  Attached via Network Statement
  Process ID 1, Router ID 192.168.5.5, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 10.1.13.1, Interface address 172.16.15.1
  Backup Designated router (ID) 192.168.5.5, Interface address 172.16.15.5
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Can be protected by per-prefix Loop-Free FastReroute
  Can be used for per-prefix Loop-Free FastReroute repair paths
  Not Protected by per-prefix TI-LFA
  Index 1/1/1, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 2
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 10.1.13.1  (Designated Router)
  Suppress hello for 0 neighbor(s)
ISR5#show ip ospf database

            OSPF Router with ID (192.168.5.5) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.13.1       10.1.13.1       554         0x80000004 0x00C899 1
10.1.24.2       10.1.24.2       546         0x80000004 0x00E055 1
192.168.5.5     192.168.5.5     536         0x80000008 0x005510 3

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
172.16.15.1     10.1.13.1       554         0x80000001 0x002C9B
172.16.25.2     10.1.24.2       546         0x80000001 0x00CDD6

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.6.0     10.1.13.1       496         0x80000001 0x00322D 65002
ISR5#

 

■ISR-1■

ISR1#show ip route bgp
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
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

B     192.168.6.0/24 [20/110] via 10.1.13.3, 00:20:15
ISR1#show ip bgp
BGP table version is 3, local router ID is 10.1.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.5.0      172.16.15.5              2         32768 i
 *>   192.168.6.0      10.1.13.3              110    200      0 65002 i
ISR1#show ip bgp summary
BGP router identifier 10.1.13.1, local AS number 65001
BGP table version is 3, main routing table version 3
2 network entries using 496 bytes of memory
3 path entries using 408 bytes of memory
3/2 BGP path/bestpath attribute entries using 840 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1768 total bytes of memory
1 received paths for inbound soft reconfiguration
BGP activity 2/0 prefixes, 4/1 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.12.2       4        65001     176     173        3    0    0 00:27:16        0
10.1.13.3       4        65002     162     163        3    0    0 00:25:16        1
ISR1#show ip bgp neighbors 10.1.12.2 advertised-routes
BGP table version is 3, local router ID is 10.1.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.5.0      172.16.15.5              2         32768 i
 *>   192.168.6.0      10.1.13.3              110    200      0 65002 i

Total number of prefixes 2
ISR1#show ip bgp neighbors 10.1.13.3 advertised-routes
BGP table version is 3, local router ID is 10.1.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   192.168.5.0      172.16.15.5              2         32768 i

Total number of prefixes 1
ISR1#show ip bgp neighbors 10.1.13.3 received-routes
BGP table version is 3, local router ID is 10.1.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *    192.168.6.0      10.1.13.3              110             0 65002 i

Total number of prefixes 1
ISR1#

BGP OSPF 設定例(1)

ネットワーク構成

excelVisioではなくEVENGを使用しています。

正常経路

ISR5→ISR1→ISR3→ISRv

 

リンク障害 項番1 ISR1 Gi1-ISR3 Gi1 閉塞

R5→R1→R2→R4→R3→R6

 

リンク障害 項番2 ISR5 Gi1-ISR1 Gi3 閉塞

R5→R2→R1→R3→R6

 

筐体障害 ISR 1 

R5→R2→R1→R3→R6

 

-------投入コンフィグ-------

■ISR1■

conf t
hostname ISR1
!
interface GigabitEthernet1
 ip address 10.1.13.1 255.255.255.0
 no sh
!
interface GigabitEthernet2
 ip address 10.1.12.1 255.255.255.0
 no sh
!
interface GigabitEthernet3
 ip address 172.16.15.1 255.255.255.0
 no sh
!
router ospf 1
 redistribute bgp 65001 metric 100 metric-type 1 subnets
 network 172.16.15.0 0.0.0.255 area 0
!
router bgp 65001
 bgp log-neighbor-changes
 timers bgp 10 30
 neighbor 10.1.12.2 remote-as 65001
 neighbor 10.1.12.2 password 0123456789
 neighbor 10.1.13.3 remote-as 65002
 neighbor 10.1.13.3 password 0123456789
 !
 address-family ipv4
  bgp redistribute-internal
  network 192.168.5.0
  neighbor 10.1.12.2 activate
  neighbor 10.1.12.2 next-hop-self
  neighbor 10.1.12.2 soft-reconfiguration inbound
  neighbor 10.1.13.3 activate
  neighbor 10.1.13.3 soft-reconfiguration inbound
  neighbor 10.1.13.3 route-map LP in
  neighbor 10.1.13.3 route-map MED out
  neighbor 10.1.13.3 filter-list 1 out
 exit-address-family
!
!
!
!
ip as-path access-list 1 permit ^$
ip as-path access-list 2 permit ^65002_
!
access-list 1 permit 192.168.5.0 0.0.0.255
!
!
route-map LP permit 10
 match as-path 2
 set local-preference 200
!
route-map MED permit 10
 match ip address 1
 set metric 110

 

■ISR2■

conf t
!
hostname ISR2
!
interface GigabitEthernet1
 ip address 10.1.24.2 255.255.255.0
 no sh
!
interface GigabitEthernet2
 ip address 10.1.12.2 255.255.255.0
 no sh
!
interface GigabitEthernet3
 ip address 172.16.25.2 255.255.255.0
 no sh
!
router ospf 1
 network 172.16.25.0 0.0.0.255 area 0
!
router bgp 65001
 bgp log-neighbor-changes
 timers bgp 10 30
 neighbor 10.1.12.1 remote-as 65001
 neighbor 10.1.12.1 password 0123456789
 neighbor 10.1.24.4 remote-as 65002
 neighbor 10.1.24.4 password 0123456789
 !
 address-family ipv4
  network 192.168.5.0
  neighbor 10.1.12.1 activate
  neighbor 10.1.12.1 next-hop-self
  neighbor 10.1.12.1 soft-reconfiguration inbound
  neighbor 10.1.24.4 activate
  neighbor 10.1.24.4 soft-reconfiguration inbound
  neighbor 10.1.24.4 route-map LP in
  neighbor 10.1.24.4 route-map MED out
  neighbor 10.1.24.4 filter-list 1 out
  distance bgp 20 100 200
 exit-address-family
!
!
!
ip as-path access-list 1 permit ^$
ip as-path access-list 2 permit ^65002_
!
access-list 1 permit 192.168.5.0 0.0.0.255
!
!
route-map LP permit 10
 match as-path 2
 set local-preference 150
!
route-map MED permit 10
 match ip address 1
 set metric 120

■ISR3■

conf t
!
hostname ISR3
!
interface GigabitEthernet1
 ip address 10.1.13.3 255.255.255.0
 no sh
!
interface GigabitEthernet2
 ip address 10.1.34.3 255.255.255.0
 no sh
!
interface GigabitEthernet3
 ip address 172.16.36.3 255.255.255.0
 no sh
!
router ospf 1
 redistribute bgp 65002 metric 100 metric-type 1 subnets
 network 172.16.36.0 0.0.0.255 area 0
!
router bgp 65002
 bgp log-neighbor-changes
 timers bgp 10 30
 neighbor 10.1.13.1 remote-as 65001
 neighbor 10.1.13.1 password 0123456789
 neighbor 10.1.34.4 remote-as 65002
 neighbor 10.1.34.4 password 0123456789
 !
 address-family ipv4
  bgp redistribute-internal
  network 192.168.6.0
  neighbor 10.1.13.1 activate
  neighbor 10.1.13.1 soft-reconfiguration inbound
  neighbor 10.1.13.1 route-map LP in
  neighbor 10.1.13.1 route-map MED out
  neighbor 10.1.13.1 filter-list 1 out
  neighbor 10.1.34.4 activate
  neighbor 10.1.34.4 next-hop-self
  neighbor 10.1.34.4 soft-reconfiguration inbound
 exit-address-family
!
!
!
ip as-path access-list 1 permit ^$
ip as-path access-list 2 permit ^65001_
!
access-list 1 permit 192.168.6.0 0.0.0.255
!
!
route-map LP permit 10
 match as-path 2
 set local-preference 200
!
route-map MED permit 10
 match ip address 1
 set metric 110

■ISR4■

conf t
!
hostname ISR4
!interface GigabitEthernet1
 ip address 10.1.24.4 255.255.255.0
 no sh
!
interface GigabitEthernet2
 ip address 10.1.34.4 255.255.255.0
 no sh
!
interface GigabitEthernet3
 ip address 172.16.46.4 255.255.255.0
 no sh
!
router ospf 1
 network 172.16.46.0 0.0.0.255 area 0
!
router bgp 65002
 bgp log-neighbor-changes
 timers bgp 10 30
 neighbor 10.1.24.2 remote-as 65001
 neighbor 10.1.24.2 password 0123456789
 neighbor 10.1.34.3 remote-as 65002
 neighbor 10.1.34.3 password 0123456789
 !
 address-family ipv4
  network 192.168.6.0
  neighbor 10.1.24.2 activate
  neighbor 10.1.24.2 soft-reconfiguration inbound
  neighbor 10.1.24.2 route-map LP in
  neighbor 10.1.24.2 route-map MED out
  neighbor 10.1.24.2 filter-list 1 out
  neighbor 10.1.34.3 activate
  neighbor 10.1.34.3 next-hop-self
  neighbor 10.1.34.3 soft-reconfiguration inbound
  distance bgp 20 100 200
 exit-address-family
!
!
virtual-service csr_mgmt
!
ip as-path access-list 1 permit ^$
ip as-path access-list 2 permit ^65001_
!
access-list 1 permit 192.168.6.0 0.0.0.255
!
!
route-map LP permit 10
 match as-path 2
 set local-preference 150
!
route-map MED permit 10
 match ip address 1
 set metric 120

 

■ISR5■

conf t
hostname ISR5
!
interface Loopback1
 ip address 192.168.5.5 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet1
 ip address 172.16.15.5 255.255.255.0
 no sh
!
interface GigabitEthernet2
 ip address 172.16.25.5 255.255.255.0
 no sh
!
!
router ospf 1
 network 172.16.15.0 0.0.0.255 area 0
 network 172.16.25.0 0.0.0.255 area 0
 network 192.168.5.0 0.0.0.255 area 0
!
ip route 192.168.6.0 255.255.255.0 172.16.25.2 200

 

■ISR-6■

conf t

hostname ISR6

!

interface Loopback1
 ip address 192.168.6.6 255.255.255.0
 ip ospf network point-to-point
!
interface GigabitEthernet1
 ip address 172.16.36.6 255.255.255.0
no sh
!
interface GigabitEthernet2
 ip address 172.16.46.6 255.255.255.0
 no sh
!
router ospf 1
 network 172.16.36.0 0.0.0.255 area 0
 network 172.16.46.0 0.0.0.255 area 0
 network 192.168.6.0 0.0.0.255 area 0

 

BGP コマンド

BGPコマンドについて

(1)
timers bgp
BGPのタイマー

コマンド デフォルト
keepalive :60 秒、holdtime:180 秒

推奨値 holdtimeはkeepaliveの3倍

timers bgp 30 90

 

(2) network 10.2.2.0 mask 255.255.255.0

    ネットワークアドレスを広報する。

 

(3) aggregate-address 10.2.0.0 255.255.0.0 summary-only

 

アドバタイズする際、経路集約する場合に設定します。
BGPテーブルに10.2.0.0/16に含まれる経路が存在しないとアドバタイズされません。
"summary-only"を設定すると、10.2.0.0/16のみアドバタイズします。設定しないと10.2.0.0/16と合わせて10.2.2.0/24や10.2.3.0/24もアドバタイズします。

 


(4) neighbor 10.1.1.1 password 0123456789

ネイバー認証する場合に設定します。ネイバー同士同じパスワードを設定します。
ネイバー認証できないとログが流れます。

 


(5) neighbor 10.1.1.1 soft-reconfiguration inbound

BGPテーブル反映前の受信したアドバタイズ情報を保存します。コマンド"show ip bgp neighbors 10.1.1.1 received-routes"で受信したアドバタイズ情報を確認できるようになります。

 


(6) neighbor 10.1.1.1 prefix-list PL001 in

受信するアドバタイズを制限する場合に設定します。

 


(7) neighbor 10.2.1.3 next-hop-self

iBGPネイバーに経路情報をアドバタイズする際に、ネクストホップを自身のIPアドレスに変更します。設定しない場合は、ネクストホップを変更せずにアドバタイズします。
iBGPのみ有効

 


(8) neighbor 10.2.1.3 prefix-list PL001 out

送信するアドバタイズを制限する場合に設定します

 


(9)
clear ip bgp
ハード再構成またはソフト再構成を使用してボーダー ゲートウェイ プロトコル(BGP)接続をリセットするには、特権 EXEC モードで clear ip bgp コマンドを使用します。

 

BGP概要

はじめに

BGP NW構成 

 

iBGP、eBGPでは、以下のように接続するのが一般的です。

iBGP: フルメッシュ接続
eBGP: 1対1の接続

 

BGPはインターネットのネットワークだけではなく、一般企業のネットワークが他社のネットワークやデータセンターと接続するシーンでもよく利用されます。

 

ダイナミックルーティングとBGPについて
ダイナミックルーティングは大きく2種類に分別できます。IGP(Interior Gateway Protocol)とEGP(Exterior Gateway Protocol)です。IGPは「RIP」や「OPSF」や「EIGRP」などでAS(自律システム)内で使用します。EGPは「EGP」と「BGP」のことでAS(自律システム)間のルーティング目的で使用されます。


※EGPと言うルーティングプロトコルもありますが、現在EGPと言えばBGPと認知するのが一般的です。

どちらもダイナミックルーティングプロトコルですが、IGPはLAN内で使用され、BGPは別の組織と接続する際に使用することが一般的です。(インターネットISP事業者間接続、エンタープライズにおける自社ネットワークと他社ネットワーク間接続、等々)

 

・BGPスピーカ:BGPが設定されているルータ。同一AS内にはBGPで動作するルータとOSPFなどのIGPで動作するルータが混在することが一般的です

 

・iBGP(Internal BGP):AS内のBGP。つまり同一AS番号でのBGP
・eBGP(External BGP):AS間のBGP。例えば異なるプロバイダ間でのBGP


※なぜ、IBGPとEBGPで分ける必要があるのか?

AS間は別のISP同士と思えばいいので、管理者が別になる。ということは設定も各々がバラバラ。バラバラで通信できるような設定が必要。AS内では同一管理者が一環したポリシーで設計できるので、冗長化などの高度な設定が可能です。

 

・経路の収束時間はOSPFの方が高速

BGPにおいてもループバックアドレスを設定することは、有効なテクニックとなります。

iBGPでは、フルメッシュでネットワークを構築され、経路が冗長化されます。その為、ループバックアドレスが設定されたルータへの到達経路が複数存在することになります。

 BGPの設定では、各ルータでピアを張ります。ピアに指定した相手側ルータの物理インタフェースがダウンした場合、ピアが切れてしまうことになります。

ループバックインタフェースは、ダウンしません。

 ループバックアドレスが設定されたルータに到達するための経路が複数存在すれば、ピアが切断される可能性は、極めて低くなります。

 

と言うことで、iBGPでは、ピアを張る相手ルータのループバックアドレスを指定して、ピアを張るのが一般的です。

 

BGPネイバーには、下記のステータスがあります。
BGPステート 概要
Init BGPネイバーの初期状態
Active TCPコネクションを確立しようとしている状態
Connect TCPコネクションの確立を待っている状態
OpenSent Openメッセージを送信した状態
OpenConfirm ネイバーからのKEEPALIVEを待っている状態
Established BGPネイバーを確立した状態

 

・OPEN:隣接するルーター(BGPネイバー)とのTCPコネクション確立後、BGPピアの確立を行うために送信するメッセージ。

・UPDATE:経路情報を含んだメッセージ。BGPスピーカーの設定変更時などに送信される。

・KEEPALIVE:BGPネイバーとの通信が可能かどうかを確認するためのメッセージ。

・NOTIFICATION:エラーを通知するメッセージ。

 

OSPF 設定確認コマンド

OSPF構築時の取得コマンドをまとめてみました (cisco)

 

今、時間がありませんので、設定例やコマンド表示例などは時間があったら書きます。


設計や設定により適宜追加が必要になります。


・show ip ospf neighbor・
 OSPFを動かしたら、まずこれを見ています。neighbor張れているかの確認。
 また、neighborの数が想定通りかも確認します。neighborが足りないこともあります。その場合は、設定ミス、設定漏れ物理的な接続を確認します。


・show ip ospf neighbor detail・
 構築時のログとして取得しておく場合とトラブルシュート時にstate changesカウントを見たります。


・show ip ospf interface brief・
 このログは一番重要。
 OSPFが動いているインターフェイスの不足がないか?
 OSPF Costは適切か?
 OSPF Areaは適切か?
 DR/BDRは適切か?
 
  
 ・show ip ospf interface・ 
 このログで気を付けるのは「Hello 10, Dead 40, Wait 40」です
 
 ・show ip ospf database・
 OSPFのタイプ別にパラメータが出てきますので、ここでもある程度確認します。基本は構築時のログとして保管しておきます。


 ・show ip ospf events・
 OSPFステータスログとして、エラーが無いか確認するレベルです。


 ・show ip route ospf/show ip route・
  ルーティングテーブルの確認は必須です。ospfオプションを付けるとOSPFだけに絞れる  ので見やすいと思います。ここではOSPFでもらう経路が想定で通りかと、External 1 / 2も併せて確認できます。


・show ip protocol
  ダイナミックルーティングの動作状況を見るには、以下のコマンドを入力します。OSPFだけでなく、そのルータで動作しているダイナミックルーティングの状況がわかります。