Mac OSX – GNS3 Connecting To the Internet

KB ID 0001170 

Problem

I have a love hate relationship with GNS3, I appreciate it’s brilliant, (when it works). I also appreciate that it’s free, and people put a lot of effort into its development for very little reward. But when I try to do simple things, like connect my projects/labs to the internet and it’s massively overcomplicated I get pretty exasperated.

With Windows this is easy, (I’ve probably blogged about it before), drag a cloud onto the workbench and connect it to a network card, job done! On a Mac however it’s a whole different ball game, as I found out last year when I swapped from Windows to Mac. The documented method of doing this, is to use tun tap interfaces and run GNS3 as root and connect things together. But I cannot get this to work at all.

Kudos and credit for this solution goes to my colleague Steve. When I swapped to Mac he was my ‘go-to-guy’ for ‘how does this work’ and ‘what’s the Mac equivalent of {insert name of software}’ questions. I could not connect my new mac GNS3 labs to the internet, so he gave me a VM that did the hard work for me. Despite my efforts to find a better way of doing this, it remains the easiest, simplest, solution, and works over wireless/wired connections etc.

Solution

Requirements:

  • GNS3 (obviously). I’m using version 1.4.4
  • Virtualbox (This wont work with VMware Fusion unfortunately, I’ve tried). I’m using Version 5.0.16 r105871
  • M0n0firewall (download GW1)

Procedure;

Download the GW1 appliance (link above) and extract the files, then from within Virtualbox >  Machine > Add > Locate the extracted GW1 appliance > Open.

Now in GNS3 > Preferences > Virtualbox > Virtualbox VMs > Add > Add in the GW1 appliance > Edit > Give it TWO network cards > Ensure ‘All GNS3 to use any configured Virtualbox adapter’ is NOT ticked > OK.

Now drag the GW appliance onto your GNS3 work area, and connect to a router (or anything you can configure an IP on). Make sure the appliance is started.

Now back in Virtualbox > Look at the NIC settings for the GW1 appliance, the one connected to GNS3 should say ‘Generic  Driver’ and UDP Tunnel
Now manually set the other NIC to be connected to your NAT Network, this network will nat the VM’s NIC out to the the internet connection being used by the Mac (either wired or wireless). Make sure you tick ‘Cable Connected’

Note: This is why I still use Virtualbox for this, in VMware Fusion any changes you make to the NICs are hijacked by GNS3 when you add and start the VM, with Virtualbox they are not.

You will know when you have the network cards right, as the ‘WAN’ will get an IP from your NAT Network.

Use option ‘6’ and make sire the virtual machine has a good connection to the internet.

Above you can see the appliance has a LAN IP of 192.168.1.1. Back in GNS3 give an IP address on the same range to the device you connected to the virtual appliance.

The network is directly connected, so you should not need to add a static route, I just do this out of habit.

First make sure you can ping the appliance, then make sure you can ping a public IP address.

Troubleshooting

While setting this up, you may have to ‘reset the appliance to factory settings’ (options 4), this should re-detect all the interfaces. You may also get the interfaces the wrong way round, ensure the right NIC is presented into GNS3.

Related Articles, References, Credits, or External Links

NA

GNS3 Update – Could Not Find a VM Named ‘GNS3 VM’

KB ID 0001160 

Problem

GNS3 had nagged me the last few times I tried to use it about upgrading, so I downloaded and installed the update and it stopped here;

Could not find a VM named ‘GNS3 VM’ is it imported in VMware or Virtualbox

I use both VMware Fusion and Virtualbox. But Virtualbox looks after all the VM’s I use in GNS3. Either way I did not know what I was looking for, and the download (and application folder) did not have a VM within it for me to import?

Solution

It turns out the link for the VM is on the GNS3version download page, (it redirects you  to another site).

Once you have it downloaded, you can import it into either Virtualbox, VMware Fusion or VMware Workstation.

Then you can select it, and progress.

Related Articles, References, Credits, or External Links

NA

GNS3 – Initial Setup, Adding Routers, Hosts, and ASA Firewalls

KB ID 0000927 

NOTE: THIS ARTICLE IS FOR THE OLD VERSION OF GNS3

GO HERE FOR THE NEW ONE

Problem

I dip into GNS3 every so often, (depending on what I’m working on). And each time I install it, I spend just as long remembering how to set it up, as I do using it! So, if for no other reason than I can use this page as a reference in future, here’s how to get it up and running.

Solution

Note: At time of writing he latest version is 8.6

1. Download GNS3, I accept all the defaults (I actually tick to install SuperPuTTy, as tabbed console windows can be handy when using GNS3). Launch the program, you will be greeted with the following setup wizard. Select Option 1.

Note: You can do the same in future, by going to Edit > Preferences

2. Check that the path to the ‘projects’ and your ‘images’ folder are where you want them to be. The defaults are fine but if you run GNS3 on several machines you might want to choose something like Dropbox > Apply > OK.

3. Option 2.

4. Click Test Settings > Have patience, it can take a couple of minutes > Apply > OK.

Adding Router Images to GNS 3

5. Option 3

Note: You can visit the same section in future by clicking Edit > IOS Images and Hypervisors.

6. Image file > Browse to the image you want to import. Here on GNS3 8.6 you can select the filename.bin file, with older versions you need to extract that file to a filename.image file.

Note: You need to legally download these images from Cisco. This means you need a Cisco CCO account, and a valid support agreement. DO NOT email me and ask for Cisco IOS images, (I will just ignore you!).

7. As mentioned above, it will convert my filename.bin image to an extracted filename.image file > Yes.

8. Set the Router platform and model > In the IDLE PC section click Auto calculation > This can take a while.

Note: You can do this later from the main workspace, and test a range of settings. I you don’t do this your virtual network devices will eat all your CPU power!

9. When complete click Close > Save > Close.

10. You can now start that model router to the workspace and use it. Repeat for each model of router you want to add.

Adding a Host to GNS3

Having a host machine for you labs is handy, usually you just need to be able to ping, or perform tracerts. So you can download a small Linux image from GNS3. There are a few options but I prefer linux-microcode.

11. Edit > Preferences.

n

12. Quemu > Quemu Guest > Give it an identifier name (can be anything) > Browse to, and select the image you downloaded.

13. Save > OK > Apply.

14. You can now drag a Quemu Guest machine onto the work space, and console into it.

Adding a Cisco ASA to GNS3

Yes you can add Cisco PIX as well, but there’s not many of them left in the wild.

15. Edit > Preferences > Quemu > ASA > Give it an identifier name (can be anything) > Set the RAM to 1024 > Set the Qemu options to;

[box]

-vnc none -vga none -m 1024 -icount auto -hdachs 980,16,32

[/box]

Set the Kernel cmd line option to;

[box]

-append ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536

[/box]

16. You need two files to run the ASA, an initrd file and a kernel file. You need to create these from a legally obtained copy of the asa843-k8.bin file.</p?

Should you wish to locate these files form a less reputable source you are looking for
asa842-initrd.gz and asa842-vmlinuz, again don’t email me for them! If you are too stupid to use a search engine, then technical ninjary is not the correct career choice for you.

17. Finally select the vmlunuz file > Open.

18. Save > OK > Apply.

19. You can now drag an ASA onto the workspace and console into it (it takes a while, be patient). When the ASA starts it has all the licenses disabled, to add them you need to change the ASA’s activation key. An ASA Activation key is usually linked to the serial number of the ASA, in this case we don’t have a serial number, (that’s not strictly true, if you check, it’s something like 12345678). So I will publish a working activation key*

*Disclaimer, this will only work on this virtual ASA, and it’s published elsewhere on the Internet, if I receive a request to remove it I will do so.

Another ‘quirk’ is every time you add a new ASA to the workspace, you need to go through this process, if you enter the commands below you can issue a reload and also save the ASA, without the need to re-enter the activation key.

[box]

activation-key 0xb23bcf4a 0x1c713b4f 0x7d53bcbc 0xc4f8d09c 0x0e24c6b6
{This can take 5-10 minutes}
copy running-config startup-config
{Enter}
copy startup-config disk0
{Enter}

[/box]

20. When it comes back up, (again it will take a few minutes). Your can check your ASA’s licensed features.

Related Articles, References, Credits, or External Links

Connecting GNS3 to VMware Workstation

Build a PIX Firewall for your test network

Working with GNS3 and PEMU – (Part 2)

KB ID 0000662 

Problem

In Part 1 we installed and Licensed our Virtual PIX, now we will give it an IP address and get the firewalls web management console running.

To complete this procedure you will need to,

1. Have a TFTP server up and running (CLICK HERE).

2. Know how to connect to a Cisco Firewall (CLICK HERE).

Solution

Step 1 (Add an interface to your host machine)

1. On your host PC/VM Click Start > Run > hdwwiz.cpl {enter} > At the “Add Hardware Wizard” click Next > Let it search > Tick “Yes I’ve allready connected the hardware > Next > Scroll to the bottom > Select “Add a new hardware Device > Next.

2. Select “Install the hardware that I manually select” > Next > Next > Select Network Adaptor > Next > Next > Finish.

3. Click Start > Run > ncpa.cpl > Right Click the new NIC and rename it to loopback adaptor > Then give it a valid IP on your test network. (Right click > properties > TCP/IP).

Step 2 (Configure the connection)

4. Connect to the PIX as shown in Part 1 > Give the PIX an IP address with the following commands;

[box]

enable
{Password} - Set blank by default
configure terminal
int e1
no shutdown
nameif inside
ip address {ip on test network}{subnet of test network}
write men

[/box]

5. To connect tie PIX to the Loopback adaptor you need to add some networking in the GNS3 console > Drag the cloud object into the work area > Right click > Configure.

6. Select C0.

7.Select the loopback adaptor > Add > Apply OK

Note: If you are presenting a real adaptor you will only see some uncomprehensable numbers – locate the “Network Device List” Batch file in the GNS3 directory and run it whis will de-cypher those numbers for you.

8. Drag a switch onto the workspace.

9. Click the connection tool and select “Fast Ethernet”.

10 Select the cloud (Loopback Adaptor) and drag a connection to the switch.

11. Select the PIX (Inteface e1) and drag a connection to the switch.

12. All green lights is good 🙂

13 From another machine on the network make sure you can ping the PIX to test connectivity.

Note: If you are using Microsoft Hyper-V server, you may find that the whole thing fails at this point, If thats the case, then close down the Guest machine and add and configure a “Legacy Network Card”. Bring the system back up and configure the new network card accordingly.

Also if you are in a virtual environment you can simply add another network card and get the cloud to use that instead of using a loopback adapter.

Step 3 Install and configure the ASDM (Web Inteface)

1. Set up your TFTP server and have the asdm image file ready in the TFTP servers root directory.

2. We are now going to allow connection to the PIX via Telnet – becaue the console can be a bit twichy in the GNS3 environment.

[box]

enable
{Password} <-blank be default
configure terminal
telnet 0.0.0.0 0.0.0.0 inside
passwd cisco <- sets telnet password to cisco
write men

[/box]

3. Now you can telnet to the PIX from another machine and copy the ASDM image from your TFTP server to the PIX.

[box]

enable
{Password} <-blank by default
copy tftp flash
{ip of the hosst running TFTP}
{filename of the asdm inage}
{Enter} to accept

[/box]

4. Once the file is copied over you need to let the Firewall know that its the one to use, turn on the internal http server and allow access.

[box]

enable
{Password} <-blank by default
conf t
asdm image flash:asdm-603.bin
http server enable
http 0.0.0.0 0.0.0.0 inside
write men

[/box]

The file will be copied over into the firewalls flash memory (Time for a coffee).

5. Now simply connect via the ADSM inteface – if your unsure how to do that see my article here

Using the information above you can present multiple network cards and clouds to the Virtual firewalls various interfaces (There are 5 interfaces on this firewall – its a PIX 525) – enjoy

NB Please dont email and ask me for PIX images and/or activation keys as refusal often offends – PL

Related Articles, References, Credits, or External Links

NA

GNS3 – Initial Setup, Adding Routers, Hosts, and ASA Firewalls

KB ID 0001079 

Problem

I dip into GNS3 every so often, (depending on what I’m working on). And each time I install it, I spend just as long remembering how to set it up, as I do using it! So, if for no other reason than I can use this page as a reference in future, here’s how to get it up and running.</p?

Solution

Note: At time of writing the latest version is 1.3.6</p?

1. Download GNS3, I usually accept all the defaults.

2. Edit > Preferences > Check that the path to the ‘projects’ and your ‘images’ folder are where you want them to be. The defaults are fine but if you run GNS3 on several machines you might want to choose something like Dropbox > Apply > OK.

Adding Router Images to GNS 3

3. Dynamips > IOS Routers > New > Add in your route images > Follow instructions.</p?

Note: DONT Email me and ask for router images, go to Cisco and get them legally, (or use Google).

4. Make sure you take the time to calculate the ‘Idle-PC finder’ value for each router, or in large topologies you might quickly eat all your CPU power!

5. Continue adding routers as required.</p?

6. You can now drag a router onto the workspace and power it on.

Adding a Cisco ASA to GNS3

Yes you can add Cisco PIX as well, but there’s not many of them left in the wild.

7. Edit > Preferences > Qemu > Qemu VMs > Add > Set the type to ASA 8.4(2).

8. You need two files to run the ASA, an initrd file and a kernel file. You need to create these from a legally obtained copy of the asa843-k8.bin file.</p?

Should you wish to locate these files form a less reputable source you are looking for
asa842-initrd.gz and asa842-vmlinuz, again don’t email me for them! If you are too stupid to use a search engine, then technical ninjary is not the correct career choice for you.

9. You can now drag an ASA onto the workspace and console into it (it takes a while, be patient). When the ASA starts it has all the licenses disabled, to add them you need to change the ASA’s activation key. An ASA Activation key is usually linked to the serial number of the ASA, in this case we don’t have a serial number, (that’s not strictly true, if you check, it’s something like 12345678). So I will publish a working activation key*

*Disclaimer, this will only work on this virtual ASA, and it’s published elsewhere on the Internet, if I receive a request to remove it I will do so.</p?

Another ‘quirk’ is every time you add a new ASA to the workspace, you need to go through this process, if you enter the commands below you can issue a reload and also save the ASA, without the need to re-enter the activation key.

[box]

activation-key 0xb23bcf4a 0x1c713b4f 0x7d53bcbc 0xc4f8d09c 0x0e24c6b6
{This can take 5-10 minutes}
copy running-config startup-config
{Enter}
copy startup-config disk0:
{Enter}

[/box]

10. When it comes back up, (again it will take a few minutes). Your can check your ASA’s licensed features.</p?

Adding a Host to GNS3

Having a host machine for you labs is handy, usually you just need to be able to ping, or perform tracerts. So you can download a small Linux image from GNS3. There are a few options but I prefer linux-microcode.

11. Edit > Preferences > Qemu > Qemu VMs > Add > Set the type to default.

n

12. Give it a sensible name.

13. Navigate to, and select the disk image you downloaded above.

14. You can now drag a Qemu Guest machine onto the work space, and console into it.

Related Articles, References, Credits, or External Links

Connecting GNS3 to VMware Workstation

GNS3 – Assign an IP Address to Linux Microcore QEMU Guest

KB ID 0000932 

Problem

The whole point of having these guest machines is for testing communications, putting an IP address on them so you can ping things, is a pretty basic step.

Solution

1. Console in, and execute the following commands, obviously change the IP addresses to the ones you require.

[box]

sudo su
ifconfig eth0 10.10.10.10 netmask 255.0.0.0 up
route add ip default gw 10.10.10.1
route add default gw 10.10.10.1

[/box]

Related Articles, References, Credits, or External Links

NA

GNS3 – Routers Lose their Certificates When Restarted

KB ID 0000955 

Problem

I was doing some work with PKI and routers today, and after spending ages enrolling all my routers for certificates, I thought I’d save my hard work and return to it later. When I started the project up again, I was less than happy all the devices certificates had ‘Disappeared’!

Solution

This is default behavior, to change this select Edit > Preferences > Dynamips > Locate ‘Automatically clean the working directory’ and DESELECT it > Apply >OK.

Related Articles, References, Credits, or External Links

NA

GNS3 – Error ‘ghostsize is to small for device’

KB ID 0000935 

Problem

While doing a quick lab in GNS3, I tried to add NAT to a router, and it fell over with the following error;

[box]

R3(config-if)#ip nat outside
% NBAR ERROR: parsing stopped
% NBAR Error : Activation failed due to insufficient dynamic memory
% NBAR Error: Stile could not add protocol node
%NAT: Error activating CNBAR on the interface FastEthernet0/0
R3(config-if)#
*Mar 1 00:01:11.655: %SYS-2-MALLOCFAIL: Memory allocation of 10260 bytes failed
from 0x62915CD4, alignment 0
Pool: Processor Free: 28660 Cause: Memory fragmentation
Alternate Pool: None Free: 0 Cause: No Alternate pool
-Process= "Exec", ipl= 0, pid= 93, -Traceback= 0x6148BFF8 0x60016604 0x6001C564 0x6001CBBC 0x636756E4 0x62915CDC 0x628F468C 0x628F9DA0 0x628F5968 0x628FA474 0x628F5968 0x628F8344 0x628F5968 0x628F5B2C 0x62928FBC 0x62933A20
*Mar 1 00:01:11.659: %NBAR-2-NOMEMORY: No memory available for StILE lmalloc, -Traceback= 0x6148BFF8 0x62915CF8 0x628F468C 0x628F9DA0 0x628F5968 0x628FA474 0x628F5968 0x628F8344 0x628F5968 0x628F5B2C 0x62928FBC 0x62933A20 0x62920BD0 0x6293DF70 0x6293E2F0 0x61C77C70
R3(config-if)#
*Mar 1 00:01:12.231: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
R3(config-if)#

[/box]

A quick Google told me, this was because I didn’t have enough memory assigned to the router, and I was supposed to change this, save the new setting, and reload the router. But as soon as I did that, this happened. (Note: Seen in GNS3, I could not console to the router).

[box]

GNS3 management console. Running GNS3 version 0.8.6.
Copyright (c) 2006-2013GNS3 Project.

=> *** Warning: ghostsize is to small for device R3. Increase it with the ghostsize option.

[/box]

Solution

1. Locate the filename.net file for your project, and open it.

Note: Usually in C:Users{user-name}GNS3Projects

2. Locate the section that contains your router settings, (you should see the IOS image name). Below that change the RAM value, here I changed it from 128 to 256, then save the file and reopen your GNS3 project.

3. To stop this happening again, whilst in GNS3 > Edit > IOS Images and Hypervisors > Locate the router image, and set the default RAM figure here > Save > Click Test settings to make sure.

Related Articles, References, Credits, or External Links

NA

GNS3 – Network Cards Are Missing

KB ID 0000964 

Problem

Like most techies, I am always fiddling with things. One of my mottoes is “If you never break anything, you never learn how to fix things”. So after messing around with the networks in VMware Workstation (What I typically use for connecting GNS3 to either real machines, or the outside world). I lost the network connections in GNS3 and could not get them back. Seems like any new NICs that you add are not listed either.

Solution

Note: It might be worth resetting your VMware Workstation Network settings before continuing. (Edit > Virtual Network Editor > Restore default).

1. To make things simple, I’ve renamed the Network Cards installed by VMware workstation to something a little more descriptive, (if you unsure which is which, just run ‘ipconfig’).

2. Let’s double check, drop to command line and run the following command;

[box]
netsh interface ipv4 show interfaces
[/box]

3. And let’s affirm what GNS3 is telling us by running the following script from the GNS3 directory;

[box]
“C:Program FilesGNS3network-device-list.cmd”[/box]

LEAVE THIS WINDOW OPEN

4. As you can see (above) there is a discrepancy. To get GNS3 to ‘sync’ with windows we need to restart the NetGroup Packet Filter Driver service. Open an elevated command prompt and issue the following commands;

[box]

net stop npf
net start n/f

[/box]

5. Now execute the script again and it should show the correct network adapters.

6. Now from within GNS3 you can add the correct network cards to your ‘Clouds’.

Related Articles, References, Credits, or External Links

NA

GNS3 – Can’t Save ASA Config – ‘%Error copying system:/running-config (Not enough space on device)’

KB ID 0000987

Problem

I love GNS3, it is a brilliant piece of software, I use it for bench testing and proof of concept work. Yes is can be a bit clunky sometimes, but it’s FREE! I had a project open with about four ASA’s on it, and it would not save the config on just one of them.

[box]

HostName(config)# copy running-config startup-config

Source filename [running-config]?
Cryptochecksum: fdf42190 76959bba 05a6a3d6 3f900005

%Error copying system:/running-config (Not enough space on device)
HostName(config)#

[/box]

[box]

HostName(config)# write mem
Building configuration...
Cryptochecksum: fdf42190 76959bba 05a6a3d6 3f900005

%Error copying system:/running-config (Not enough space on device)
Error executing command
[FAILED]
HostName(config)# 

[/box]

[box]

HostName(config)# copy running-config disk0:

Source filename [running-config]?

Destination filename [running-config]?
Cryptochecksum: fdf42190 76959bba 05a6a3d6 3f900005

%Error copying system:/running-config (Not enough space on device)
HostName(config)# 

[/box]

Solution

At first I simply deleted the ASA and added a new one, which annoyingly did the same. Then I read a post that said, do the following;

1. Open the configuration for the affected ASA.

2. Change the NIC Model to pcnet > Apply > OK > Stop the firewall > Start the Firewall.

HOWEVER, in my case the problem persisted, I eventually fixed it by formatting the virtual ASA’s flash drive.

3. Execute the following command;

[box]

HostName# format flash 

 

Format operation may take a while. Continue? [confirm]

Format operation will destroy all data in "flash:". Continue? [confirm]{Enter}
Initializing partition - hda: hda1
done!
mkdosfs 2.11 (12 Mar 2005)

System tables written to disk

Format of disk0 complete
HostName# 

[/box]

4. Power off, then power on the firewall, problem fixed.

Related Articles, References, Credits, or External Links

NA