Sie sind auf Seite 1von 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

Sign In

Create Account

Ad by Vidx

IT Certification Forum CISCO TECHNICAL SECTION GNS3

Install and configure GNS3 with TunTap on the Mac


Started By ccie4lab , Mar 17 2014 06:35 AM

Posted 17 March 2014 - 06:35 AM

ccie4lab

A virtual network has many great uses. It can be indispensable when testing device configurations before applying to your
production network, and it also can be beneficial for training purposes when studying for the Cisco and Juniper
certification exams.
GNS3 is a graphical network simulator. It's an impressive tool that ties together the Dynamips
(http://en.wikipedia.org/wiki/Dynamips) , VirtualBox (https://www.virtualbox.org) , VMware (http://www.vmware.com)
, and QEMU (http://wiki.qemu.org) hypervisors abstracted to the user as a modular and flexible graphical user interface
for network design and testing.

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3apple.png)
Download the Software
You can grab the components needed for this tutorial from their respective websites:
GNS3 (http://www.gns3.net/)
TunTap (http://tuntaposx.sourceforge.net/)
Cisco IOS image (http://www.cisco.com/)
Install the Software
# TunTap
The TunTap package will provide us with a collection of virtual network interfaces for the Mac operating system. The TAP
drivers allow us to bridge our GNS3 virtual network with the physical Mac host. Unpack and install the downloaded
TunTap package.
Verify the TunTap package installed successfully. Run this command from Terminal.app:
$ ls -l /dev/tap*
You should see the device files listed (tap0 - tap15).
crw-rw---- 1 root wheel 33, 0 Oct 5 07:27 tap0
crw-rw---- 1 root wheel 33, 1 Oct 5 07:27 tap1
crw-rw---- 1 root wheel 33, 10 Oct 5 07:27 tap10
crw-rw---- 1 root wheel 33, 11 Oct 5 07:27 tap11
crw-rw---- 1 root wheel 33, 12 Oct 5 07:27 tap12
crw-rw---- 1 root wheel 33, 13 Oct 5 07:27 tap13
crw-rw---- 1 root wheel 33, 14 Oct 5 07:27 tap14
crw-rw---- 1 root wheel 33, 15 Oct 5 07:27 tap15
crw-rw---- 1 root wheel 33, 2 Oct 5 07:27 tap2
crw-rw---- 1 root wheel 33, 3 Oct 5 07:27 tap3
crw-rw---- 1 root wheel 33, 4 Oct 5 07:27 tap4
crw-rw---- 1 root wheel 33, 5 Oct 5 07:27 tap5

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 1 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

crw-rw---- 1 root wheel 33, 6 Oct 5 07:27 tap6


crw-rw---- 1 root wheel 33, 7 Oct 5 07:27 tap7
crw-rw---- 1 root wheel 33, 8 Oct 5 07:27 tap8
crw-rw---- 1 root wheel 33, 9 Oct 5 07:27 tap9

A reboot of the computer may be required if the virtual devices are not listed in the output.
# GNS3
Open the GNS3 DMG image file, and move the GNS3.app to the Applications folder.
We also need to change the ownership and permissions for the Dynamips binary file(s). The Dynamips process will need to
run with elevated privileges (root) to attach the TAP devices.
Change the ownership of the Dynamips binary file(s) to the root user. Run this command from Terminal.app:
$ sudo chown root /Applications/GNS3.app/Contents/Resources/dynamips*.bin
Modify the setuid (http://en.wikipedia.org/wiki/Setuid) attribute for the Dynamips binary file(s). Run this command from
Terminal.app:
$ sudo chmod 4755 /Applications/GNS3.app/Contents/Resources/dynamips*.bin
Verify the new configuration. Run this command from Terminal.app:
$ ls -oh /Applications/GNS3.app/Contents/Resources/dynamips*.bin
-rwsr-xr-x@ 1 root 1.0M Sep 9 21:01 /Applications/GNS3.app/Contents/Resources/dynamips-0.2.10-OSX.intel64.bin
-rwsr-xr-x@ 1 root 958K Sep 9 21:01 /Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC3-communityOSX.intel64.bin

Note: Recent versions of GNS3 include multiple versions of the Dynamips binary file.
GNS3 Base Configuration
# Create the GNS3 Folders
Create the main GNS3 folder as well as the GNS3/Projects, GNS3/Images, and GNS3/Tmp subfolders in your
Documents folder. Feel free to use the Finder, but I will use the command line method in my example.
Create the main GNS3 folder and subfolders. Run this command from Terminal.app:
$ mkdir -p $HOME/Documents/GNS3/{Projects,Images,Tmp}

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-folders.png)
# Cisco IOS Image File
Let's now unpack the image file and move it to the Images folder. I will be using the c3725-adventerprisek9-mz.12415.T10.bin image file in my example. I will first navigate to the directory where I have it saved
(/Users/marc/Downloads/Labs), so I would run this command from Terminal.app:
$ cd $HOME/Downloads/Labs

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 2 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

Now uncompress the IOS image. Run this command from Terminal.app:
$ unzip c3725-adventerprisek9-mz.124-15.T10.bin
Archive: c3725-adventerprisek9-mz.124-15.T10.bin
warning [c3725-adventerprisek9-mz.124-15.T10.bin]: 28328 extra bytes at beginning or within zipfile
(attempting to process anyway)
inflating: C3725-AD.BIN
You can safely ignore the warning message. It should have uncompressed successfully.
From the output, you will notice the unpacked IOS image filename is C3725-AD.BIN. Rename it back to original filename
substituting the extension with .image (e.g. c3725-adventerprisek9-mz.124-15.T10.bin -> c3725-adventerprisek9-mz.12415.T10.image). Run this command from Terminal.app:
$ mv C3725-AD.BIN c3725-adventerprisek9-mz.124-15.T10.image
Then move the c3725-adventerprisek9-mz.124-15.T10.image file to the GNS3 Images folder. Run this command
from Terminal.app:
$ mv c3725-adventerprisek9-mz.124-15.T10.image $HOME/Documents/GNS3/Images
We will now map the GNS3 settings with the new folders we just created.
# GNS3 Preferences (General)
Open the GNS3 Preferences. [Command-, (Command key plus the comma key)]
Select the General node on the left.
Select the General Settings tab.
Set the directory path for both Projects and OS images.
Click the Apply button to save the settings.

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-prefs-general.png)
# GNS3 Preferences (Dynamips)
Select the Dynamips node on the left.
Select the Dynamips tab.
Set the directory path for both Executable path to Dynamips and Working directory for Dynamips.
What value should we enter in the Executable path to Dynamips field? As stated previously, GNS3 now includes
multiple versions of the Dynamips binary file. Run the following command from Terminal.app to see our options:
$ ls /Applications/GNS3.app/Contents/Resources/dynamips*.bin
/Applications/GNS3.app/Contents/Resources/dynamips-0.2.10-OSX.intel64.bin
/Applications/GNS3.app/Contents/Resources/dynamips-0.2.8-RC3-community-OSX.intel64.bin

I decide to use the latest version, so I would enter the value


/Applications/GNS3.app/Contents/Resources/dynamips-0.2.10-OSX.intel64.bin in the Executable path to
Dynamips field.
Click the Apply button to save the settings.
Then click the Test Settings button to verify the configuration is valid.
Click the OK button to close the window.

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 3 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-prefs-dynamips.png)
# IOS images and hypervisors
Open the IOS images and hypervisors settings window. [Shift-Command-I]
Select the IOS Images tab.
Set the directory path for the Image file.
Verify the Platform and Model fields coincide with the Cisco IOS image file.
Verify/Set the Default RAM value for the image.
Click the Auto calculation button to start the operation to retrieve the IDLE PC value for the image.

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-idlepc-auto.png)
Click the Close button in the foreground window after the message Working Idle PC value found. is displayed.
Click the Save button.
Then click the Close button to close the window.

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 4 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-ioshyp.png)
Basic Lab Setup
Our sample lab will consist of a Router, an Ethernet Switch, and a Cloud node type. Drag the objects from the Node Types
dock onto the blank Workspace. It should look similar to this once we get everything configured:

(https://dl.dropboxusercontent.com/u/1030586/blog/img/topologysm.png)
We need to configure the Cloud object before we wire it to the switch. The object will be using a TAP virtual network
interface.
1. Right-click the Cloud object.
2. Select Configure.
3. Select the subnode (ex. C1).
4. Select NIO TAP.
5. Enter /dev/tap0 into the top field.
6. Click the Add button to add the interface.
7. Click the Apply button to save the setting.
8. Then click the OK button to close the window.

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 5 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-cloudconf.png)
Connect the objects with the Add a link tool.
R1 with f0/0
C1 (Mac) with nio_tap:/dev/tap0
# Start R1
Start the router. [Right-click (or Control-click) -> Start] on the router object, and find the console port for the virtual
router by entering the list command in the GNS3 management console.

(https://dl.dropboxusercontent.com/u/1030586/blog/img/gns3-console.png)
Emulate a console port connection to the router by establishing a telnet session. Run this command from Terminal.app:
$ telnet 127.0.0.1 2103
Let the router load until it presents the prompt. Take note you may need to press the return key multiple times to capture
the prompt in the terminal window.
# Save the Project
I prefer to save the GNS3 project at this point before I continue with the rest of the configuration.
File -> Save project as...

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 6 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

(http://dl.dropbox.com/u/1030586/blog/img/saveproject.png)
# Configure IOS for the Router
Set the IP configuration for the network interface that is connected to the switch.
R1# conf t
R1(config)# int fa0/0
R1(config-if)# ip address 10.11.1.1 255.255.255.0
R1(config-if)# no shut
R1(config-if)# end
Let's verify the configuration of the interfaces by executing the following commands:
R1# sh run int fa0/0
Building configuration...
Current configuration : 94 bytes
!
interface FastEthernet0/0
ip address 10.11.1.1 255.255.255.0
duplex auto
speed auto
end

R1# sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.11.1.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down

Copy the current running configuration to the startup configuration in the virtual NVRAM, so we don't have to repeat the
previous steps the next time we start this lab in GNS3.
R1# copy run start
Destination filename [startup-config]? <enter>
Building configuration...
[OK]

# TAP Interface
By linking the Cloud with the switch, it should have brought up the TAP network interface on the physical Mac host. Let's
check. Run the following command from a separate Terminal.app window (tab):
$ ifconfig tap0
tap0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ce:d1:be:72:33:67
open (pid 34415)

Set the IP configuration for the tap0 interface. The IP address will need to be in the same subnet as the one we configured
for the network interface on the router. You will be requested for your user account password because modifying the
logical network configuration for a network interface requires superuser privilege. Run this command from

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 7 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

27/04/14 12:26 am

Terminal.app:
$ sudo ifconfig tap0 inet 10.11.1.254/24 up

Verify the IP configuration on the interface. Run this command from Terminal.app:
$ ifconfig tap0
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ce:d1:be:72:33:67
inet 10.11.1.254 netmask 0xffffff00 broadcast 10.11.1.255
open (pid 34415)

Test the Connectivity


Ping from our Mac (tap0) to the virtual router. Run this command from Terminal.app:
$ ping -c 3 10.11.1.1
PING 10.11.1.1 (10.11.1.1): 56 data bytes
64 bytes from 10.11.1.1: icmp_seq=0 ttl=255 time=3.223 ms
64 bytes from 10.11.1.1: icmp_seq=1 ttl=255 time=1.316 ms
64 bytes from 10.11.1.1: icmp_seq=2 ttl=255 time=1.328 ms
Ping from the virtual router to our Mac (tap0). Run the following command from the R1 Terminal.app window (tab):
R1# ping 10.11.1.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.11.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/16 ms

Automate (optional)
I don't want to manually configure the TAP interface(s) every time I load a GNS3 project, so I created a simple script to
take care of this.

001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016
#!/usr/bin/env bash # Topology file located in GNS3/Projects directory TOPFILE=$HOME/Documents/GNS3/Projects/test/topology.net # tap0 interface IP
configuration TAP0IP=10.11.1.254/24 # Open GNS3 with topology file /Applications/GNS3.app/Contents/MacOS/GNS3 "$TOPFILE" & # Number of seconds to wait
before assigning IP configuration to tap0 sleep 5 # Set the IP configuration for the the tap0 interface sudo ifconfig tap0 inet $TAP0IP up

Copy and paste the text into your preferred text editor (exclude the line numbers), then save the file as launch-gns3with-test-project.sh.
Give the file the execute permission. Run this command from Terminal.app:
$ chmod u+x launch-gns3-with-test-project.sh
Run the script. You will be requested for your user account password because modifying the logical network configuration
for a network interface requires superuser privilege via the sudo command. Run this command from Terminal.app:
$ ./launch-gns3-with-test-project.sh
GNS3 and VMware Fusion
GNS3 has built-in support for VirtualBox and QEMU, but GNS3 also works excellent with VMware Fusion. Check out the
following posts for more information:
Edited by ccie4lab, 17 March 2014 - 06:36 AM.

Back to GNS3

IT Certification Forum CISCO TECHNICAL SECTION GNS3

Organization

Community

Downloads

Test Providers

Site Info

About Us
Advertising

Forums
Blogs

Apple
Cisco

Pearson VUE
Prometric

2008 - 2011 CertCollection IT Certification Forum


Community Forum Software by IP.Board

Contact Us

Downloads

Citrix

Exin-Exams

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 8 of 9

Install and configure GNS3 with TunTap on the Mac - GNS3 - IT Certification Forum

Follow us on Twitter

Privacy Statement

CompTIA

27/04/14 12:26 am

Go to top

Microsoft

http://certcollection.org/forum/topic/219974-install-and-configure-gns3-with-tuntap-on-the-mac/

Page 9 of 9

Das könnte Ihnen auch gefallen