- Back to Home »
- Linux »
- How To Run Linux Router Vyatta in GNS3
Posted by : Anonymous
Tuesday, 23 June 2015
How to run Linux Router Vyatta in GNS3
What is the Vyatta ?
Vyatta is bringing innovation and affordability to the networking industry by delivering advanced routing and security in a software-based network OS that scales from the branch office to the service provider edge. Vyatta has decoupled networking software from proprietary hardware allowing users to leverage the price and performance advantages of standard x86-based hardware and components as well as Citrix XenServer and VMWare virtual or cloud environments.
http://www.vyatta.com/
In this tutorial brezular shows us how to install Vyatta 6.1 Core LiveCD on Qemu image and run it from GNS3.
1. Download Vyatta Core 6.1 LiveCD iso (You need to fill short questionnaire for Vyatta download)
Vyatta download http://www.vyatta.com/downloads/index.php
2. Create Qemu qcow2 image
/usr/local/bin/qemu-img create -f qcow2 ./vyatta6.1vc.img 1G
3. Boot Qemu image with Vyatta 6.1 LiveCD
/usr/local/bin/qemu -boot d -hda ./vyatta6.1vc.img -cdrom ./vyatta-livecd_VC6.1-2010.08.20_i386.iso -m 512
login/password: vyatta/vyatta
4. Install Live CD
To install Live CD to Qemu image enter this command (as user vyatta)
install-system
The tutorial is opened and it walk you 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) [1074]MB: Enter
I found the following configuration files
/opt/vyatta/etc/config/config.boot
Which one should I copy to sda? [/opt/vyatta/etc/config/config.boot] Enter
Enter password for administrator account
Enter vyatta password: your_password
Retype vyatta password: your_password
Which drive should GRUB modify the boot partition on? [sda]: Enter
Done!
Now you successfully install Vyatta.
5. Adapt Vyatta NIC behavior to GNS3 Qemuwrapper
GNS3 qemuwrapper always changes MAC address of presented NIC during the boot of Qemu instance. Vyatta is programmed to save MAC address of existing ethernet interfaces. If MAC address of particular NIC is changed (by GNS3 qemuwrapper) Vyatta preserves the interface with old MAC and create new interface with new MAC.
Each time Qemu instace is restarted the number of interfaces doubled.
These are my steps how to solve it (it must be a better solution but I didn’t find any with Google search):
a) Enable root account on Vyatta 6.1
thank to Tim Peerlings blog http://www.timpeerlings.nl/enable-root-account-on-vyatta-6-1/
vyatta$ configure
vyatta#set system login user root authentication plaintext-password test
vayata# commit
vyatta# save
exit
Now you should switch to user root:
su
Password: test
b) Remove vyatta_net_name script (root account needed)
cd /lib/udev/
mv ./vyatta_net_name ./vyatta_net_name_backup
rm ./vyatta_net_name
6. Setup serial console login
thanks to Petr’s blog http://linux.xvx.cz/2009/08/debian-with-grub2-and-serial-connection/
This configuration redirects output to serial ttyS0 and allows you to use Console in GNS3.
Login as root with su command and modify grub configuration file:
vim /etc/default/grub
Change the lines in configuration file according to these lines
# This file is sourced by update-grub, and its variables are propagated
# to its children in /etc/grub.d/
GRUB_DEFAULT=0
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=”console=tty0 console=ttyS0,9600n8″
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND=”serial –speed=9600 –unit=0 –word=8 –parity=no –stop=1″
# Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
Now update grub with command:
update-grub
7. Setup GNS3 for Vyatta qemu image
- Start GNS3
- Edit-> Preferences-> Qemu-> Qemu Host
Check Kvm option only if your processor supports hardware virtualization. Check Kqemu option only if it is installed and running. If you are not sure with these options let them unchecked otherwise Qemu will be not started.
You need also set Qemu general settings like path to qemu, qemu-img and qemuwrapper.
- Edit-> Preferences-> Qemu-> General Settings
Login to Vyatta:
login/password: vyatta/your_password
8. Conclusion
Brezular has made a video to prove functionality of Yvatta Qemu image. In this video three Vyatta Qemu instances run RIP routing protocol.