Posts Tagged ‘ec2’

Spoofing MAC addresses using fakemac

Wednesday, December 14th, 2011

One of our customers uses a piece of software that depends on the MAC address of the running system. Unfortunately this application misbehaves when used on Amazon EC2 cloud computing, as each EC2 instance has an arbitrary MAC address that cannot be altered. Therefore we have written a small piece of software called fakemac.

fakemac acts as a wrapper around an application and uses LD_PRELOAD to load a small library that overloads the ioctl() function. When it sees requests to SIOCGIFHWADDR, it alters the returned data by overwriting the MAC address.

The fakemac program can be used as follows:

$ fakemac 42:42:42:42:42:42 ifconfig | grep HWaddr
eth0      Link encap:Ethernet  HWaddr 42:42:42:42:42:42
wlan0     Link encap:Ethernet  HWaddr 42:42:42:42:42:42

As always, the source code has been published on GitHub.

Publishing EC2 scripts on GitHub

Friday, April 29th, 2011

We’re glad to announce that we’ve published our set of EC2 scripts on GitHub! The kuminami repository contains current versions of the code described in these two blog posts:

In addition, the repository also contains the infrastructure to package the instance spawn script and the DNS syncer as a Debian package.

Automatically creating entries in PowerDNS for Amazon EC2 instances

Monday, April 18th, 2011

By default, instances created on Amazon EC2 will have a randomly assigned IPv4 address. It is however possible to pin instances to a preallocated IP address. These IP addresses are called Elastic IPs. Because IPv4 addresses are becoming very scarce, Amazon only allows a customer to allocate up to five Elastic IPs. Even though Elastic IPs are free to use when attached to a running instance, they come at a cost of $0.01 per hour unused.

Because of these two limitations, we have decided to simply use the randomly assigned addresses, which is why we’ve written a script to automatically create DNS entries in PowerDNS for instances managed through EC2. (more…)

Kumina into the cloud; creating Amazon EC2 images

Wednesday, April 13th, 2011

At Kumina we have already gained lots of experience when it comes to deploying and administering Debian installations on virtualisation platforms such as KVM and Xen. In all our setups, we also perform administration of the Dom0 — the operating system running the virtualisation software. Lately we have also been looking at cloud computing solutions, such as Amazon EC2. One of the advantage of cloud computing is that it’s easy to provide scalability. One can simply spawn new system instances on demand. Unfortunately the lack of administrative access to Dom0 can make it harder to debug and recover instances.

In order to make use of Amazon EC2 to its full potential, it is important that we can quickly spawn Debian installations that are automatically configured using Puppet. We accomplish this by creating our own Kumina-branded Amazon Machine Image (AMI). Compared to the stock Amazon Linux and Ubuntu images, it uses a different approach. Instead of creating an image of a pre-installed Debian system, we have created a relatively small system (about 12 MB), which uses Debootstrap to store an up-to-date installation on the provided storage space. When finished, it stores a set of pre-generated SSL certificates for Puppet in the right place and reboots into this new Debian installation. From within this system, we run Puppet to install additional pieces of software and configure the system correctly.

(more…)