Вы находитесь на странице: 1из 19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

21st October Juniper Networks virtual MX Series router (vMX) with VMware Fusion

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmx-blog-header.png]

Disclaimer: The content of this post is intended for educational and/or informational purposes only.
The vMX router is a virtual version of the MX Series 3D Universal Edge Router. It's a full-featured router with complete control, forwarding and
management planes. It runs the Junos Operating System, so configuration and management of the vMX router is the same as its physical
counterpart.
The vMX software is currently only supported to run on the Linux operating system with the KVM [http://www.linux-kvm.org] hypervisor, but we
can alter vMX Release 14.1R4 to work with the VMware hypervisor.
Core components used for this guide:
Mac OS X 10.11 (El Capitan) [http://www.apple.com/osx]
VMware Fusion 8.0 Professional [http://www.vmware.com/products/fusion]
QEMU v2.4.0 [http://www.qemu.org]
Juniper Networks virtual MX Series router (vMX) - Junos OS Release 14.1R4 [https://www.juniper.net/us/en/products-services/routing/mxseries/vmx/]

Disk Image Conversion


The qemu-img command is required to convert the disk image from the default qcow2 (QEMU) format to the vmdk (VMware) format. There are
a variety of ways to get and install QEMU, but we will use the MacPorts [http://www.macports.org] method.

01. Get and install the Command Line Developer Tools for OS X El Capitan.
$xcodeselectinstall
xcodeselect:note:installrequestedforcommandlinedevelopertools

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

1/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/mac-cli-tools-prompt-install-elcap.png]

02. Download and install MacPorts


From your web browser, navigate to the MacPorts Project [http://www.macports.org] website.
Click the Download button in the top-right corner.
Click the OS X 10.11 El Capitan link to download the installer package.
From Finder, open the MacPorts installer package and select the defaults for the installation.

03. Get and install QEMU via MacPorts.


$sudoportvinstallqemu

04. Convert and verify the disk image.

Let's first verify the untouched disk image format.


$qemuimginfojinstallvmx14.1R4.8domestic.img|grepfile.format
fileformat:qcow2

A consistency check is also recommended before we convert the disk image.


$qemuimgcheckjinstallvmx14.1R4.8domestic.img
Noerrorswerefoundontheimage.
9820/327576=3.00%allocated,0.00%fragmented,0.00%compressedclusters
Imageendoffset:645660672

Convert the disk image.


$qemuimgconvertpOvmdkjinstallvmx14.1R4.8domestic.imgjinstallvmx14.1R4.8domestic.vmdk

Finally, verify the converted disk image format.


$qemuimginfojinstallvmx14.1R4.8domestic.vmdk|grepfile.format
fileformat:vmdk

Juniper vMX Virtual Appliance Template


05. Create the Juniper vMX virtual appliance template (GUI).
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

2/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

We will initially create (and modify) the vMX template with the VMware Fusion GUI, but we will finish the process by directly modifying the
VMware virtual machine configuration (.vmx) file.
Click File -> New... from the VMware Fusion menu bar.
Select the Create a custom virtual machine option.
Click the Continue button.
Select FreeBSD (Other -> FreeBSD) as the operating system.
Click the Continue button.
Select Use an existing virtual disk.
Click the Choose virtual disk... button.
Navigate to and select jinstall-vmx-14.1R4.8-domestic.vmdk.
Select Make a separate copy of the virtual disk.
Click the Choose button.
Click the Continue button.
Click the Customize Settings button to modify the virtual appliance settings.
Save As: t-vMX
Click the Save button.

06. Modify/Verify the following attributes in the t-VMX Settings:


Component

Value

Processors

2 processor cores

Memory

2048 MB

Network Adapter

Private to my Mac

Hard Disk (IDE)

jinstall-vmx-14.1R4.8-domestic.vmdk

CD/DVD (IDE)

Remove CD/DVD Drive

Sound Card

Remove Sound Card

USB & Bluetooth

Remove USB Controller

07. Close the VMware Fusion application.


08. Add network adapters and also a serial port (for management via console connection).

Append three additional network adapters and a serial port device to the virtual appliance template. Use a text editor (e.g., vim or nano) to edit
the t-vMX.vmx file.
$vim$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx

.encoding="UTF8"
config.version="8"
virtualHW.version="12"
memsize="2048"
ide0:0.present="TRUE"
ide0:0.fileName="jinstallvmx14.1R4.8domestic.vmdk"
ethernet0.present="TRUE"
ethernet0.connectionType="hostonly"
ethernet0.virtualDev="e1000"
ethernet0.wakeOnPcktRcv="FALSE"
ethernet0.addressType="generated"
ethernet0.linkStatePropagation.enable="FALSE"
ethernet1.present="TRUE"
ethernet1.connectionType="hostonly"
ethernet1.virtualDev="e1000"
ethernet1.wakeOnPcktRcv="FALSE"
ethernet1.addressType="generated"
ethernet1.linkStatePropagation.enable="FALSE"
ethernet2.present="TRUE"
ethernet2.connectionType="hostonly"
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

3/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

ethernet2.virtualDev="e1000"
ethernet2.wakeOnPcktRcv="FALSE"
ethernet2.addressType="generated"
ethernet2.linkStatePropagation.enable="FALSE"
ethernet3.present="TRUE"
ethernet3.connectionType="hostonly"
ethernet3.virtualDev="e1000"
ethernet3.wakeOnPcktRcv="FALSE"
ethernet3.addressType="generated"
ethernet3.linkStatePropagation.enable="FALSE"
usb.present="FALSE"
pciBridge0.present="TRUE"
pciBridge4.present="TRUE"
pciBridge4.virtualDev="pcieRootPort"
pciBridge4.functions="8"
pciBridge5.present="TRUE"
pciBridge5.virtualDev="pcieRootPort"
pciBridge5.functions="8"
pciBridge6.present="TRUE"
pciBridge6.virtualDev="pcieRootPort"
pciBridge6.functions="8"
pciBridge7.present="TRUE"
pciBridge7.virtualDev="pcieRootPort"
pciBridge7.functions="8"
vmci0.present="TRUE"
hpet0.present="TRUE"
tools.syncTime="TRUE"
displayName="tvMX"
guestOS="freebsd"
nvram="tvMX.nvram"
virtualHW.productCompatibility="hosted"
tools.upgrade.policy="upgradeAtPowerCycle"
powerType.powerOff="soft"
powerType.powerOn="soft"
powerType.suspend="soft"
powerType.reset="soft"
extendedConfigFile="tvMX.vmxf"
ehci:0.parent="1"
ehci:0.port="0"
ehci:0.deviceType="video"
ehci:0.present="TRUE"
numvcpus="2"
ehci.present="FALSE"
sound.present="FALSE"
ide1:0.present="FALSE"
floppy0.present="FALSE"
serial0.present="TRUE"
serial0.yieldOnMsrRead="TRUE"
serial0.fileType="network"
serial0.fileName="telnet://127.0.0.1:52099"

Verify the device components have been added to the configuration file.
$egrep'(ethernet[13]|serial0)\.present'$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx
ethernet1.present="TRUE"
ethernet2.present="TRUE"
ethernet3.present="TRUE"
serial0.present="TRUE"

09. Create a symbolic link for the vmrun command.

The vmrun tool allows us to control VMware virtual machines from the command line. The tool is located inside the VMware Fusion application
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

4/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

bundle which is not included in our PATH by default. I'd rather not have to enter the absolute path each time for use, so a simple method to
remedy this is to create a symbolic link.
Is the target directory contained in our PATH environment variable?
$printf"${PATH//:/\n}"|grep/usr/local/bin
/usr/local/bin

Create the symbolic link.


$sudolns/Applications/VMware\Fusion.app/Contents/Library/vmrun/usr/local/bin/vmrun

Verify.
$typevmrun
vmrunis/usr/local/bin/vmrun

10. Start the t-vMX virtual appliance.

Verify no virtual machines are in the running state.


$vmrunlist
TotalrunningVMs:0

Start the t-vMX virtual appliance .


$vmrunstart$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmxnogui

The t-vMX virtual appliance should be in the running state.


$vmrunlist
TotalrunningVMs:1
/Users/<username>/Documents/VirtualMachines.localized/tvMX.vmwarevm/tvMX.vmx

11. Establish a console connection (via telnet) to the t-vMX virtual appliance.
Open a separate terminal window (or tab) and enter the following command:
$telnet127.0.0.152099

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

5/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmx-blog-tvmx-boot.png]

12. "Collapse" vRE and vPFE for an "all-in-one" VM.

If you reference the Juniper vMX documentation, you may notice two VMs (VCP and VFP) are required for each logical vMX 14.1R5 (and later)
instance. For the vMX 14.1R4 releases, Juniper offered a configuration option to allow the integration of a local virtual Packet Forwarding
Engine (PFE), for test and lab purposes, on the RE VM. We can enable it with the following steps:
...
Amnesiac(ttyd0)
login:root
root@%clear
root@%echo'vm_local_rpio="1"'>>/boot/loader.conf
root@%greprpio/boot/loader.conf
vm_local_rpio="1"
root@%reboot

13. Wait for FPC to come online.

It could take several minutes for this operation to complete after presented with the login prompt. We can observe this with the top command
from the FreeBSD shell. The riot and vmxt processes will monopolize the CPU but will gradually drop when the FPC comes online. Syslog error
messages may also be displayed in the console output to signal the FPC is online.
...
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

6/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

Amnesiac(ttyd0)
login:root
root@%clear
root@%topocpu

lastpid:2854;loadaverages:2.44,1.04,0.41up0+00:02:2616:32:22
390processes:5running,385sleeping
CPUstates:19.1%user,0.0%nice,78.6%system,2.3%interrupt,0.0%idle
Mem:512MActive,97MInact,69MWired,470MCache,69MBuf,846MFree
Swap:6756MTotal,6756MFree
PIDUSERNAMETHRPRINICESIZERESSTATETIMEWCPUCOMMAND
2346root3231000574M21024Kucond0:2851.15%riot
2842root140571M48636Ksbwait0:2242.45%vmxt
2282root196050600K9416Kselect0:020.00%dcd
2286root1103040268K30232Kselect0:000.00%mgd
2851root196023480K2856KRUN0:000.00%top
2287root196021092K10820Kselect0:000.00%snmpd
2289root14093408K17756Kkqread0:000.00%rpd
2288root196067752K11416Kselect0:000.00%mib2d
2321root196032764K21440Kselect0:000.00%smid
2301root196059736K17092Kselect0:000.00%dfwd
2336root196042988K6392Kselect0:000.00%idpd
2283root1960117M11780Kselect0:000.00%chassisd
2296root196050376K10716KRUN0:000.00%cosd
2294root196047664K10168Kselect0:000.00%pfed
2311root14016524K8716Kkqread0:000.00%l2cpd
2290root196021596K8692Kselect0:000.00%l2ald
2328root1960112M5344KRUN0:000.00%transportd

Press the Q key to exit top.

14. Verification commands...


root@%cli
root>showchassisfpcpicstatus
Slot0OnlineVirtualFPC
PIC0OnlineVirtual10x1GEPIC

root>showchassishardware
Hardwareinventory:
ItemVersionPartnumberSerialnumberDescription
ChassisVM56129109BCVMX
Midplane
RoutingEngineREVMX
CB0VMXSCB
FPC0VirtualFPC
CPURev.1.0RIOT123XYZ987
MIC0Virtual10x1GEPIC
PIC0BUILTINBUILTINVirtual10x1GEPIC

root>showinterfacesge*terse
InterfaceAdminLinkProtoLocalRemote
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

7/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

ge0/0/0upup
ge0/0/1upup
ge0/0/2upup
ge0/0/3upup
ge0/0/4upup
ge0/0/5upup
ge0/0/6upup
ge0/0/7upup
ge0/0/8upup
ge0/0/9upup

15. Stop the t-vMX virtual appliance.


From the original terminal window (or tab), we will stop the virtual appliance.
$vmrunstop$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx

16. Remove ethernetX.generatedAddress statements.


Since we will clone from this template, we need to make sure unique MAC addresses are generated for each network adapter (interface), with
each new instance.
$sedi.orig'/generatedAddress/d'$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx

Network Interface Mapping


The vMX is slightly different than other virtual appliances in regards to the network interface layout. The first network interface is identified as
the management interface (fxp0), but the second network interface (em1) is dedicated for internal communication between the vRE and vPFE.
The third network interface (em2) is actually the first network interface available for transit traffic use.
VMware (GUI)

.vmx

emX

ge-0/0/X

Purpose

Network Adapter

ethernet0

fxp0

mgmt

Network Adapter 2

ethernet1

em1

internal

Network Adapter 3

ethernet2

em2

ge-0/0/0

transit

Network Adapter 4

ethernet3

em3

ge-0/0/1

transit

Network Adapter 5

ethernet4

em4

ge-0/0/2

transit

Network Adapter 6

ethernet5

em5

ge-0/0/3

transit

Network Adapter 7

ethernet6

em6

ge-0/0/4

transit

Network Adapter 8

ethernet7

em7

ge-0/0/5

transit

Network Adapter 9

ethernet8

em8

ge-0/0/6

transit

Network Adapter 10

ethernet9

em9

ge-0/0/7

transit

Topology and Lab


The vMX template has been created, and we now understand the network interface mapping. Let's put this into practice by constructing a
simple topology and implementation of an OSPF lab.

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

8/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmx-blog-ospf-lab.png]

17. Identify the management network (vmnet).


If a virtual device's management interface requires Internet connectivity, we should bind it to vmnet8 (Share with my Mac). Otherwise, we can
bind the management interface to vmnet1 (Private to my Mac). The management interfaces, on our routers, don't require Internet connectivity,
so we will use vmnet1. Now the question is: What addresses are available to use for our router management interfaces?
Does vmnet1 have DHCP enabled? Is the host network adapter enabled for the vmnet?
$grepVNET_1_/Library/Preferences/VMware\Fusion/networking
answerVNET_1_DHCPyes
answerVNET_1_DHCP_CFG_HASHF17DB75D9B127518EAAB805568DA4603B51DA1D6
answerVNET_1_HOSTONLY_NETMASK255.255.255.0
answerVNET_1_HOSTONLY_SUBNET172.16.1.0
answerVNET_1_VIRTUAL_ADAPTERyes

We will want to exclude the DHCP scope address range to avoid possible conflict.
$grepA2subnet/Library/Preferences/VMware\Fusion/vmnet1/dhcpd.conf
subnet172.16.1.0netmask255.255.255.0{
range172.16.1.128172.16.1.254;
optionbroadcastaddress172.16.1.255;

The lowest host octet number (.1) is normally reserved for the vmnet host network adapter. We can verify this with the following command:
$grepfixedaddress/Library/Preferences/VMware\Fusion/vmnet1/dhcpd.conf
fixedaddress172.16.1.1;

From the output, we can conclude 172.16.1.[2-127] is available. For my example, I have selected 172.16.1.11 for R1 and 172.16.1.12 for R2.

18. Create the "point-to-point" vmnet link(s).


Open VMware Fusion Preferences.
Select the Network tab.
Uncheck Require authentication to enter promiscuous mode.
Click the + button to add a custom vmnet.
Uncheck Allow virtual machines on this network to connect to external networks (using NAT).
Uncheck Connect the host Mac to this network.
Uncheck Provide addresses on this network via DHCP.
Click the Apply button to save the changes.

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

9/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmf-network-pref-vmnet2.png]

19. Close the VMware Fusion application.


20. Create R1 instance (full clone of t-vMX).
$vmrunclone$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx$HOME/Documents/Virtual\Machi
nes.localized/R1.vmwarevm/R1.vmxfullcloneName=R1

21. Change the serial (telnet) port number from the template's 52099 to 52001.
$sedi.orig's/52099/52001/'$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx

Verify the modification.


$grepserial0.fileName$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx
serial0.fileName="telnet://127.0.0.1:52001"

22. Bind ethernet2 to vmnet2.

Since the R1 instance is cloned from t-vMX, all the virtual network adapters are currently set to the default hostonly vmnet. Note that hostonly
is technically an alias for vmnet1.
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

10/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

$egrep'ethernet.\.(conn|vnet)'$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx
ethernet0.connectionType="hostonly"
ethernet1.connectionType="hostonly"
ethernet2.connectionType="hostonly"
ethernet3.connectionType="hostonly"

We will keep ethernet0 (fxp0), ethernet1 (internal), and ethernet3 (ge-0/0/1) at the default. We do need to set ethernet2 (ge-0/0/0) to the
isolated vmnet2, though.
$sedi.orig's/\(ethernet2.connectionType*=*\).*/\1"custom"/'$HOME/Documents/Virtual\Machines.localized/R1.
vmwarevm/R1.vmx
$printf'ethernet2.vnet="vmnet2"\n'>>$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx

Verify the modification.


$egrep'ethernet.\.(conn|vnet)'$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx
ethernet0.connectionType="hostonly"
ethernet1.connectionType="hostonly"
ethernet2.connectionType="custom"
ethernet3.connectionType="hostonly"
ethernet2.vnet="vmnet2"

23. Start R1.


$vmrunstart$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmxnogui

24. Establish a console connection (via telnet) to R1.


Open a separate terminal window (or tab) and enter the following command:
$telnet127.0.0.152001

25. Wait for FPC to come online.


Refer back to Steps 13 and 14 for more information.

26. Set the root login password and configure the management interface.
root@%cli
root>conf
Enteringconfigurationmode
[edit]
root#setsystemrootauthenticationplaintextpassword
Newpassword:P@ssW0Rd!
Retypenewpassword:P@ssW0Rd!
[edit]
root#setinterfacesfxp0.0familyinetaddr172.16.1.11/24
[edit]
root#setsystemservicessshrootloginallow
[edit]
root#commit
commitcomplete
[edit]
root#runshinterfacesterse|matchfxp0
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

11/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

fxp0upup
fxp0.0upupinet172.16.1.11/24

27. Test R1 management access (via SSH) from the host Mac.
Open a separate terminal window (or tab) and enter the following commands:
$sshroot@172.16.1.11
Theauthenticityofhost'172.16.1.11(172.16.1.11)'can'tbeestablished.
ECDSAkeyfingerprintisSHA256:<hash_value>.
Areyousureyouwanttocontinueconnecting(yes/no)?yes
Warning:Permanentlyadded'172.16.1.11'(ECDSA)tothelistofknownhosts.
Password:P@ssW0Rd!
JUNOS14.1R4.8built2015012803:38:12UTC
root@R1%w
11:14AMup16:21,2users,loadaverages:1.25,2.76,1.70
USERTTYFROMLOGIN@IDLEWHAT
rootd09:57AM1:16cli
rootp0172.16.1.111:07AMw
rootroot@R1%exit
logout
Connectionto172.16.1.11closed.

We will continue the rest of the configuration from the original console connection terminal window (or tab).

28. Set the hostname and configure the other physical and logical interfaces.

If you refer back to the Network Interface Mapping section, you will notice we need to link ge-0/0/0 to em2. This can be accomplished by
hardcoding the em2 MAC address to the ge-0/0/0 interface.
[edit]
root#setsystemhostnameR1
[edit]
root#runshowinterfacesem2|matchhard
Currentaddress:00:0c:29:b8:f5:a1,Hardwareaddress:00:0c:29:b8:f5:a1
[edit]
root#setinterfacesge0/0/0mac00:0c:29:b8:f5:a1
[edit]
root#setinterfacesge0/0/0.0familyinetaddress10.0.12.1/24
[edit]
root#setprotocolslldpinterfacege0/0/0
[edit]
root#setinterfaceslo0unit0familyinetaddress1.1.1.1/32

29. Configure OSPF.


[edit]
root#setroutingoptionsrouterid1.1.1.1
[edit]
root#editprotocols
[editprotocols]
root#setospfarea0.0.0.0interfacelo0.0passive

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

12/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[editprotocols]
root#setospfarea0.0.0.0interfacege0/0/0.0interfacetypep2p
[editprotocols]
root#commitandquit
commitcomplete
Exitingconfigurationmode

30. (Optional) Start a packet capture with Wireshark.


With help from the vmnet-shark [https://gist.github.com/mweisel/2de7e8e52e52ef4eb39a] tool, we can start a packet capture on the vmnet2 link.
$vmnetsharkvmnet2

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmnet2-cap.png]

31. Create R2 instance (full clone of t-vMX).


$vmrunclone$HOME/Documents/Virtual\Machines.localized/tvMX.vmwarevm/tvMX.vmx$HOME/Documents/Virtual\Machi
nes.localized/R2.vmwarevm/R2.vmxfullcloneName=R2

32. Change the serial (telnet) port number from the template's 52099 to 52002.
$sedi.orig's/52099/52002/'$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx

Verify the modification.


http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

13/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

$grepserial0.fileName$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx
serial0.fileName="telnet://127.0.0.1:52002"

33. Bind ethernet2 to vmnet2.


Verify the default configuration.
$egrep'ethernet.\.(conn|vnet)'$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx
ethernet0.connectionType="hostonly"
ethernet1.connectionType="hostonly"
ethernet2.connectionType="hostonly"
ethernet3.connectionType="hostonly"

Modify.
$sedi.orig's/\(ethernet2.connectionType*=*\).*/\1"custom"/'$HOME/Documents/Virtual\Machines.localized/R2.
vmwarevm/R2.vmx
$printf'ethernet2.vnet="vmnet2"\n'>>$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx

Verify the modification.


$egrep'ethernet.\.(conn|vnet)'$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx
ethernet0.connectionType="hostonly"
ethernet1.connectionType="hostonly"
ethernet2.connectionType="custom"
ethernet3.connectionType="hostonly"
ethernet2.vnet="vmnet2"

34. Start R2.


$vmrunstart$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmxnogui

35. Establish a console connection (via telnet) to R2.


Open a separate terminal window (or tab) and enter the following command:
$telnet127.0.0.152002

36. Wait for FPC to come online.


Refer back to Steps 13 and 14 for more information.

37. Set the root login password and configure the management interface.
root@%cli
root>conf
Enteringconfigurationmode
[edit]
root#setsystemrootauthenticationplaintextpassword
Newpassword:P@ssW0Rd!
Retypenewpassword:P@ssW0Rd!
[edit]
root#setinterfacesfxp0.0familyinetaddr172.16.1.12/24
[edit]
root#setsystemservicessshrootloginallow
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

14/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

[edit]
root#commit
commitcomplete
[edit]
root#runshinterfacesterse|matchfxp0
fxp0upup
fxp0.0upupinet172.16.1.12/24

38. Set the hostname and configure the other physical and logical interfaces.

If you refer back to the Network Interface Mapping section, you will notice we need to link ge-0/0/0 to em2. Again, this can be accomplished by
hardcoding the em2 MAC address to the ge-0/0/0 interface.
[edit]
root#setsystemhostnameR2
[edit]
root#runshowinterfacesem2|matchhard
Currentaddress:00:0c:29:d6:bc:81,Hardwareaddress:00:0c:29:d6:bc:81
[edit]
root#setinterfacesge0/0/0mac00:0c:29:d6:bc:81
[edit]
root#setinterfacesge0/0/0.0familyinetaddress10.0.12.2/24
[edit]
root#setprotocolslldpinterfacege0/0/0
[edit]
root#setinterfaceslo0unit0familyinetaddress2.2.2.2/32

39. Configure OSPF.


[edit]
root#setroutingoptionsrouterid2.2.2.2
[edit]
root#editprotocols
[editprotocols]
root#setospfarea0.0.0.0interfacelo0.0passive
[editprotocols]
root#setospfarea0.0.0.0interfacege0/0/0.0interfacetypep2p
[editprotocols]
root#commitandquit
commitcomplete
Exitingconfigurationmode

40. Verify basic connectivity and OSPF.


root@R2>showlldpneighbors
LocalInterfaceParentInterfaceChassisIdPortinfoSystemName
ge0/0/000:05:86:71:ca:c0513R1
root@R2>showospfneighbor
AddressInterfaceStateIDPriDead
10.0.12.1ge0/0/0.0Full1.1.1.112839
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

15/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

root@R2>showospfdatabase
OSPFdatabase,Area0.0.0.0
TypeIDAdvRtrSeqAgeOptCksumLen
Router1.1.1.11.1.1.10x8000001e23170x220x13a160
Router*2.2.2.22.2.2.20x8000001b23150x220x3b7360
root@R2>showospfroute
TopologydefaultRouteTable:
PrefixPathRouteNHMetricNextHopNexthop
TypeTypeTypeInterfaceAddress/LSP
1.1.1.1IntraRouterIP1ge0/0/0.010.0.12.1
1.1.1.1/32IntraNetworkIP1ge0/0/0.010.0.12.1
2.2.2.2/32IntraNetworkIP0lo0.0
10.0.12.0/24IntraNetworkIP1ge0/0/0.0
root@R2>ping1.1.1.1source2.2.2.2rapid
PING1.1.1.1(1.1.1.1):56databytes
!!!!!
1.1.1.1pingstatistics
5packetstransmitted,5packetsreceived,0%packetloss
roundtripmin/avg/max/stddev=1.040/1.903/3.724/0.985ms
root@R2>monitorinterfacege0/0/0

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-r2-mon-int.png]

41. Suspend the virtual devices when done "labbing".


List the VMware virtual devices in the running state.
$vmrunlist
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

16/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

TotalrunningVMs:2
/Users/<username>/Documents/VirtualMachines.localized/R1.vmwarevm/R1.vmx
/Users/<username>/Documents/VirtualMachines.localized/R2.vmwarevm/R2.vmx

Put them into the suspend state.


$vmrunsuspend$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmx
$vmrunsuspend$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmx

Bring them out of the suspend state when ready to continue.


$vmrunstart$HOME/Documents/Virtual\Machines.localized/R1.vmwarevm/R1.vmxnogui
$vmrunstart$HOME/Documents/Virtual\Machines.localized/R2.vmwarevm/R2.vmxnogui

Scratching the Surface


If you've gotten this far into the post, you may be asking the question: Why are we doing most of the steps from the command line?
Answer: Because I'm too lazy to include the equivalent GUI screenshots...just kidding...sort of :)
The simple answer is I wanted to provide you with some of the fundamental commands I use (in shell scripts) to construct virtual topologies
with VMware Fusion. I hope it gives you a teaser for further exploration.

[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-evpn-top.png]

Reference: Juniper vMX (Virtual MX) Router in VMWare ESXi 5.5 [https://ivorde.com/juniper-vmx-virtual-mx-router-in-vmware-esxi-5-5]
Posted 21st October by Marc Weisel
Labels: Juniper, Mac, VMware
9

View comments

9 comments
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

17/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

9 comments

Add a comment as Rio Ardian

Top comments

Calvin Christopher 2 weeks ago - Shared publicly


Fantastically thorough write-up Marc, though I must say that using VIRL at this point is much easier ;D
+1
2

1 Reply

Marc Weisel 2 weeks ago


Thanks Calvin. VIRL is a good solution if you don't mind the overhead of a separate OS and nested virtualization -- this is
assuming you're not running it on "bare metal".
I still stick with VMware because I can run everything VIRL (KVM) can, and more, without the resource overhead. It's pretty

Parth kumar choudhary 3 days ago - Shared publicly

Marc,
Can you out together something for windows PC. Atleast pieces that would be different for windows than Mac. Thanks in
Advance
1 Reply

Marc Weisel 2 days ago


VMware Workstation and Fusion Pro are very similar, so you should have no problem following the guide to replicate the
results. Just swap the other tools/commands:
QEMU -> QEMU for Windows
vim -> Notepad

J G 1 week ago - Shared publicly

Very
nice write up!
Any word on a way to make 15.1 release to work in 'all in one' with combined RE/vPFE in the same instance?
I tried it, and it appears to just ignore the vm_local_rpio="1" parameter...
-J
1 Reply

Marc Weisel 1 week ago (edited)


Thanks J G. I haven't tried 15.1 yet, but I encountered the same result with 14.1R5 and 14.2 not recognizing the statement.
Odd that Juniper would strip that feature out considering it's ideal for testing with an integrated lightweight data plane.

Marc Weisel shared this via Google+ 1 month ago - Shared publicly
+1
2

1 Reply

Iwan Hoogendoorn 1 week ago


Great post Marc!
You have some shell script examples that you can share when you fire up a complete lab?
Marc Weisel 1 week ago
+Iwan HoogendoornThanks for the feedback, Iwan. The automation scripts are in a pretty raw state as I'm currently
http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

18/19

11/24/2015

JuniperNetworksvirtualMXSeriesrouter(vMX)withVMwareFusion

porting the logic solely in Vagrant. I do plan to release a tutorial in the near future.

http://binarynature.blogspot.co.id/2015/10/junipernetworksvmxwithvmwarefusion.html

19/19

Вам также может понравиться