You are here: Home
Many times when working with a client network or working on our own we have the need to test, document and validate certain networks configurations in a test environment. Sadly not many have the money to have one so as to test different scenarios so as to gage the impact that this changes might have on the production network. For a majority of configuration when it comes to system settings and routing a virtualized environment can be of great help, sadly anything ASIC or HW Specific configurations. On this wiki page I will cover how to virtualize JunOS operating system to aide with testing and validating. I did this for a friend who needed to migrate the configuration of several of his Juniper Routers to a newer version of the OS and Hardware and also asked me for recommendations for hardening the routers. I do have to say I really like JunOS specially since it is a full FreeBSD subsystem underneath to wish a user has access to.
Most of this information is a rip from Other Sites so keep that in mind as you read through this.
Software required to install JunOS on VMware:
NOTE: Do not ask for Juniper images I will ignore those messages. You need a valid contract to obtain them.
On VMware Workstation: Create a New Virtual Machine.
Select on the image the FreeBSD ISO image.
Ensure that FreeBSD is selected as the operating system type.
Make sure HDD is 4GB or higher and of type IDE for version 9.x and 10.x for version 11.x use 6GB or higher.
For memory set initially 512MB for 9.x and after installation of jweb it can be changed to 256MB, for 10.x and 11.x set initial value to 1024MB and after install 512MB.
After creation of VM and before installation open VMX file and sure that the SCSI devises presence settings be set to FALSE: scsi0.present = "FALSE"
Create a New Virtual Machine with Operating System Other -> FreeBSD 32-bits.
Make sure HDD is 4GB or higher and of type IDE for version 9.x and 10.x for version 11.x use 6GB or higher.
"Select the Edit Virtual Machine Settings Before Completion" Check Box.
Change the SCSI Controller to LSI Logic SAS.
For memory set initially 512MB for 9.x and after installation of jweb it can be changed to 256MB, for 10.x and 11.x set initial value to 1024MB and after install 512MB.
Set in the CD Rom the FreeBSD 4.11 ISO and make sure that it is Connected before saving.
Skip the kernel configuration and choose the standard installation. When prompted to use fdisk select OK. When you get to partitioning, allocate first the whole disk to BSD. Press c then OK for the other prompts and finish by selecting q. Select BootMrg as the boot manager. Create the disk slices as shown in the table below:
Slice | Name | Size |
---|---|---|
ad0s1a | / | 2G |
ad0s1b | swap | 1G |
ad0s1e | /config | 80M |
ad0s1f | /var | rest of the disk |
/ has to be a reasonable size or else you'll run out of space on /mnt. Choose 'Minimal' installation type and skip installing ports. After the base is installed it will ask you if you want to configure Ethernet settings, select yes and use DHCP to configure your NIC (em0), Write down the IP given by DHCP and set a Hostname for the server. This allow us to scp the jinstall file after reboot. Except for the DHCP on interface em0, choose "no" for everything else (IPv6. Linux compatibility, NFS, FTP, Inetd, TimeZone etc..) When asked to create a user create one called junos, set a password for it and add it to the group wheel. Ensure to put a password for the root account. After the installer completes it will reboot. Make sure that you have disconnected the CD so as to make sure the VM will not boot in to the CD again. scp to /var/tmp on the VM the jinstall file only, do not copy the jweb file yet since during installation the file system will be formatted and changed.
Once the file is there yo will SSH in to the server and use the su command to gain root privileges:
Unpack the different parts of the installer and remove hash files used to validate the installer:
Make sure that check for hardware always return true by replacing the checkpic command:
DO NOT REBOOT, Ensure you can interact with JunOS on the VM Console:
Add this line to the file:
Reboot the device by entering the reboot command, the installation process will take several minutes and the router will reboot twice.
This process is the same for 10.x and 11.x. Unpack the different parts of the installer and remove hash files used to validate the installer:
Open in vi the +INSTALL file
Modify the variable re_name in the check_arch_compatibility() function as shown bellow, inside vi you can do a :/check_arch to go directly to it.
Continue unpacking the next level of the package:
Open with vi +INSTALL and +REQUIRE and modify the variable re_name in the check_arch_compatibility() as done before. Unpack the pkgtools.tgz file and make the checkpic file always return true:
Ensure you can interact with JunOS on the VM Console, there is no need for this step with version 10.4 but recommended in case there is a change in any other 10.x package:
Add this line to the file:
Reboot the device by entering the reboot command, the installation process will take several minutes and the router will reboot twice.
Initial Configuration
On the console at login enter root and enter on the password prompt. Enter cli to enter in to command line interface of JunOS and enter:
Set the hostname for the router:
Set the root password:
Create a secondary admin user to use for SSH:
Set an IP Address on the interface em0 so as to connect to the router:
Enable and set the SSH Version of the protocol to use to version 2:
Enable Telnet:
Enable FTPD:
Set the default gateway:
Set the DNS Server to use:
Save the configuration:
To get full list of software installed and version without paging:
To get full configuration:
To get full configuration in XML format:
Copy to the router the jweb file using scp and the secondary admin account created above:
SSH in to the router and run:
After installer finishes execute a reboot of the router
It will take a while for the router to reboot since it is setting up the files for the web interface. Once the router is back up connect to it, enter configuration mode and enable the the web management system on the interface you configured: