Using Vyatta with minimega

Introduction

minimega includes commands to configure a Vyatta router for use in your experiment. This document explains some common use cases; see the vyatta API documentation for more information.

Test environment

For the purposes of this document, we are assuming you wish to set up a router between an internal network (192.168.0.0/24) and an external network (5.5.5.0/24). Your router will have an external IP of 5.5.5.5 and an internal IP of 192.168.0.1.

Your router will provide DHCP services to the internal network and directs internal nodes to use 8.8.8.8 as their DNS server.

Preparing the Vyatta config

To specify the configuration of our Vyatta VM, we use the vyatta commands. Once we have specified our desired setup, the vyatta write command writes it out as a floppy disk image, which we then pass to QEMU

Configuring Vyatta

# Specify your interface IPs
vyatta interfaces 5.5.5.5/24 192.168.0.1/24

# Enable OSPF
vyatta ospf 5.5.5.0/24 192.168.0.1/24

# Enable internal DHCP, with 8.8.8.8 as your DNS server.
vyatta dhcp add 192.168.0.0/24 192.168.0.1 192.168.0.2 192.168.0.250 8.8.8.8

# Set up IPv6 too
vyatta interfaces6 2001:5:5:5::5/64 2001:192:168:0::1/64

# Enable router advertisement for IPv6
vyatta rad 2001:5:5:5::0/64 2001:192:168:0::0/64

# Enable OSPF3 for IPv6 interfaces
vyatta ospf3 eth0 eth1

# Write out the configuration as a floppy disk
vyatta write router.img

Configuring the VM

You'll need the Vyatta ISO file somewhere accessible; it is not included with minimega.

# Use the Vyatta ISO
vm config cdrom vyatta.iso
# Two network interfaces
vm config net 100 200

# Tell QEMU to use that image as a floppy drive
vm config qemu-append -fda /tmp/minimega/files/router.img

# Launch your VM
vm launch kvm router noblock
vm start router

The Vyatta VM should boot and start routing traffic for you. You should be able to ssh to the router if necessary by adding a host tap to one of the VLANs used.

Authors

The minimega authors

13 Aug 2015