Cisco
1. iBGP
1.1 update-source
例)iBGPのインターフェースにLoopback0(10.0.0.1/32)を使用する時の注意点!(ぶっちゃけ、よく忘れてハマル・・・orz)
お互い接続しているネットワークは192.168.16.0/24(vlan16)でループバックを利用してiBGP(AS:64512)のピアリング!
Switch1(config)#router bgp 64512
Switch1(config-router)#neighbor 10.0.0.2 remote-as 64512
Switch1(config-router)#
iBGPのネイバー確認をする・・・
Switch1(config-router)##do show ip bgp all summary
Load for five secs: 5%/0%; one minute: 13%; five minutes: 9%
Time source is [[NTP]], 21:30:54.596 JST Sat Dec 21 2013
For address family: [[IPv4]] Unicast
BGP router identifier 10.0.0.1, local AS number 64512
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.0.2 4 64512 0 0 0 0 0 never Active
StateがActiveとなって、iBGPのネイバーが張れていないため、BGPのInメッセージのdebugを行う。
Switch1#debug ip bgp ipv4 unicast in
BGP debugging is on for address family: IPv4 Unicast
Switch1#
Dec 21 21:22:00 JST: BGP: 10.0.0.2 open active, local address 192.168.16.253
Dec 21 21:22:00 JST: BGP: 10.0.0.2 read request no-op
Dec 21 21:22:00 JST: BGP: 10.0.0.2 open failed: Connection refused by remote host, open active delayed 18187ms (35000ms max, 60% jitter)
Connectionがrefusedされてる・・・しかもlocal addressが192.168.16.253/24(vlan16)のまま・・・
ってことでupdate-sourceを忘れてたため、設定修正!!!!
Switch1(config-router)#neighbor 10.0.0.2 update-source Loopback0
Switch1(config-router)#
Dec 21 21:40:21 JST: BGP: 10.0.0.2 open active, local address 10.0.0.1
Dec 21 21:40:21 JST: BGP: 10.0.0.2 read request no-op
Dec 21 21:40:21 JST: BGP: 10.0.0.2 went from Active to OpenSent
Dec 21 21:40:21 JST: BGP: 10.0.0.2 sending OPEN, version 4, my as: 64512, holdtime 180 seconds
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcv message type 1, length (excl. header) 26
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcv OPEN, version 4, holdtime 180 seconds
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcv OPEN w/ OPTION parameter len: 16
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 6
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has CAPABILITY code: 1, length 4
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has MP_EXT CAP for afi/safi: 1/1
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has CAPABILITY code: 128, length 0
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has ROUTE-REFRESH capability(old) for all address-families
Dec 21 21:40:21 JST: BGP: 10.0.0.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has CAPABILITY code: 2, length 0
Dec 21 21:40:21 JST: BGP: 10.0.0.2 OPEN has ROUTE-REFRESH capability(new) for all address-families
BGP: 10.0.0.2 rcvd OPEN w/ remote AS 64512
Dec 21 21:40:21 JST: BGP: 10.0.0.2 went from OpenSent to OpenConfirm
Dec 21 21:40:21 JST: BGP: 10.0.0.2 went from OpenConfirm to Established
Switch1(config-router)#
Dec 21 21:40:21 JST: %BGP-5-ADJCHANGE: neighbor 10.0.0.2 Up
1.2 next-hop-self
今度はnexthopで引っかかったお・・・( ^ω^)
例)対向側からdefault routeを通知する。!
Switch2(config-router)#[[network]] 0.0.0.0
デフォルトルートがiBGPによりSwitch1に通知される!
Switch1#show ip bgp
Load for five secs: 6%/0%; one minute: 6%; five minutes: 6%
Time source is NTP, 22:25:23.417 JST Sat Dec 21 2013
BGP table version is 1, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i0.0.0.0 172.16.242.254 0 100 0 i
ここで、デフォルトルートがベストパスとなっていない(*>i0.0.0.0の>が無い!)事に気が付く!
あれ?っと思いupdateをdebug
Switch1#debug ip bgp ipv4 unicast updates
しばらくすると、(5分おきにデバッグメッセージが表示された・・)ルートが無いとのメッセージが・・・
Switch1#debug ip bgp ipv4 unicast updates
Switch1#
Dec 21 22:35:12 JST: BGP(0): no valid path for 0.0.0.0/0
Switch1#
Dec 21 22:40:12 JST: BGP(0): no valid path for 0.0.0.0/0
これで、ネクストホップの書き換えをし忘れていたことに気が付く・・・orz またか!
対向Switch2のネクストホップの書き換えの設定をする!これでデフォルトルートがSwitch2を向く!
Switch2(config-router)#neighbor 10.0.0.1 next-hop-self
Switch1のデバッグメーセージに正常にデフォルトルート情報が受信されたメッセージが表示!
Switch1#
Dec 21 23:00:43 JST: BGP(0): 10.0.0.2 rcvd UPDATE w/ attr: nexthop 10.0.0.2, origin i, localpref 100, metric 0
Dec 21 23:00:43 JST: BGP(0): 10.0.0.2 rcvd 0.0.0.0/0
Dec 21 23:00:43 JST: BGP(0): Revise route installing 1 of 1 routes for 0.0.0.0/0 -> 10.0.0.2(main) to main IP table
このメッセージ表示後少しすると、ベストパスとなった!
Switch1#show ip bgp
Load for five secs: 4%/0%; one minute: 6%; five minutes: 6%
Time source is NTP, 23:04:38.949 JST Sat Dec 21 2013
BGP table version is 4, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i0.0.0.0 10.0.0.2 0 100 0 i
最終更新:2013年12月21日 23:09