What is the Vyatta ?
The free community Vyatta Core software(VC) is an open source network operating system providing advanced IPv4 and IPv6 routing, stateful firewalling, IPSec and SSL OpenVPN, intrusion prevention, and more. When you add Vyatta to a standard x86 hardware system, you can create an enterprise grade network appliance that easily scales from DSL to 10Gbps. Vyatta is also optimized to run in VMware, Citrix XenServer, Xen, KVM, and other hypervisors, providing networking and security services to virtual machines and cloud computing environments. Vyatta has been downloaded over 600,000 times, has a community of hundreds of thousands of registered users and counts dozens of fortune 500 businesses among its commercial customers.
The word "vyatta" (pronounced vee-AH-tah) is ancient Sanskrit and means "open."
In this tutorial I would like to show install Vyatta 6.6 Core Virtualization ISO on Qemu image and run it from GNS3.
1. Download Vyatta Core 6.6 Virtualization iso
2. Create Qemu qcow2 image
/usr/bin/qemu-img create -f qcow2 ./vyatta6.6vc.img 1G
3. Boot Qemu image with Vyatta 6.6 LiveCD
/usr/local/bin/qemu-system-i386 -boot d vyatta6.6vc.img -cdrom vyatta-livecd_VC6.6R1_i386.iso -m 1024
4. Install Live CD
To install Live CD to Qemu image enter run an installation script.
vyatta@vyatta:~$ install system
The wizard is opened and you are going to through installation process:
Would you like to continue? (Yes/No) [YES]: Enter
Partition (Auto/Union/Parted/Skip) [Auto]: Enter
Install the image on? [sda]: Enter
This will destroy all data on /dev/sda.
Continue? (Yes/No) [No]: Yes
How big of root partition should I create? (1000MB - 1074MB) MB: Enter
I found the following configuration files
Which one should I copy to sda? [/opt/vyatta/etc/config/config.boot] Enter
Enter password for administrator account
Enter vyatta password: vyatta
Retype vyatta password: vyatta
Which drive should GRUB modify the boot partition on? [sda]: Enter
You have successfully installed Vyatta. Type sudo su and halt Vyatta with the halt command. Start a new installed Vyyata with the following command.
/usr/local/bin/qemu-system-i386 -boot c vyatta6.6vc.img -m 1024
5. Make a serial console to be a default option in the boot menu
Basically those are options presented in the Grub boot menu:
Vyatta VC6.6R1 (KVM console)
Vyatta VC6.6R1 (Serial console)
Vyatta VC6.6R1 (USB console)
Lost password change VC6.6R1 (KVM console)
Lost password change VC6.6R1 (Serial console)
Lost password change VC6.6R1 (USB console)
According to the words of developer:
Which console to use was traditionally defined automatically during install, by vyatta-grub-setup, based on which console the user was logged in on. i.e. if you install while on a serial console, your default console in grub would be the serial one.
If you installed vyatta connected to kvm console and want to change the default console to the serial console you can do it as following. Type sudo su and edit /boot/grub/grub.cfg and set option "set default" to 1.
To check if Vyatta sends output to the serial port start Vyatta Qemu image as following.
/usr/local/bin/qemu-system-i386 -boot c vyatta6.6vc.img -m 1024 -serial telnet:127.0.0.1:4444,server,nowait
Telnet to Vyatta with command.
telnet localhost 4444
6. Adapt Vyatta NIC to deal with GNS3 Qemuwrapper behaviour
GNS3 qemuwrapper script runs an Qemu image with random MAC address generated for Ethernet interface. Next time the Qemu image is started a new MAC address is generated for the same interface. Vyatta is programmed to save MAC address of existing Ethernet interfaces. If the new MAC address of existing interface is generated, Vyatta preserves the interface with an original MAC address and create a completely new interface with the new MAC address.
For this reason, every time an Qemu instance is restarted the number of interfaces is doubled.
a) Remove vyatta_net_name script (
root password needed)
First, switch to the superuser account with sudo su or set a superuser password.
vyatta@vyatta# set system login user root authentication plaintext-password root
vyatta@vyatta:~$ sudo su
root@vyatta:/home/vyatta# cd /lib/udev/
root@vyatta:/home/vyatta# mv vyatta_net_name vyatta_net_name_backup
Add the following line to /lib/udev/rules.d/75-persistent-net-generator.rules
The line adds Ethernet interfaces whose MAC addresses begin with HEX number 0 to the list of Ethernet interfaces which will be ignored even their MAC address has been changed.
7. Setup GNS3 for Vyatta Qemu image
- Start GNS3
- Edit-> Preferences-> Qemu-> Qemu Host
Configure settings as it is shown on the picture:
Enable Kvm option if your CPU supports hardware virtualization. In case you are not sure with this option let it unchecked otherwise Qemu will not start.
Other parameters such as path to qemu, qemu-img and qemuwrapper must be set on the Qemu General Settings tab.
- Edit-> Preferences-> Qemu-> General Settings
Check the picture below for details:
I've created a video to prove functionality of Vyatta Qemu image in GNS3. In this video three Vyatta Qemu instances are running RIP routing protocol.