This article explain you how to emulate Juniper JunOS on a PC using Qemu. This is an updated and enhanced version of excellent howtos from Juniper Clue and Internetwork Pro as well asHimawan Nugroho’s blog. I mainly focused on Qemu, so if you wish to install JunOS on a real PC or using VMware, please have a look at the Juniper Clue article for more information (and of course Google).
So what’s new you would say? First, I chose to use the latest version of Qemu: the 0.11.0 which supports the Intel e1000 network card emulation since version 0.10.0. and includes several fixes for it. I have modified and adapted the old patch for Qemu 0.11.0, it includes the UDP tunnel (connection to Dynamips/GNS3), PCAP and LCAP support. Also, the patch allows multicast traffic with the e1000, i82557b and i82559er Qemu emulated network cards. Moreover, this article show how to emulate JunOS on multiple operating systems: Mac OS X, Windows XP and Linux Ubuntu 9.04 without using an untrustworthy obscure binary downloaded from a forum you can’t even read the language
Please note that JunOS is not provided and will not be. So please don’t ask. Also, I do not take any responsibility on what happen on your PC, keep in mind this howto requires some patience and that is not for complete beginners. Moreover, this howto doesn’t necessarily present the best and/or easiest way to emulate JunOS. This is the cleanest and less intrusive for me but please feel free to give me constructive comments and tell what worked or didn’t worked for you.
Requirements
- JunOS runs on top of FreeBSD. So you need to download the mini installation ISO, version >= 4.5 because earlier versions don’t support the Intel e1000 interface (em driver). Personally, I used the FreeBSD 4.11 mini-inst ISO but you could use FreeBSD 6 or 7.
- JunOS itself. If you are smart and patient you will find it. I used jinstall-8.5R1.14-domestic-signed.tgz for my installations.
- Qemu source code. Again, I used Qemu 0.11.0. You can choose to download it later with wget (I’ll show you how).
- Download OpenVPN to create TAP interfaces (Windows only, optional).
- More stuff whether you compile Qemu on Mac OS X, Windows or Linux.
Qemu compilation and patching on Mac OS X
Qemu compilation and patching on Windows
- Download MinGW and install it (choose custom installation with g++ and make included). The file I downloaded was MinGW-5.1.6.exe
- Download MSYS and install it, answer yes to post-installation questions and put the correct path to MinGW directory (should be C:\MinGW). The file I downloaded was MSYS-1.0.11.exe.
- Download , zlib, SDL, MSYS coreutils into your MSYS home directory (e.g. c:\Msys\public\username). I downloaded zlib-1.2.3.tar.gz, SDL-1.2.14.tar.gz and coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2. MSYS coreutils is necessary because Qemu signrom.sh uses tools such as dd, od, expr, cp and printf which are included in coreutils.
- Download and install Winpcap Developer Pack: extract the contents of \lib and \include folders into \lib and \include folders of your MinGW installation location (should be C:\MinGW\lib and C:\MinGW\include)
- Start MSYS.
- Compile and install zlib:
- Compile and install SDL
- Install coreutils
Qemu acceleration
- Download Kqemu.
- Unzip it.
- Locate kqemu.inf and install it (right-click and select Install). In Windows Vista, install Kqemu using the CMD prompt and this command: rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 kqemu.inf
- Start Kqemu from the CMD prompt: net start kqemu
- Install kqemu with: sudo apt-get install kqemu-source
- If you do not want to use sudo each time you start Qemu, give the permissions to /dev/qemu with the following command: sudo chmod o+rw /dev/kqemu
Related Articles
0 comments:
Post a Comment