Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
7 Lion with
Parallels Desktop 7 or VirtualBox 4.1.2
Johan Havermans
September 22 2011 (version 201110oct24_22
DRAFT)
Getting GNS3 to work at on your Mac is pretty straightforward. Download the GNS3 package for OS X and run. But if you want to connect
a GNS3 virtual network to one or more Virtual Machine(s) running either in Parallels Desktop, VirtualBox of VMware1 things get a bit uglier
and complicated, but it is possible. Since I prefer to document what
I do and my current document system is Mac only, I really wanted
GNS3 to work on Mac OS X.
In this note I try to give a brief description of what I did to make this
happen on Mac OS X 10.7 Lion. You will see how to:
. install a (tap)driver that allows the creation of virtual network cards
on OS X Lion,
. run GNS3 on Mac OS X Lion so it can dynamically create virtual
network cards,
. connect virtual machines running in Parallels Desktop 7 or VirtualBox 4 to your virtualized network,
. install a protocol analyzer called Wireshark that you can use on your
Mac and in your virtualized GNS3 network,
. connect your virtualized network to a real network including the
internet and make your virtualized network accessible from your
Mac and vice versa.
Copyright notice
You may freely distribute, use and modify this note as long as you
mention my name when you refer or use this note in one piece or use
parts of this note.
You may freely distribute, use and modify my scripts that are mentioned in this note as long as you mention my name when you refer or
use it as a whole or use parts of it.
If you modify the scripts and you think others can also be helped
with your modifications, please notify me so I can update the scripts.
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
VM = virtual machine
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
Contents
Who am I and why do I need this stuff?
Copyright notice
Step 6: Make a project in GNS3 - Launch GNS3 via the 1gns.sh script
Picking the right components
Configuring the PCs
10
11
12
13
12
13
14
19
19
20
21
21
21
21
22
23
23
23
23
16
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
24
26
26
24
25
24
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
GNS3 needs to run with root privileges to be able to create the virtual tap
nics dynamically in Mac OS X.
5
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
1. This script is only needed for those who use Parallels Desktop.
VirtualBox automatically ups a tap nic that is connected to a
VirtualBox VM . Parallels Desktop doesnt. I dont know what
VMware Fusion 4 does.
2. Only if you use tap nics in your project, GNS3 will create them.
When you close your project, your dynamically created tap nics
will also be gone in OS X, hence I made a separate script to
bring them up.
3ConnectV2R.sh This6 is an optional script that makes your virtualized network accessible from your real network (LAN) and vice
versa. Your virtualized network runs just fine in itself without this
script.
It might be important to know that the script assumes that you
connect your virtualized network to a real network via a tap0 nic
and that this tap0 interface has an IP address of 10.1.1.1/24. This
script will setup IP forwarding between this tap0 nic and your
cabled ethernet nic (en0)7 of your Mac to reach your LAN. If you
are using your wireless nic (en1) and use DHCP instead (without
permanent reservation) or a fixed IP address, you have to modify
this script.
Please allow me to mention a few things about my scripts.
. My scripts are "stupid" scripts. They dont do error checking. As
a result you really need to understand what they do and foremost
what to expect and what not.
. Although the scripts work, they depend on the design of your
virtualized network. If you choose not to use tap0 to connect to
your real network, dont want to use 10.1.1.1, use something else
than two virtual machines that connect to your virtualized network,
you first have to edit the scripts.
. The order in which you launch the scripts is important as you will
see in a few moments, but please feel free to rename the scripts as
you like. Especially script 2 and 3 depend on the design of your
network, so you might need to create one based of the design of
each of your virtualized network projects. Just dont change the
digit each script starts with, since the order in which you start them
does count.
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
/Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC3-community-OSX.intel64.bin
At the time of writing, Qemu and VirtualBox support are not yet implemented in the Mac version of GNS3 version 0.7.4.
When you are done editing your preferences, click on Apply to save
the adjustments and then OK to close the preference window.
If you are using OS X in another language than English, you will probably
see something else in Finder (Dutch:
/Programmas). Dont worry and leave
the English path. OS X will still cope.
10
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
Image file Enter the path and file name of the IOS image you want to
use. Click on the [. . .] if you want to use the Finder to pinpoint the
file.
IDLE PC You set this parameter later on a per router series base.
See section Setting the IDLE PC parameter at page 21.
(Optionally) Base config If you are tired of each time setting the passwords, no dns-lookup and that sort of things, you can provide a
text file here where this is filled in already for this router series.
Other parameters will be filled in automatically.
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
10
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
11
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
12
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
13
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
14
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
15
1. Start the network and the virtual machine. We use here two
Microsoft Windows 2008 R2 servers. Look at section Starting and
shutting down GNS3 with VMs on page 19 how to do this properly.
2. Be sure you first install:
Parallels Tools in your guest OS when you use Parallels Desktop, or
VirtualBox additions in your guest OS when you use VirtualBox.
3. Login as administrator
4. In the guest operating system we will assign an IP address to the
default network card. Here I do this via the command prompt but
you can also do this the GUI-way via Control Panel.
5. Open the command prompt [Start/cmd]
6. For Server Leuven, copy and paste this line in the command
prompt and execute.
netsh interface ip set address name="Local Area Connection" static 10.20.20.100 255.255.255.0 10.20.20.254 1
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
16
So far we have our virtual network up and running and have two
virtual machines connected to it. What if we want to connect this
virtual network to our LAN or beyond that: the internet? Of course,
this can be done, but it is optional. Our virtualized network runs
just fine in itself with the two virtual machines connected to it. For
reasons of convenience, lets put our topology map here.
Figure 10: Our network topology
ends at tap0 that has an IP address
10.1.1.1/24 where it will meet our real
network that resides on the en0 ethernet
network interface (10.10.10.10/24) of
our Mac.
Talking from en0 to the real network
is default behaviour of a properly
configured TCP/IP client.
Talking from en0 and the virtualized
network behind tap0 and vice versa
will be made possible by enabling IP
forwarding in OS X. In other words:
by enabling IP forwarding in OS X, we
turn our Mac into a router.
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
17
1.
You use you ethernet nic en0 and not something else such as your
Wifi nic en1 to connect to your LAN (read: your real network).
MY_REAL_IF
MY_REAL_NIC_IP
2.
The tap nic that will act as a gateway for your virtualized network is
tap0.
MY_VIRTUAL_TO_REAL_GW_TAP_NIC
3.
Your tap0 will be assigned (by this script) the IP address 10.1.1.1/24.
MY_VIRTUAL_TO_REAL_GW_TAP_NIC_IP,
4.
If your situation is different, you need to edit the appropriate variables of my script via vi, textedit.app or whatever you prefer.
MY_VIRTUAL_TO_REAL_GW_TAP_NIC_SM
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
18
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
19
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
20
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
21
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
22
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
mouse but use a Wacom tablet instead. Using a Wacom tablet seems
just to work more natural in Parallels than in VirtualBox and does
not work at al in VMwares Fusion 418 .
23
Clients:
front R:85 G:36 B:34
Autologon For Windows systems that run on my virtual network, it annoys me that I have to press ctrl-alt-delete each time to
logon. There is a simple utility from sysinternals to enable autologon. You can download at http://technet.microsoft.com/en-us/
sysinternals/bb963905.
A faster way to shutdown - s.bat For my test machines, I dont
need to have a detailed shutdown eventlog, they just need to shutdown when I want them to and do it fast. I wrote a simple batch file
for it called s.bat19 . Put it in your home directory (you need admin
privileges to run this script). Run it when you want to shutdown
your windows guest OS. It runs on Windows 7 and Windows 2008R2.
Look at section My batch file suite simple batch files to do simple repetitive
things on page 24 where to download.
19
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
24
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
Dont worry. you can still use your protocol analyzer here, but instead of selecting wires in your GNS3 network, select the appropriate
nic in Wireshark directly. So if you want to sniff on a line between
a PC and a switch, go to Wireshark and select the nic of the PC and
start sniffing. Problem solved!
Oh, and you can run several Wireshark instances the same time so
it is no problem if you sniff at three places at the same time.
25
getting gns3 to work on mac os x 10.7 lion with parallels desktop 7 or virtualbox 4.1.2
26
Used sources
Bitsontheline (http://www.bitsontheline.net) - GNS3 and VirtualBox Integration Under OS X part 1 , part 2 and part 3 used
as a proof of concept but is a bit outdated on Lion.
defaultrouteUK (http://www.defaultrouteuk.com Watched his
video and inspired my scripts on his script to let GNS3 run
with root privileges, a necessity get rid of the pesky GNS3 error
206 unable to create NIO_TAP device.
Software
Apple Mac OS X 10.7 Lion Of course.
GNS3 for Mac OSX http://www.gns3.net/download GNS3 network
virtualizer that has the DynaMIPS Cisco hardware emulator embedded
Tunnelblick http://code.google.com/p/tunnelblick/ used for it
Lion compatible TAP-driver (open source)
Wireshark http://www.wireshark.org/ network protocol analyser
(open source)
Oracles VirtualBox http://www.virtualbox.org a very good Open
source Virtualization software for Mac, Windows and LINUX that
as of Version 4.1.2 is compatible with Mac OS X Lion.
Parallels Desktop 7 for Mac http://www.parallels.com 20 a commercial VM virtualization software for Mac OS X that as of version 7 is
compatible with Lion.