major.io words of wisdom from a systems engineer

Configure static IP addresses for Project Atomic’s KVM image

Amid all of the Docker buzz at the Red Hat Summit, Project Atomic was launched. It’s a minimalistic Fedora 20 image with a few tweaks, including rpm-ostree and geard.

There are great instructions on the site for firing up a test instance under KVM but my test server doesn’t have a DHCP server on its network. You can use Project Atomic with static IP addresses fairly easily:

Create a one-line /etc/sysconfig/network:

NETWORKING=yes

Drop in a basic network configuration into /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
IPADDR=10.127.92.32
NETMASK=255.255.255.0
GATEWAY=10.127.92.1
ONBOOT=yes

All that’s left is to set DNS servers and a hostname:

echo "nameserver 8.8.8.8" > /etc/resolv.conf
hostnamectl set-hostname myatomichost.example.com

Bring up the network interface:

ifup eth0

Of course, you could do all of this via the nmcli tool if you prefer to go that route.