FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.37k stars 1.25k forks source link

FFR bgpd is run but no send bgp packet ? #5939

Closed root00r closed 4 years ago

root00r commented 4 years ago

1.I create a linux gre tunnel , add it to vrf like this ip tunnel add gre-5ztunfko mode gre local 172.16.180.12 remote 172.16.176.15 ttl 255 ip a add 192.168.0.1 dev gre-5ztunfko ip link add vrf-5ztunfko type vrf table 520418715 ip link set dev gre-5ztunfko master vrf-5ztunfko ip link set dev gre-5ztunfko up ip link set dev vrf-5ztunfko up ip r add default via 192.168.0.1 dev gre-5ztunfko vrf vrf-5ztunfko

2.start frr services host# systemctl status frr ● frr.service - FRRouting Loaded: loaded (/usr/lib/systemd/system/frr.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2020-03-06 19:10:02 CST; 2 days ago Docs: https://frrouting.readthedocs.io/en/latest/setup.html Process: 13384 ExecStart=/usr/lib/frr/frrinit.sh start (code=exited, status=0/SUCCESS) Tasks: 11 Memory: 30.5M CGroup: /system.slice/frr.service ├─13389 /usr/lib/frr/watchfrr -d zebra bgpd staticd ├─13404 /usr/lib/frr/zebra -d -A 127.0.0.1 -s 90000000 ├─13408 /usr/lib/frr/bgpd -d -A 127.0.0.1 └─13414 /usr/lib/frr/staticd -d -A 127.0.0.1

Mar 06 19:10:02 host watchfrr[13389]: [EC 268435457] zebra state -> down : initial connection attempt failed Mar 06 19:10:02 host watchfrr[13389]: [EC 268435457] bgpd state -> down : initial connection attempt failed Mar 06 19:10:02 host watchfrr[13389]: [EC 268435457] staticd state -> down : initial connection attempt failed Mar 06 19:10:02 host watchfrr[13389]: [EC 100663303] Forked background command [pid 13390]: /usr/lib/frr/watchfrr.sh restart all Mar 06 19:10:02 host watchfrr[13389]: zebra state -> up : connect succeeded Mar 06 19:10:02 host watchfrr[13389]: bgpd state -> up : connect succeeded Mar 06 19:10:02 host watchfrr[13389]: staticd state -> up : connect succeeded Mar 06 19:10:02 host watchfrr[13389]: all daemons up, doing startup-complete notify Mar 06 19:10:02 host frrinit.sh[13384]: Started watchfrr Mar 06 19:10:02 host systemd[1]: Started FRRouting.

bgpd.conf file: host# show running-config Building configuration...

Current configuration: ! frr version 7.2 frr defaults traditional log file /var/log/frr/bgpd.log ! debug bgp flowspec debug bgp keepalives debug bgp neighbor-events debug bgp nht debug bgp pbr debug bgp updates in debug bgp updates out debug bgp vpn leak-from-vrf debug bgp vpn leak-to-vrf debug bgp zebra ! router bgp 15000 vrf vrf-fhshp1wv bgp router-id 192.168.0.1 timers bgp 3 10 neighbor 192.168.0.2 remote-as 15001 ! line vty ! end

# show ip route vrf vrf-fhshp1wv Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric,

  • selected route, * - FIB route, q - queued route, r - rejected route

VRF vrf-fhshp1wv: K> 0.0.0.0/0 [0/0] via 192.168.0.1, gre-fhshp1wv, 00:23:19 K> 172.16.0.0/24 [0/0] is directly connected, gre-fhshp1wv, 00:29:53 K> 192.168.0.0/24 [0/0] is directly connected, gre-fhshp1wv, 00:31:25 C> 192.168.0.1/32 is directly connected, gre-fhshp1wv, 2d15h24m

bgpd log: 2020/03/09 10:43:26 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 10:43:26 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 10:43:26 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 10:43:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 10:43:26 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 10:43:26 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 10:43:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 10:43:26 BGP: 192.168.0.2 went from Connect to Active 2020/03/09 10:45:26 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 10:45:26 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 10:45:26 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 10:45:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 10:45:26 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 10:45:26 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 10:45:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 10:45:26 BGP: 192.168.0.2 went from Connect to Active 2020/03/09 10:47:26 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 10:47:26 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 10:47:26 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 10:47:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 10:47:26 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 10:47:26 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 10:47:26 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 10:47:26 BGP: 192.168.0.2 went from Connect to Active

then ,bgpd service is running , but no send a bgp packet.

root00r commented 4 years ago

then I add ip nht resolve-via-default to the vrf. but it's useless.

add route to vrf ip r add 192.168.0.2 via 192.168.0.1 vrf vrf-fhshp1wv

# show ip route vrf vrf-fhshp1wv Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric,

  • selected route, * - FIB route, q - queued route, r - rejected route

VRF vrf-fhshp1wv: K> 0.0.0.0/0 [0/0] via 192.168.0.1, gre-fhshp1wv, 03:37:25 K> 172.16.0.0/24 [0/0] is directly connected, gre-fhshp1wv, 03:43:59 K> 192.168.0.0/24 [0/0] is directly connected, gre-fhshp1wv, 03:45:31 C> 192.168.0.1/32 is directly connected, gre-fhshp1wv, 2d18h38m S 192.168.0.2/32 [1/0] via 192.168.0.1, gre-fhshp1wv, 00:03:43

# show running-config Building configuration...

Current configuration: ! frr version 7.2 frr defaults traditional log file /var/log/frr/bgpd.log ! debug bgp flowspec debug bgp keepalives debug bgp neighbor-events debug bgp nht debug bgp pbr debug bgp updates in debug bgp updates out debug bgp vpn leak-from-vrf debug bgp vpn leak-to-vrf debug bgp zebra debug zebra events debug zebra fpm debug zebra kernel debug zebra nht debug zebra packet ! vrf vrf-fhshp1wv ip nht resolve-via-default ip route 192.168.0.2/32 192.168.0.1 exit-vrf ! router bgp 15000 vrf vrf-fhshp1wv bgp router-id 192.168.0.1 timers bgp 3 10 neighbor 192.168.0.2 remote-as 15001 ! line vty ! end

# show ip bgp vrf vrf-fhshp1wv neighbors BGP neighbor is 192.168.0.2, remote AS 15001, local AS 15000, external link BGP version 4, remote router ID 0.0.0.0, local router ID 192.168.0.1 BGP state = Active Last read 00:35:21, Last write never Hold time is 10, keepalive interval is 3 seconds Configured hold time is 10, keepalive interval is 3 seconds Message statistics: Inq depth is 0 Outq depth is 0 Sent Rcvd Opens: 0 0 Notifications: 0 0 Updates: 0 0 Keepalives: 0 0 Route Refresh: 0 0 Capability: 0 0 Total: 0 0 Minimum time between advertisement runs is 0 seconds

For address family: IPv4 Unicast Not part of any update group Community attribute sent to this neighbor(all) 0 accepted prefixes

Connections established 0; dropped 0 Last reset 00:35:21, Waiting for NHT BGP Connect Retry Timer in Seconds: 120 Next connect timer due in 40 seconds Read thread: off Write thread: off FD used: -1

# show ip bgp vrf vrf-fhshp1wv nexthop Current BGP nexthop cache: 192.168.0.2 invalid, peer 192.168.0.2 Must be Connected Last update: Mon Mar 9 13:32:30 2020

bgpd.log:

2020/03/09 14:06:30 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 14:06:30 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 14:06:30 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 14:06:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 14:06:30 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 14:06:30 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 14:06:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 14:06:30 BGP: 192.168.0.2 went from Connect to Active 2020/03/09 14:08:30 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 14:08:30 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 14:08:30 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 14:08:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 14:08:30 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 14:08:30 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 14:08:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 14:08:30 BGP: 192.168.0.2 went from Connect to Active 2020/03/09 14:10:30 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 14:10:30 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 14:10:30 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 14:10:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 14:10:30 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 14:10:30 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 14:10:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 14:10:30 BGP: 192.168.0.2 went from Connect to Active 2020/03/09 14:12:30 BGP: 192.168.0.2 [FSM] Timer (connect timer expire) 2020/03/09 14:12:30 BGP: 192.168.0.2 [FSM] ConnectRetry_timer_expired (Active->Connect), fd -1 2020/03/09 14:12:30 BGP: 192.168.0.2 [FSM] Waiting for NHT 2020/03/09 14:12:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Connect established_peers 0 2020/03/09 14:12:30 BGP: 192.168.0.2 went from Active to Connect 2020/03/09 14:12:30 BGP: 192.168.0.2 [FSM] TCP_connection_open_failed (Connect->Active), fd -1 2020/03/09 14:12:30 BGP: bgp_fsm_change_status : vrf vrf-fhshp1wv(12), Status: Active established_peers 0 2020/03/09 14:12:30 BGP: 192.168.0.2 went from Connect to Active

donaldsharp commented 4 years ago

bgp disable-ebgp-connected-route-check

qlyoung commented 4 years ago

@root00r In the future, please wrap your logs and config blocks in 3 backtics (```), it is quite difficult to read as they are.

Try @donaldsharp's suggestion; in eBGP, by default, we will not establish the session if the peer is not considered to be directly connected, even if it is only one physical hop away. That command turns this behavior off. Here's the docs for it: http://docs.frrouting.org/en/latest/bgp.html#disable-checking-if-nexthop-is-connected-on-ebgp-sessions

root00r commented 4 years ago

@root00r In the future, please wrap your logs and config blocks in 3 backtics (```), it is quite difficult to read as they are.

Try @donaldsharp's suggestion; in eBGP, by default, we will not establish the session if the peer is not considered to be directly connected, even if it is only one physical hop away. That command turns this behavior off. Here's the docs for it: http://docs.frrouting.org/en/latest/bgp.html#disable-checking-if-nexthop-is-connected-on-ebgp-sessions

copy that. bgp disable-ebgp-connected-route-check is valid ,I used neighbor 192.168.0.2 disable-connected-check is also valid . thanks @qlyoung @donaldsharp