2

We bought one Amazon Direct Connect leased line to connect our datacenter to Amazon EC2 instances. Amazon has configurations for Cisco or Juniper Hardware (http://docs.aws.amazon.com/directconnect/latest/UserGuide/getstarted.html).

However, is it also possible to use Linux as a router (for example by using Quagga, http://www.nongnu.org/quagga/)?

olliiiver
  • 256
  • 3
  • 12
  • 1
    I can't answer decisively, since I haven't had the opportunity to work with Direct Connect, but *it should*. All you appear to need is a router capable of 802.1q VLAN tagging, and BGP. Between the kernel and Quagga, you appear to have both... But I'll defer to someone with direct experience... Or, you can try it and if it works, you can post and accept your own answer... or a new question if you get close but not close enough. – Michael - sqlbot Jun 03 '15 at 21:59

2 Answers2

2

It turns out that it's pretty easy to connect to EC2 by using Quagga with Debian Linux.

/etc/network/interfaces

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

However, as Quagga does not really support BFD we also gave BIRD (http://bird.network.cz) a try. A connection can be established with both, but I think it's better to support BFD on our side, too.

/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;
} 
olliiiver
  • 256
  • 3
  • 12
0

Take a look at the Cisco Cloud Services Router (CSR1000V). It is available to run both in the Amazon Cloud (1) and as a VM on your premises as well. (2)

Its essentially a fully featured ASR router running in software, so you can do virtually everything you'd need to do to interconnect your sites (routing protocols, encryption, inter-VLAN routing, QoS, NAT, etc etc etc)

Jason Seemann
  • 1,120
  • 6
  • 9