• calico bird.ct


    root@cloud:~# ls /var/run/calico/bird.ctl
    /var/run/calico/bird.ctl
    root@cloud:~# nc -U /var/run/calico/bird.ctl
    0001 BIRD v0.3.3+birdv1.6.8 ready.
    
    9001 syntax error
    
    9001 syntax error
    show protocols
    2002-name     proto    table    state  since       info
    1002-static1  Static   master   up     07:21:21    
     kernel1  Kernel   master   up     07:21:21    
     device1  Device   master   up     07:21:21    
     direct1  Direct   master   up     07:21:21    
    0000 
    root@cloud:~#  nc -U /var/run/calico/bird.ctl
    0001 BIRD v0.3.3+birdv1.6.8 ready.
    show protocols
    2002-name     proto    table    state  since       info
    1002-static1  Static   master   up     2021-06-23  
     kernel1  Kernel   master   up     2021-06-23  
     device1  Device   master   up     2021-06-23  
     direct1  Direct   master   up     2021-06-23  
     Node_10_10_16_251 BGP      master   up     04:06:20    Established   
     Node_10_10_18_34 BGP      master   start  07:33:16    OpenSent      BGP Error: Hold timer expired
    0000 
    show protocols all ''^[[D
    9001 Unknown character
    ^[[A
    9001 Unknown character
    show protocols all 'Node_10_10_18_34'
    2002-name     proto    table    state  since       info
    1002-Node_10_10_18_34 BGP      master   start  07:33:17    OpenSent      BGP Error: Hold timer expired
    1006-  Description:    Connection to BGP peer
       Preference:     100
       Input filter:   ACCEPT
       Output filter:  calico_export_to_bgp_peers
       Routes:         0 imported, 0 exported, 0 preferred
       Route change stats:     received   rejected   filtered    ignored   accepted
         Import updates:              0          0          0          0          0
         Import withdraws:            0          0        ---          0          0
         Export updates:              0          0          0        ---          0
         Export withdraws:            0        ---        ---        ---          0
       BGP state:          OpenSent
         Neighbor address: 10.10.18.34
         Neighbor AS:      64513
         Last error:       BGP Error: Hold timer expired
     
    0000 
    debug 'Node_10_10_18_34' all
    0000 

    birdctl 是 bird 的 client,可以用来查看 bird 的状态

    root@cloud:~#  nc -U /var/run/calico/bird.ctl
    0001 BIRD v0.3.3+birdv1.6.8 ready.
    show route
    1007-0.0.0.0/0          via 10.10.16.254 on enahisic2i0 [kernel1 07:21:22] * (10)
     10.99.1.231/32     via 10.10.16.82 on enahisic2i0 [kernel1 07:21:22] * (10)
     10.110.79.116/32   via 10.10.16.82 on enahisic2i0 [kernel1 07:21:22] * (10)
     10.10.16.0/24      dev enahisic2i0 [direct1 07:21:22] * (240)
     10.110.171.213/32  via 10.10.16.82 on enahisic2i0 [kernel1 07:21:22] * (10)
     10.244.2.0/24      dev cni0 [direct1 07:21:22] * (240)
     172.17.0.0/16      dev docker0 [direct1 07:21:22] * (240)
     10.244.41.0/26     blackhole [static1 07:21:22] * (200)
     10.244.41.1/32     dev cali027a65c4a41 [kernel1 07:21:22] * (10)
     10.244.41.3/32     dev calib81bd12045e [kernel1 07:21:22] * (10)
    0000 
    root@cloud:~# ls  /var/log/calico/cni/cni.log 
    /var/log/calico/cni/cni.log
    [root@bogon ~]#  docker exec f314fa16ddab cat /etc/calico/confd/config/bird.cfg
    function apply_communities ()
    {
    }
    
    # Generated by confd
    include "bird_aggr.cfg";
    include "bird_ipam.cfg";
    
    router id 10.10.16.81;
    
    # Configure synchronization between routing tables and kernel.
    protocol kernel {
      learn;             # Learn all alien routes from the kernel
      persist;           # Don't remove routes on bird shutdown
      scan time 2;       # Scan kernel routing table every 2 seconds
      import all;
      export filter calico_kernel_programming; # Default is export none
      graceful restart;  # Turn on graceful restart to reduce potential flaps in
                         # routes when reloading BIRD configuration.  With a full
                         # automatic mesh, there is no way to prevent BGP from
                         # flapping since multiple nodes update their BGP
                         # configuration at the same time, GR is not guaranteed to
                         # work correctly in this scenario.
      merge paths on;    # Allow export multipath routes (ECMP)
    }
    
    # Watch interface up/down events.
    protocol device {
      debug { states };
      scan time 2;    # Scan interfaces every 2 seconds
    }
    
    protocol direct {
      debug { states };
      interface -"cali*", -"kube-ipvs*", "*"; # Exclude cali* and kube-ipvs* but
                                              # include everything else.  In
                                              # IPVS-mode, kube-proxy creates a
                                              # kube-ipvs0 interface. We exclude
                                              # kube-ipvs0 because this interface
                                              # gets an address for every in use
                                              # cluster IP. We use static routes
                                              # for when we legitimately want to
                                              # export cluster IPs.
    }
    
    
    # Template for all BGP clients
    template bgp bgp_template {
      debug { states };
      description "Connection to BGP peer";
      local as 64512;
      multihop;
      gateway recursive; # This should be the default, but just in case.
      import all;        # Import all routes, since we don't know what the upstream
                         # topology is and therefore have to trust the ToR/RR.
      export filter calico_export_to_bgp_peers;  # Only want to export routes for workloads.
      add paths on;
      graceful restart;  # See comment in kernel section about graceful restart.
      connect delay time 2;
      connect retry time 5;
      error wait time 5,30;
    }
    
    # ------------- Node-to-node mesh -------------
    
    # Node-to-node mesh disabled
    
    
    
    # ------------- Global peers -------------
    # No global peers configured.
    
    
    # ------------- Node-specific peers -------------
    
    
    
    
    # For peer /host/bogon/peer_v4/10.10.16.251
    protocol bgp Node_10_10_16_251 from bgp_template {
      neighbor 10.10.16.251 as 64512;
      source address 10.10.16.81;  # The local address we use for the TCP connection
    }
    
    
    # For peer /host/bogon/peer_v4/10.10.16.47
    protocol bgp Node_10_10_16_47 from bgp_template {
      neighbor 10.10.16.47 as 64512;
      source address 10.10.16.81;  # The local address we use for the TCP connection
    }
    
    
    # For peer /host/bogon/peer_v4/10.10.16.82
    protocol bgp Node_10_10_16_82 from bgp_template {
      neighbor 10.10.16.82 as 64512;
      source address 10.10.16.81;  # The local address we use for the TCP connection
    }
    
    
    
    [root@bogon ~]# ./calicoctl node status
    Calico process is running.
    
    IPv4 BGP status
    +--------------+---------------+-------+----------+--------------------------------+
    | PEER ADDRESS |   PEER TYPE   | STATE |  SINCE   |              INFO              |
    +--------------+---------------+-------+----------+--------------------------------+
    | 10.10.16.82  | node specific | up    | 12:46:55 | Established                    |
    | 10.10.16.251 | node specific | start | 12:14:32 | Active Socket: Connection      |
    |              |               |       |          | closed                         |
    | 10.10.16.47  | node specific | start | 12:14:32 | Active Socket: Connection      |
    |              |               |       |          | closed                         |
    +--------------+---------------+-------+----------+--------------------------------+
    
    IPv6 BGP status
    No IPv6 peers found.
    
    [root@bogon ~]# 
  • 相关阅读:
    Git使用教程
    H5项目常见问题汇总及解决方案
    globalAlpha 示例
    canvas 绘制三次贝塞尔曲线
    canvas 绘制二次贝塞尔曲线
    html5 图片360旋转
    HTML5 arc的例子
    HTML5 绘制阴影
    HTML5 canvas绘制文本
    html5 lineTo的使用例子
  • 原文地址:https://www.cnblogs.com/dream397/p/14923209.html
Copyright © 2020-2023  润新知