Академический Документы
Профессиональный Документы
Культура Документы
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/]
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]
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.
Value
Processors
2 processor cores
Memory
2048 MB
Network Adapter
Private to my Mac
jinstall-vmx-14.1R4.8-domestic.vmdk
CD/DVD (IDE)
Sound Card
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"
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
Verify.
$typevmrun
vmrunis/usr/local/bin/vmrun
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]
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
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
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
.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
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]
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.
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]
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
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
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
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
[https://dl.dropboxusercontent.com/u/1030586/blog/img2/juniper-vmnet2-cap.png]
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
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"
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
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
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]
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
[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
Top comments
1 Reply
Marc,
Can you out together something for windows PC. Atleast pieces that would be different for windows than Mac. Thanks in
Advance
1 Reply
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 shared this via Google+ 1 month ago - Shared publicly
+1
2
1 Reply
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