Category Archives: vMX

Interface Ordering on VMware (vMX / vSRX / vQFX)

Just a quick post on Interface ordering when using vmxnet3 on VMware. When you add more than 4 vmxnet3 data interfaces, on the addition of the 5th interface you may see that interface ordering is no longer sequential. This is not a vMX specific issue, it is due to the way the VMware balances PCI slot numbers to the guest PCI bus topology. More info here.

For vMX, interface mapping would initially look like this:

vnic1 – fxp0 (e1000)
vnic2 – internal link (e1000)
vnic3 – ge-0/0/0 (vmxnet3)
vnic4 – ge-0/0/1 (vmxnet3)
vnic5 – ge-0/0/2 (vmxnet3)
vnic6 – ge-0/0/3 (vmxnet3)

However on the addition of vnic7 – ge-0/0/4, the interface ordering changes to:

vnic1 – fxp0
vnic2 – internal link
vnic3 – ge-0/0/0
vnic4 – ge-0/0/2
vnic5 – ge-0/0/3
vnic6 – ge-0/0/4
vnic7 – ge-0/0/1

As you can see, the interface ordering is no longer sequential.

To workaround this issue, you should perform the following steps:

  1. Power off the VFP VM and open the VMware Edit Settings page.
  2. If you are using the vSphere Web Client, select the VM Options tab, click Advanced in the left frame, and click Edit Configuration at the bottom of the page.
    If you are using the vSphere desktop client, select General under Advanced in the left frame, and click Configuration Parameters at the bottom of the page.)
  3. Change the value of the following pciBridge settings from TRUE to FALSE:
    pciBridge5.present
    pciBridge6.present
    pciBridge7.present
    Do not make any changes to pciBridge0.present and pciBridge4.present
  4. Click OK to update the VM settings, and then add any further vmxnet3 network adapters as may be required.
  5. Now power up the VFP VM and check that the interface ordering is now correct.

Note, if you require more than 7 data interfaces, it may be necessary to make further changes. Repeat the steps above, however now change the pciBridge.preset from FALSE to TRUE and update the below parameters (add any that are missing):
pciBridge5.virtualDev = pcieRootPort
pciBridge5.functions = 8
pciBridge5.pciSlotNumber = 22

Juniper Day One: vMX Up and Running

My Day One book on the vMX is now available – the book gives an introduction to vMX and then goes on to walk through a complete build of it on Ubuntu Linux (Junipers preferred distribution). So you can get familiar with vMX and Junos, you will get straight in to the Lab and build and scale a topology, learning about EVPN and VPLS along the way.

vmx-front

The Day One is for network engineers or architects who are interested in learning more about vMX, and KVM in general. You might be thinking about how to deploy vMX in a production environment, or how to build and scale a lab or simulation, without access to physical routers.

It was a fun project and I’d like to thank Juniper for the opportunity.

Here’s how you can get a copy of the book:

Also thanks to Said van de Klundert for the review of the Day One.

Juniper vMX – Getting Started Guide (VMware)

As of Junos 15.1F4, Juniper are now officially supporting vMX on Vmware.

The installation process has quite a few steps to it, so following on my my vMX Getting Started Guide for KVM, here is a quick post showing you how to do it on your home lab running Vmware Hypervisor ESXi 6.0.

ESXi Installation

Let’s get started with the installation of ESXi. I’m doing this running ESXi as a nested VM on a Macbook, but the process would be the same if you were doing it on bare metal.

Register with Vmware and download the ESXi ISO from Vmware and then boot your machine from the ISO. The installation of ESXi is a simple process. Go through the installation steps one by one and reboot ESXi once the installation has completed.

Following the reboot ESXi will load up and if your management LAN is running DHCP the host will have been assigned an  IP address for management. You need to download the VMware client to be able to manage ESXi free. Open a web browser and connect to the ESXi IP – download the tools as suggested, and then load up the client.

Once the client is loaded, firstly you should license the ESXi host. You can get a free license from Vmware at the ESXi download page.

In the web client the license is applied at Home – Inventory – click configuration and then Licensed Features. You can then click edit to apply the license.

esxi-license

vMX Installation

If you have a valid login, you can download vMX directly from the vMX download page.

Now load up the client for your ESXi server and login.

There is no OVA build currently, so several steps need to be done manually.

Copy Files to the Datastore

Before progressing any further you will need to extract the vMX package. All of the vmdk files are located in the subdirectory “/vmdk”.

  • Software image for vMX VCP: jinstall64-vmx-15.1F4.15-domestic.vmdk
  • Software image for VCP file storage: vmxhdd.vmdk
  • Software image for VFP: vFPC-20151203.vmdk
  • metadata_usb.vmdk: Virtual hard disk with bootstrapping information. This is used by the VCP.

Click the summary tab, select the datastore under Storage, right click and select Browse Datastore.

Create a folder called “vmx” and then click the upload file button and upload all of the vmdk files listed above to this new folder.

vmx-ds

Set Up the vMX Network

If you are not familiar with vMX then at this point it would be a good idea to read over my vMX Getting Started Guide for KVM, so that you understand the architecture of vMX, and how the vMX virtual machines communicate with one another.

The VMware release is no different to the KVM release when it comes to the required default networks. There are a minimum of three networks that will need to be configured:

  • Management network (br-ext)
  • Internal network for VCP and VFP communication (br-int)
  • Data interfaces

To create these networks, go back to the ESXi client, select the ESXi server and click the Configuration tab. Select Networking under Hardware. In the top right corner click Add networking.

Management Network

  1. Select Virtual Machine as the connection type and click next
  2. Select Use vSwitch0 and click next
    vswitch
  3. At port group properties, set network label to br-ext and click next
    br-ext
  4. Now click finish

You will see the new port group “br-ext” has been added to the standard switch vSwitch0.

Internal Network

Again, select Networking under Hardware. In the top right corner click Add networking.

  1. Select Virtual Machine as the connection type and click next
  2. This time select Create a vSphere standard switch and clear all physical NIC check boxes, then click next
    br-int1
  3. For network label, use br-int
  4. You should now have a port group called “br-int”, with no adapters assigned

Data Network

Now add a data network, the process is repeated according to the number of data NICs that you wish to add. Time to create a single adapter named p1p1.

Again, select Networking under Hardware. In the top right corner click Add networking.

  1. Select Virtual Machine as the connection type and click next
  2. Select Create a vSphere standard switch and add the physical NIC that you want to use, and click next
  3. Name the connection p1p1, click next, and finish

Repeat this process if you have any more data adapters to add to vMX.

Complete the network configuration

You will now see the 3 networks in the networking summary screen – br-ext, br-int and p1p1.

You must enable promiscuous mode in all vSwitches so that packets with any MAC addresses can reach the vMX. e.g. for OSPF to work properly.

netsumm
For each vSwitch, click properties, then select vSwitch and click edit. Select security and change promiscuous mode to accept.

Set Up the vMX Virtual Machines

Just like vMX on KVM, there are two VMs that must be created – the virtual control plane (VCP) running the Junos OS, and the virtual forwarding plane (VFP) running an x86 visualised release of Trio running on Wind River Linux.

The process for creating both of the virtual machines is very similar. It’s a simple case of following the VMware wizard and choosing the correct settings for the VM.

VCP

This process below outlines the steps required to create the VCP virtual machine.

  1.  Within the VMware client, select the ESXi host, right click, new virtual machine
  2. Select to create a custom virtual machine, and press next
  3. Give the machines a suitable name, e.g. vcp-vmx1
  4. Select the datastore where you would like to store the VM and press next
  5. Set the virtual machine version to 8
  6. For the guest OS type, choose Other, Other (64-bit)
  7. Select one virtual socket, and 1 cpu core per socket, to assign a total of 1 CPU core to the VCP
  8. Provision 2GB of memory
  9. In the network setup, select 2 network adapters.
    Asign br-ext as the 1st adapter and br-int as the 2nd adapter.
    Set both to be e1000.
  10. Select LSI Logic Parallel as the SCSI controller
  11. When prompted to select the disk type, choose use an existing virtual disk, and then on the next screen browse to the correct datastore and select the jinstall64-vmx-15.1F4.15-domestic.vmdk image that you uploaded earlier
  12. At the advanced options page, simply click next
  13. Select to edit the virtual machine settings before completion and click continue
  14. Now you need to add two more hard drives – click Add, and then Hard Disk, this time selecting vmxhdd.vmdk as the second drive
  15. Repeat the add Hard Disk process again this time adding the metadata_usb.vmdk image as the third drive.

NOTE: this 3rd hard drive is important – if you don’t configure it then the first time VCP boots, VCP will setup as an “olive” not vMX!

You can now boot the VCP!

If the boot process appears to wait at “Loading /boot/loader” do not worry, on the VMware release you don’t see the full Junos OS boot process on the console.

VFP

This process below outlines the steps required to create the VFP virtual machine.

  1.  Within the VMware client, select the ESXi hosts, right click, new virtual machine
  2. Select custom and press next
  3. Give the machines a suitable name, e.g. vfp-vmx1
  4. Select the datastore where you would like to store the VM and press next
  5. Set the virtual machine version to 8
  6. For the guest OS, choose Other, Other (64-bit)
  7. When prompted to select the number of CPUs, for this build the minimum you can choose is three virtual sockets, and 1 cpu core per socket, to give a total of 3 CPU cores assigned to the VCP
  8. Provision 8GB of memory
  9. In the network setup, select at least 3 network adapters, assigning br-ext as the 1st adapter and br-int as the 2nd adapter. Set them both to be e1000 adapters. The data adapters can now be selected, set them to vmxnet3 or e1000 depending on your preference. For better performance, I’d suggest you use vmxnet3 because this is a paravirtualization adapter.
    NOTE: if you wish to use SR-IOV – at the time of writing SR-IOV is not officially supported on VMware, only on KVM.
  10. Select LSI Logic Parallel as the SCSI controller
  11. When prompted to select the disk to use, choose use an existing virtual disk, and then on the next screen browse to the datastore and select the vFPC-20151203.vmdk image that you uploaded earlier (bear in mind the image naming has changed from vPFE* to vFPC* in this latest release of vMX)
    NOTE: on my build the Juniper supplied image needed to be converted to thick provisioned using vmkfstools, otherwise the VM refused to boot (I was getting a VMware error related to free space even though the drives were not full). You may not have to do this! Thanks to @tomverhaeg for working through this strange issue with me!
  12. At the advanced options page, simply click next
  13. At Ready to Complete, you can click finish and boot the VFP!

NOTE: VMware virtual console for the VFP does not show anything beyond “Please Wait: Booting” – if you wish to login to the VFP you will need to configure serial console. The process for setting up serial console is described here.

 Verification

At this point if both machines have powered on successfully you should have a running vMX.

Now login to the VCP and run the Junos command “show chassis fpc”. After a few moments you should see the FPC as online and ge-* interfaces will appear.

Have fun!

For more information, please refer to the Juniper documentation on the VMware release of vMX.

 

Juniper vMX – Getting Started Guide

I’m excited to finally have the opportunity to play with Juniper’s vMX! Since it was announced last year I’ve been eagerly waiting for release – a couple of client projects already have passed by where the vMX would have been a perfect fit. vMX already won an award earlier this year at Interop Tokyo 2015!

In this post I’ll be giving a bit of background on the vMX architecture and licensing, and then go on to walk through a lab based configuration of vMX.

The vMX is a virtual MX Series Router that is optimized to run as software on x86 servers. Like other MX routers, it runs Junos, and Trio has been compiled for x86! Yes, that means the sophisticated L2, L2.5 and L3 forwarding features we are used to on the MX are present on the vMX.

Architecture

vMX can be installed on server hardware of your choice, so long as it is x86 based and running Linux (although I’m sure a version to run on vmware won’t be too far away).

vMX itself actually consists of two separate VMs – a virtual forwarding plane (VFP) running the vTrio, and a virtual control plane (VCP) running Junos.

The Linux virtualisation solution KVM is what Juniper are using to spin up the virtual instances of the control and forwarding planes, and multiple instances of vMX can be run on the same hardware. To see Juniper using Linux and KVM is no surprise as this is what we are used to on Juniper’s other products such as the QFX.

The VMs are managed by a simple orchestration script which is used to create, stop and start the vMX instances. A simple configuration file defines parameters such as memory and vCPUs to allocate to the VCP and VFP.

A couple of Linux bridges are created by the orchestration script. Clearly VCP and VFP need to be able to communicate directly so an “internal” bridge is automatically created for each vMX instance to enable this communication.  An “external” bridge is also created, this is used to enable the management interface on the Linux Physical host to be used for the virtual management interfaces on the VCP and VFP.

For data interfaces, there are a couple of techniques available for packet I/O depending on the required vMX throughput –

  • Paravirtualisation using KVMs virtio drivers
  • PCI passthrough using single root I/O virtualisation (SR-IOV), enabling packets to bypass the hypervisor and therefore increase I/O.

Juniper recommend virtio or SR-IOV up to 3Gbps, and SR-IOV over 3Gbps (using a minimum of 2 x 10GE interfaces).

Which you will choose will ultimately depend on  your use case for the vMX.

Licensing

Now this is what I really like about vMX! Licensing is based on a combination of throughput and features, and the lowest available throughput license is 100Mbps! Yes – you don’t need to be shifting multi-Gigabits of traffic to start with vMX. You can start small and pay-as-you-grow with vMX.

Below 1Gbps there are only 3 options – 100Mbps, 250Mbps and 500Mbps. Full scale features are included! List price on the 100Mbps option is a very reasonable $750.

At 1Gbps and above, licences are a combination of features (Base, Advance, and Premium) and full duplex throughput (1G, 5G, 10G, 40G)

  • Base – IP routing with 32,000 routes in the forwarding table. Basic Layer 2 functionality, Layer 2 bridging and switching.
  • Advance – Features in the BASE application package IP routing with routes up to platform scale in the forwarding table. IP and MPLS switching for unicast and multicast applications. Layer 2 features include Layer 2 VPN, VPLS, EVPN, and Layer 2 Circuit
    VXLAN.
  • Premium – Features in the BASE and ADVANCE application packages. Layer 3 VPN for IP and multicast

Setting up vMX on Ubuntu

Now I’m going to walk through setting up vMX on Ubuntu 14.04 LTS server (Juniper’s recommended flavour of Linux for vMX). Just for fun this is actually running as a nested Vmware VM on my Macbook Pro – fine for a lab, but don’t try this in production! 🙂 I have allocated 8GB RAM, 4 vCPUs  and two vNICs to the Ubuntu VM. Also the VM is enabled to support hypervisor applications within the VM.

At this point Ubuntu Server has been freshly installed, and the option to install virtualisation was selected during setup.

First things first, let’s update all packages, install the prerequsite packages and restart the system

mdinham@ubuntu:~$ sudo apt-get upgrade
<snip>
mdinham@ubuntu:~$ sudo apt-get install bridge-utils qemu-kvm libvirt-bin python python-netifaces vnc4server libyaml-dev python-yaml numactl libparted0-dev libpciaccess-dev libnuma-dev libyajl-dev libxml2-dev libglib2.0-dev libnl-dev python-pip python-dev libxml2-dev libxslt-dev
<snip>
mdinham@ubuntu:~$ sudo reboot

Configuring vMX

As this is a lab based build, I will be using virtio for the virtual NIC. There are two options on the VFP – a “Lite” version PFE for labs and performance version for normal operation.

Note: Ubuntu 14.04 provides libvirt 1.2.2 which works for VFP lite version. However for the VFP performance version you must upgrade to libvirt 1.2.8.

Let’s extract the vMX application bundle and get going!

mdinham@ubuntu:~$ tar xzf vmx-14.1R5.4-1.tgz
mdinham@ubuntu:~$ cd vmx-14.1R5.4-1/
mdinham@ubuntu:~/vmx-14.1R5.4-1$ ls
config drivers env images scripts vmx.sh

First of all we need to setup the vmx config file, this is done by editing config/vmx.conf

First of all I set an instance name for vmx, and set the correct vmx images. I’m using vPFE-lite.

---
#Configuration on the host side - management interface, VM images etc.
HOST:
    identifier                : vmx1   # Maximum 4 characters
    host-management-interface : eth0
    routing-engine-image      : "/home/mdinham/vmx-14.1R5.4-1/images/jinstall64-vmx-14.1R5.4-domestic.img"
    routing-engine-hdd        : "/home/mdinham/vmx-14.1R5.4-1/images/vmxhdd.img"
    forwarding-engine-image   : "/home/mdinham/vmx-14.1R5.4-1/images/vPFE-lite-20150707.img"

Now the parameters the control plane and forwarding plane.

I’ve allocated 1 vCPU to vRE and 3 vCPU to vPFE. 1GB RAM to the RE and 6GB to the forwarding plane, as per the defaults for 14.1

UPDATE: Feb 2016
For vMX on 15.1, allocate 1 vCPU to vRE and 3 vCPU to vPFE. 2GB RAM to the RE and 8GB to the forwarding plane.

I have also tried vMX with 2GB allocated to the vPFE and the forwarding plane loaded, which could be fine for lab purposes. I’d expect 1GB to be the minimum on the vRE. 3 x vCPU seems to be the minimum for the vPFE.

Note that device-type is set to “virtio” for the interfaces.

---
#External bridge configuration
BRIDGES:
    - type  : external
      name  : br-ext                  # Max 10 characters

---
#vRE VM parameters
CONTROL_PLANE:
    vcpus       : 1
    memory-mb   : 2048
    console_port: 8601

    interfaces  :
      - type      : static
        ipaddr    : 10.102.144.94
        macaddr   : "0A:00:DD:C0:DE:0E"

---
#vPFE VM parameters
FORWARDING_PLANE:
    memory-mb   : 6144
    vcpus       : 3
    console_port: 8602
    device-type : virtio

    interfaces  :
      - type      : static
        ipaddr    : 10.102.144.98
        macaddr   : "0A:00:DD:C0:DE:10"

---
#Interfaces
JUNOS_DEVICES:
 - interface : ge-0/0/0
 mac-address : "02:06:0A:0E:FF:F0"
 description : "ge-0/0/0 interface"

I will only be using one interface in this lab, but up to 10 can be configured. For SR-IOV, things are done slightly differently – see this vMX doc for reference.

I now need to deploy the vMX instance using the orchestration script. “-lv” provides verbose logging. My vMX instance will be created by the script and automatically started.

mdinham@ubuntu:~/vmx-14.1R5.4-1$ sudo ./vmx.sh -lv --install
==================================================
 Welcome to VMX
==================================================
Date..............................................07/18/15 13:19:03
VMX Identifier....................................vmx1
Config file......................................./home/mdinham/vmx-14.1R5.4-1/config/vmx.conf
Build Directory.................................../home/mdinham/vmx-14.1R5.4-1/build/vmx1
Environment file................................../home/mdinham/vmx-14.1R5.4-1/env/ubuntu_virtio.env
Junos Device Type.................................virtio
Initialize scripts................................[OK]
Copy images to build directory....................[OK]
==================================================
 VMX Environment Setup Completed
==================================================
==================================================
 VMX Install & Start
==================================================
Linux distribution................................ubuntu
Check GRUB........................................[Disabled]
Installation status of qemu-kvm...................[OK]
Installation status of libvirt-bin................[OK]
Installation status of bridge-utils...............[OK]
Installation status of python.....................[OK]
Installation status of libyaml-dev................[OK]
Installation status of python-yaml................[OK]
Installation status of numactl....................[OK]
Installation status of libnuma-dev................[OK]
Installation status of libparted0-dev.............[OK]
Installation status of libpciaccess-dev...........[OK]
Installation status of libyajl-dev................[OK]
Installation status of libxml2-dev................[OK]
Installation status of libglib2.0-dev.............[OK]
Installation status of libnl-dev..................[OK]
Check Kernel Version..............................[Disabled]
Check Qemu Version................................[Disabled]
Check libvirt Version.............................[Disabled]
Check virsh connectivity..........................[OK]
IXGBE Enabled.....................................[Disabled]
==================================================
 Pre-Install Checks Completed
==================================================
Check for VM vcp-vmx1.............................[Not Running]
Check for VM vfp-vmx1.............................[Not Running]
Cleanup VM states.................................[OK]
Check if bridge br-ext exists.....................[No]
Cleanup VM bridge br-ext..........................[OK]
Cleanup VM bridge br-int-vmx1.....................[OK]
==================================================
 VMX Stop Completed
==================================================
Check VCP image...................................[OK]
Check VFP image...................................[OK]
VMX Model.........................................Lite
Check VCP Config image............................[OK]
Check management interface........................[OK]
Setup huge pages to 8192..........................[OK]
Attempt to kill libvirt...........................[OK]
Attempt to start libvirt..........................[OK]
Sleep 2 secs......................................[OK]
Check libvirt support for hugepages...............[OK]
==================================================
 System Setup Completed
==================================================
Get Management Address of eth0....................[OK]
Generate libvirt files............................[OK]
Sleep 2 secs......................................[OK]
Find configured management interface..............eth0
Find existing management gateway..................eth0
Check if eth0 is already enslaved to br-ext.......[No]
Gateway interface needs change....................[Yes]
Create br-ext.....................................[OK]
Get Management Gateway............................192.168.100.254
Flush eth0........................................[OK]
Start br-ext......................................[OK]
Bind eth0 to br-ext...............................[OK]
Get Management MAC................................00:0c:29:76:a8:15
Assign Management MAC 00:0c:29:76:a8:15...........[OK]
Add default gw 192.168.100.254....................[OK]
Create br-int-vmx1................................[OK]
Start br-int-vmx1.................................[OK]
Check and start default bridge....................[OK]
Define vcp-vmx1...................................[OK]
Define vfp-vmx1...................................[OK]
Wait 2 secs.......................................[OK]
Start vcp-vmx1....................................[OK]
Start vfp-vmx1....................................[OK]
Wait 2 secs.......................................[OK]
==================================================
 VMX Bringup Completed
==================================================
Check if br-ext is created........................[Created]
Check if br-int-vmx1 is created...................[Created]
Check if VM vcp-vmx1 is running...................[Running]
Check if VM vfp-vmx1 is running...................[Running]
Check if tap interface vcp_ext-vmx1 exists........[OK]
Check if tap interface vcp_int-vmx1 exists........[OK]
Check if tap interface vfp_ext-vmx1 exists........[OK]
Check if tap interface vfp_int-vmx1 exists........[OK]
==================================================
 VMX Status Verification Completed.
==================================================
Log file..........................................
 /home/mdinham/vmx-14.1R5.4-1/build/vmx1/logs/vmx_1437221943.log
==================================================
 Thankyou for using VMX
==================================================

Connecting to the console port on the VMs

We can now connect to the vMX control plane! This is done using the vmx.sh script again.

Specify vcp (control plane – Junos) or vcf (vPFE) and the instance name.

mdinham@ubuntu:~/vmx-14.1R5.4-1$ ./vmx.sh --console vcp vmx1
--
Login Console Port For vcp-vmx1 - 8601
Press Ctrl-] to exit anytime
--
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


Amnesiac (ttyd0)

login:

After a while, the FPC and interfaces will come online

root> show interfaces terse | match ge-0/0/0
ge-0/0/0 up up

root> show chassis fpc
 Temp CPU Utilization (%) Memory Utilization (%)
Slot State (C) Total Interrupt DRAM (MB) Heap Buffer
 0 Online Absent 100 0 512 14 0

I’ll go ahead and add an IP address to ge-0/0/0. Note: if I was using the management interface I could configure interface FXP0 also now. Remember FXP0 will be bridged to the host eth0 adapter (or an adapter you specify).

root# set interfaces ge-0/0/0.0 family inet address 192.168.100.5/24

Can I ping anything?

root> ping 192.168.100.5
PING 192.168.100.5 (192.168.100.5): 56 data bytes
64 bytes from 192.168.100.5: icmp_seq=0 ttl=64 time=0.059 ms
^C
--- 192.168.100.5 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.059/0.059/0.059/0.000 ms

root> ping 192.168.100.254
PING 192.168.100.254 (192.168.100.254): 56 data bytes
^C
--- 192.168.100.254 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

OK, so I can ping the interface but nothing else on the host. As I’m using virtio I need to create a device binding between the host physical NIC and the vMX interface.

Creating a virtio binding

This is done in the config file config/vmx-junosdev.conf.

virtio bindings are flexible and can be used to map multiple vMX instances to the same physical host interface, or to connect vMX instances together.

A new Linux bridge will be created between host interface eth1 and ge-0/0/0 on vmx1.

##############################################################
#
#  vmx-junos-dev.conf
#  - Config file for junos device bindings.
#  - Uses YAML syntax.
#  - Leave a space after ":" to specify the parameter value.
#  - For physical NIC, set the 'type' as 'host_dev'
#  - For junos devices, set the 'type' as 'junos_dev' and
#    set the mandatory parameter 'vm-name' to the name of
#    the vPFE where the device exists
#  - For bridge devices, set the 'type' as 'bridge_dev'
#
##############################################################
interfaces :

     - link_name  : vmx_link
       endpoint_1 :
         - type        : junos_dev
           vm_name     : vmx1
           dev_name    : ge-0/0/0
       endpoint_2 :
         - type        : host_dev
           dev_name    : eth1

If eth1 is not already up on the Linux host, bring it up

sudo ifconfig eth1 up

Again the orchestration script vmx.sh is used to create the device bindings

mdinham@ubuntu:~/vmx-14.1R5.4-1$ sudo ./vmx.sh --bind-dev
Bind Link vmx_link(ge-0.0.0-vmx1, eth1)...........[OK]

And we can see a new bridge has been created called “vmx_link” as referenced in the bindings configuration file

mdinham@ubuntu:~/vmx-14.1R5.4-1$ brctl show
bridge name     bridge id               STP enabled     interfaces
br-ext          8000.000c2976a815       yes             br-ext-nic
                                                        eth0
                                                        vcp_ext-vmx1
                                                        vfp_ext-vmx1
br-int-vmx1             8000.52540050c859       yes             br-int-vmx1-nic
                                                        vcp_int-vmx1
                                                        vfp_int-vmx1
virbr0          8000.fe060a0efff1       yes             ge-0.0.1-vmx1
                                                        ge-0.0.2-vmx1
                                                        ge-0.0.3-vmx1
vmx_link                8000.000c2976a81f       no              eth1
                                                        ge-0.0.0-vmx1

Now to retry that ping!

mdinham@ubuntu:~/vmx-14.1R5.4-1$ ./vmx.sh --console vcp vmx1
--
Login Console Port For vcp-vmx1 - 8601
Press Ctrl-] to exit anytime
--
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


root> ping 192.168.100.254
PING 192.168.100.254 (192.168.100.254): 56 data bytes
64 bytes from 192.168.100.254: icmp_seq=0 ttl=64 time=4.951 ms
64 bytes from 192.168.100.254: icmp_seq=1 ttl=64 time=2.081 ms
^C
--- 192.168.100.254 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.081/3.516/4.951/1.435 ms

Success! At this point I’ve a working vMX with an interface mapped to a NIC on the Ubuntu host. What happens if I turn on OSPF and LDP?

root> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
192.168.100.254  ge-0/0/0.0             Full      10.0.0.2           1    37
192.168.100.1    ge-0/0/0.0             Full      10.0.0.1         128    39

root> show ldp neighbor
Address            Interface          Label space ID         Hold time
192.168.100.254    ge-0/0/0.0         10.0.0.2:0               13

Excellent, now the fun can really begin, but I’ll save that for another time!

vPFE

One last thing – what does the VFP look like?

mdinham@ubuntu:~/vmx-14.1R5.4-1$ sudo ./vmx.sh --console vfp vmx1
--
Login Console Port For vfp-vmx1 - 8602
Press Ctrl-] to exit anytime
--
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.


Wind River Linux 6.0.0.12 localhost console

localhost login: root
Password:
Last login: Sat Jul 18 12:20:49 UTC 2015 on console

The riot process is where all the magic happens!

top - 12:52:55 up 33 min,  1 user,  load average: 0.38, 0.74, 0.62
Tasks: 102 total,   1 running, 101 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.5%us,  2.1%sy,  0.0%ni, 96.8%id,  0.0%wa,  0.0%hi,  0.6%si,  0.0%st
Mem:   5824060k total,  4454308k used,  1369752k free,    12184k buffers
Swap:        0k total,        0k used,        0k free,    44552k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1019 root      20   0 36.6g  37m  10m S   12  0.7   4:25.04 riot
<snip>

Further reference

I hope you enjoyed this vMX post! For further reference on any of the above material please see the Juniper Release Notes for vMX