我们购买了一条 Amazon Direct Connect 专线,将我们的数据中心连接到 Amazon EC2 实例。Amazon 有适用于 Cisco 或 Juniper 硬件的配置(http://docs.aws.amazon.com/directconnect/latest/UserGuide/getstarted.html)。
但是,是否也可以使用 Linux 作为路由器(例如使用 Quagga,http://www.nongnu.org/quagga/)?
答案1
事实证明,使用 Quagga 和 Debian Linux 连接到 EC2 非常容易。
/etc/网络/接口
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 10.x.x.x
netmask 255.255.255.0
network 10.x.x.x
broadcast 10.x.x.x
gateway 10.x.x.x
allow-hotplug eth1
iface eth1 inet static
address 169.254.237.18
netmask 255.255.255.252
network 169.254.237.16
broadcast 169.254.237.19
/etc/quagga/bgpd.conf
!
! Zebra configuration saved from vty
! 2006/06/09 16:13:05
!
hostname rr1-bgp
password zebra
enable password zebra
log file /var/log/quagga/bgpd.log
!
router bgp 65000
neighbor 169.254.237.17 remote-as 7224
neighbor 169.254.237.17 password PASSWORD_FROM_AWS_CONSOLE
network 10.10.21.0/24
!
line vty
然而,由于 Quagga 并不真正支持 BFD,我们还给了 BIRD(http://bird.network.cz)试试。两者都可以建立连接,但我认为我们这边最好也支持 BFD。
/etc/bird.conf
router id 169.254.237.18;
#debug protocols all;
protocol direct {
interface "eth0";
}
protocol kernel {
persist;
scan time 20;
export all;
}
protocol device {
scan time 100;
}
protocol bgp {
description "My BGP link";
local as 65000;
neighbor 169.254.237.17 as 7224;
password "PASSWORD_FROM_AWS_CONSOLE";
export all;
bfd on;
}
protocol bfd {
interface "eth*" {
min rx interval 5000 ms;
min tx interval 5000 ms;
idle tx interval 5000 ms;
};
multihop {
interval 200 ms;
multiplier 10;
};
neighbor 169.254.237.17;
}