Project V1: Vyatta Virtual Router--Basic IPv4 Configuration (25 pts.)

What You Need

Getting the Vyatta Software

In a Web browser, go to http://vyatta.org/downloads?whence=

Download the VC6.4 - Virtualization iso (Size: 206MB)

Creating the Virtual Machine

Use VMware Player, or whatever virtualization software you have.

Create a new VM, of type "Ubuntu Linux" with the default RAM and hard disk size.

Connect the VM's virtual CD to the Vyatta ISO file you downloaded.

Set the VM to connect to the Internet in a way that provides DHCP service, such as NAT.

Start the new VM.

Log in as vyatta with password vyatta

Installing Vyatta on the Virtual Hard Drive

Right now Vyatta is running as a LiveCD, which means all configuration changes you make will be lost after a reboot.

To install Vyatta on the virtual machine's hard drive, execute this command:

install system
At the "Would you like to continue? (Yes/No) [Yes]: " prompt, press Enter

At the "Partition (Auto/Union/PartEd/Skip) [Auto]: " prompt, press Enter

At the "Install the image on? [sda]: " prompt, press Enter

At the "Continue? (Yes/No) [No]: " prompt, type Yes and press Enter

At the "How big of a root partition should I create?" prompt, press Enter to accept the default size.

At the "Which one should I copy to sda?" prompt, press Enter to accept the default choice.

At the "Enter password for the administrator account" prompt, type vyatta and press Enter

At the "Retype vyatta password:" prompt, type vyatta and press Enter

At the "Which drive should GRUB modify the boot partition on?" prompt, press Enter to accept the default choice.

When you see the "Done!" message, execute this command to power your Vyatta virtual machine down:

poweroff

At the "Proceed with poweroff? (Yes/No) [No]" prompt, type Yes and press Enter

When the virtual machine powers off, enter the VM Settings and disconnect the ISO image from your Vyatta virtual machine.

Booting the Vyatta VM

Start the Vyatta VM. It should go through the usual Linux boot process.

Log in with the username vyatta and the password vyatta

Configuring an IPv4 DHCP Address on eth0

In Vyatta, execute these commands:

configure

set interfaces ethernet eth0 address dhcp

commit

exit

show interfaces
You should see an IPv4 address on your eth0 interface, as shown below. (You won't see an eth1 interface yet, don't worry about that.)

Test IPv4 connectivity with this command:

ping 8.8.8.8
You should see replies, as shown in the figure below. Press Ctrl+C to stop the pings.

Saving the Configuration

The interface configuration is correct now, but it will be lost when the Vyatta VM is rebooted unless youb save it to the default configuration file, which is named config.boot.

To save the configuration, execute these commands:

configure
save
commit
exit

Powering Off the Virtual Machine

In the Vyatta virtual machine, execute this command:
poweroff
Verify the power off by typing Yes

Adding Another Network Adapter

In your VMware software, add a second Ethernet adapter to the virtual machine, in Bridged mode.

Then power the Vyatta VM on again.

Log in as you did before, with a username of vyatta and a password of vyatta

Test IPv4 connectivity with the ping you used before:

ping 8.8.8.8
You should see replies.

Specifying a Manual Address for the eth1 Interface

In your Vyatta virtual machine, execute these commands:
configure

set interfaces ethernet eth1 address 172.17.1.1/24

commit

exit

show interfaces
You should see addresses on both Ethernet interfaces, as shown below:

Configuring DHCP Service on the eth1 Interface

The eth0 interface is a DHCP client, but we will make the eth1 interface a DHCP server, to mimic the function of typical home routers which allow several machines to share a single Internet connection.

To do this, three things are required:

In your Vyatta virtual machine, execute these commands:
configure

set service dhcp-server shared-network-name PRIVATE subnet 172.17.1.0/24 start 172.17.1.101 stop 172.17.1.150

set service dhcp-server shared-network-name PRIVATE subnet 172.17.1.0/24 dns-server 8.8.8.8

set service dhcp-server shared-network-name PRIVATE subnet 172.17.1.0/24 dns-server 208.67.222.222

set service dhcp-server shared-network-name PRIVATE subnet 172.17.1.0/24 default-router 172.17.1.1

commit

exit

show interfaces

Testing the DHCP Server

Unfortunately, this part is difficult with VMware.

By default, VMware makes two connections: vmnet1 and vmnet8, but they both have DHCP service already from VMware, which interferes with testing the Vyatta DHCP server.

You need to activate another virtual network, such as vmnet2, without NAT, DHCP, or a bridged connection to the host.

I managed to set it up with quite a lot of tricky work, editing config files as explained on these pages:

https://eos.aristanetworks.com/2012/06/vmware-fusion-virtual-networks/

http://communities.vmware.com/message/1803720

A simpler method would be to use two real computers, with the Vyatta virtual machine running on a computer with two network adapters.

I added a second network interface to a Windows 7 virtual machine and connected it to vmnet2 to act as the client.

In the Windows 7 machine, execute the IPCONFIG /ALL command and scroll back to see the details of the adapter you connected to vmnet2.

When you get it working, it should show these items, as shown below:

Viewing DHCP Server Leases

In your Vyatta virtual machine, execute this command:
show dhcp server leases
You should see a lease for an address starting with 172.17.1, as shown below:

Saving the Screen Image

Make sure you can see the lease for an address starting with 172.17.1, as shown in the image above on this page.

Save a screen image with the filename Proj V1a from Your Name.

Testing Networking From the Client

On your client machine, (NOT the Vyatta machine), try these two commands:
ping 172.17.1.1

ping 8.8.8.8
The first one should show replies, but not the second one, as shown below:

This indicates that you are connected to the Vyatta router, but not to the Internet.

That's because the Vyatta router is providing DHCP service, but not NAT.

Configuring NAT Service on the eth1 Interface

In your Vyatta virtual machine, execute these commands:
configure

set nat source rule 1 source address 172.17.1.0/24

set nat source rule 1 outbound-interface eth0

set nat source rule 1 translation address masquerade

commit

save

exit

show interfaces

Testing NAT from the Client

On your client machine, (NOT the Vyatta machine), execute this command:
ping 8.8.8.8
You should now see replies, as shown below:

Viewing NAT Source Translations

In your Vyatta virtual machine, execute this command:
show nat source translations
You should see one or more lines translating Pre-NAT addresses starting with 172.17.1 to different Post-NAT addresses, as shown below:

Saving the Screen Image

Make sure you can see at least one translation line, as shown in the image above on this page.

Save a screen image with the filename Proj V1b from Your Name.

Turning in Your Project

Email the image to cnit.60@gmail.com with a Subject line of Proj V1 from Your Name.


Useful Vyatta Commands

To renew a DHCP client lease:
renew dhcp interface eth0
To delete a setting, replace "set" with "delete", for example:
delete interfaces ethernet eth0 address dhcp
To specify a DNS server address manually:
set system name-server 8.8.8.8
To specify a default gateway manually:
set system gateway-address 192.168.1.1 
To change your password:
sset system login user vyatta authenticationplaintext-password 12new$pwd34
To execute a Linux command directly, such as ifconfig
sudo ifconfig

Sources

http://www.sohoadvisers.com/tutorials/vyatta-router/vyatta-router-quick-setup

http://blogs.technet.com/b/stefan_stranger/archive/2008/08/25/vyatta-virtual-router-on-hyper-v.aspx

http://www.carbonwind.net/VyattaOFR/VyattaCiscos2stunmode/VyattaCiscos2stunmode.htm

http://www.vyatta.org/getting-started/how-to-install

http://www.wikihow.com/Enable-IP-Routing

http://technet.microsoft.com/en-us/library/cc753256(v=ws.10).aspx#BKMK_4

https://eos.aristanetworks.com/2012/06/vmware-fusion-virtual-networks/

http://communities.vmware.com/message/1803720

http://www.vyatta.org/forum/viewtopic.php?t=8108&sid=bd53108fcf2e756cb01e3dfc298f81b6

http://www.v12n.com/mediawiki/index.php/Vyatta_How_To#Version_6.4

http://www.scribd.com/doc/52411762/60/Changing%C2%A0Passwords?


Last modified 8:30 am 10-4-2012