calico配置 BIRD 作为 BGP Route Reflector

来源:互联网 发布:mysql查询面试题及答案 编辑:程序博客网 时间:2024/06/07 03:37

calico配置 BIRD 作为 BGP Route Reflector

Step 1: 安装 BIRD

Ubuntu 14.04

添加官方的BIRD PPA.

sudo add-apt-repository ppa:cz.nic-labs/bird

sudo apt-get update
sudo apt-get install bird

RHEL 7

安装 EPEL.

sudo yum install epel-release

如果失败,执行一下指令:

wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
sudo yum install epel-release-7-9.noarch.rpm

安装 BIRD:

yum install -y bird bird6

Step 2: 配置 BIRD IPv4

打开/etc/bird/bird.conf 文件,文件最初的模板如下, 用你的route reflector的ip替换 <router_id>

# Configure logging
log syslog { debug, trace, info, remote, warning, error, auth, fatal, bug };
log stderr all;

# Override router ID
router id <router_id>;

filter import_kernel {
if ( net != 0.0.0.0/0 ) then {
  accept;
  }
reject;
}
# Turn on global debugging of all protocols
debug protocols all;

# This pseudo-protocol watches all interface up/down events.
protocol device {
 scan time 2;    # Scan interfaces every 2 seconds
}

最后,对于集群中没一个node节点添加一个如下配置块,用只含字母的别名替<node_shortname>  (每个节点的别名必须唯一,别名只作用于此配置文件),用node节点的ip替换 <node_ip> ,用calico node节点的AS号替换<as_number>

protocol bgp <node_shortname> {
 description "<node_ip>";
 local as <as_number>;
 neighbor <node_ip> as <as_number>;
 multihop;
 rr client;
 graceful restart;
 import all;
 export all;
}

Step 3 (可选): 配置 BIRD IPv6

如果你想使用IPv6进行链接,你需要重复步骤2对/etc/bird/bird6.conf进行配置

有两点区别:

  • filter 块是::/0 而不是 0.0.0.0/0

  • <node_ip> 需要配置为node节点的IPv6 地址

注意:<router_id> 仍然是 route reflector的 IPv4 地址,而不是IPv6地址。

Step 4: 重启 BIRD

Ubuntu 14.04

sudo service bird restart

可选, 如果在step3配置了IPv6 ,还需要重启 BIRD6:

sudo service bird6 restart

RHEL 7

重启 BIRD:

systemctl restart bird
systemctl enable bird

可选, 如果在step3配置了IPv6 ,还需要重启 BIRD6:

systemctl restart bird6
systemctl enable bird6

Step 5: 配置node节点

如果你使用的是calico-gen-bird-conf.sh 来配置你的node节点, 而且使用的是reflector的IP 来进行配置的, 你不需要做任何事情。

否则,在每个node节点,编辑/etc/bird/bird.conf (如是 IPv6,则/etc/bird/bird6.conf)修改它所有的 peer 关系 (以 protocol bgp开头的配置块) ,用route reflector的IP地址替换neighbor 域的IP地址, 按照step4重启BIRD。


0 0
原创粉丝点击