Introduction

Local install:

Last updated
July 16, 2017

Contributors
David Bombal
Julien Duponchelle
Edit this Article
Last updated
July 16, 2017

Contributors
David Bombal
Julien Duponchelle
Edit this Article

Connect GNS3 to the Internet (local server)

Introduction

This document explains how to connect GNS3 topologies to the Internet when using a local GNS3 server.

Note If you are using the GNS3 VM, refer to this document.

The topology created in this document looks as follows:

WARNING Ensure that your PC firewall is not blocking GNS3 traffic. If necessary, turn off your PC’s firewall.

Local install:

The following steps show you how to connect a local GNS3 installation to the Internet. In this document a simple topology of two Cisco routers are used to demonstrate:

  1. Adding a cloud to the GNS3 topology
  2. Configuring IP addressing
  3. Configuring DNS resolution
  4. Configuring NAT on the Cisco router
  5. Advertising Routes in OSPF
  6. Testing

  1. To create a new GNS3 topology, select a group of devices in the Devices Toolbar by clicking the Browse Routers button

  1. The routers available will depend on your GNS3 configuration. In this example both a local router and GNS3 VM router are available.

  1. Drag and drop a local router to the GNS3 Workspace. An instance of the node becomes available in the Workspace:

  1. Drag and drop another local server router to the GNS3 Workspace:

  1. Click the Browse all devices button to show all available devices:

  1. Drag and drop a Cloud to the GNS3 Workspace, select a local server and then click OK:

  1. Click the Toolbar Device button again to collapse the group:

  1. Right click on the Cloud and then click Configure:

  1. Select a local Network Adapter on your PC: A local wired connection is recommended. Then click Add:

  1. Click OK to complete the addition of the Network Card:

  1. Click the Add a Link button to start adding links to your topology. The mouse cursor will change to indicate that links can be added:

  1. Click on the first router topology to display available interfaces (this is device dependant):

  1. Click the interface and then select the cloud in the topology to connect the interface to. In this example FastEthernet 0/0 on R1 was selected and the link was joined to the cloud Cloud 1:

  1. Select an interface on the cloud to complete the connection. In this example, on nio_gen_eth:Local Area Connection 2 on Cloud 1 was selected:

  1. Add another link between R2 and R1:

  1. Click the Add a Link button to stop adding links. The mouse cursor will change back to normal to indicate that you have stopped adding links:

  1. If not already done, click the Show/Hide interface labels button on the GNS3 Toolbar to display interface labels in your topology:

  1. You are now ready to power on your network devices. Click the Start/Resume button on the GNS3 Toolbar to start up your network devices:

  1. You are now ready to configure your devices. Click the Console connect to all devices button on the GNS3 Toolbar to open a connection to every device in the topology:

  1. A console connection is opened to each router in the topology:

  1. Configure IP addresses:

Option 1: DHCP

If using DHCP, configure R1 as follows:

R1# configure terminal
R1(config)# interface FastEthernet 0/0
R1(config-if)# ip address dhcp
R1(config-if)# no shutdown
R1(config-if)# end
R1#

        

        Result: An IP address is allocated to the router by the DHCP server:

R1#
*Mar  1 00:03:14.831: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.29, mask 255.255.255.0, hostname R1

        Option_2:_Manual_configuration

If configuring static IP address, configure R1 with an IP address in the same subnet as your local PC:

R1# configure terminal
R1(config)# interface FastEthernet 0/0
R1(config-if)# ip address 192.168.1.123 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit

Configure a default gateway:

R1(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.249
R1(config)# end

  1. Ping the router’s default gateway:

R1# ping 192.168.1.249

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.249, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 8/17/36 ms
R1#

Result Pings should succeed.        

  1. Ensure that the router is configured to use the correct DNS server:

        R1# configure terminal

R1(config)# ip domain-lookup
R1(config)# ip name-server 8.8.8.8
R1(config)# end
R1#

  1. Ping google.com:

        R1# ping google.com


Translating "google.com"...domain server (8.8.8.8) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 216.58.198.174, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/19/24 ms
R1#

        Result Pings succeed.

        

If your pings don’t succeed, ensure that you have connectivity to your default gateway and ensure that the default gateway is configured for NAT to translate the address allocated to the GNS3 router.

  1. Configure IP addressing on the Internal GNS3 network:

        Configuration on the routers:

        R1        R1# configure terminal

R1(config)# interface FastEthernet 0/1
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#

R2R2# configure terminal
R2(config)# interface FastEthernet 0/0
R2(config-if)# ip address 10.1.1.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)#

  1. Configure OSPF on R1 and R2 and advertise a default route:

R1R1(config)# router ospf 1
R1(config-router)# network 10.0.0.0 0.255.255.255 area 0
R1(config-router)# default-information originate
R1(config-router)# end
R1#

R2R2(config)# router ospf 1
R2(config-router)# network 10.0.0.0 0.255.255.255 area 0
R2(config-router)# end
R2#

        Result OSPF neighbor relationships are established:

        

        R1*Mar  1 00:19:24.431: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.1.2 on FastEthernet0/1 from LOADING to FULL, Loading Done
R1#

R2*Mar  1 00:19:24.467: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.123 on FastEthernet0/0 from LOADING to FULL, Loading Done
R2#

        

Note If the OSPF relationships are not formed, check your configuration. Make sure you have configured IP addresses correctly, enabled the interfaces and cabled the GNS3 network correctly.

  1. Configure DNS settings on R2:

        R2# configure terminal

R2(config)# ip domain-lookup
R2(config)# ip name-server 8.8.8.8
R2(config)# end
R2#

  1. R2 will not be able to ping Internet devices until you configure NAT on R1 (or enable routing between R1 and your Internet gateway). In this example, the Internet gateway does not support routing, so NAT will be configured on R1:

R1# configure terminal
R1(config)# interface FastEthernet 0/0
R1(config-if)# ip nat outside
R1(config-if)# interface FastEthernet 0/1
R1(config-if)# ip nat inside
R1(config)# ip nat inside source list 1 interface FastEthernet 0/0 overload
R1(config)# access-list 1 permit 10.0.0.0 0.255.255.255
R1(config)# end
R1# write memory

  1. Test R2 connectivity to the Internet:

        R2# ping google.com

Translating "google.com"...domain server (8.8.8.8) [OK]

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 74.125.140.138, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 36/40/44 ms
R2# write memory

        Result R2 is able to ping devices on the Internet.

  1. Congratulations! You have configure Internet connectivity from GNS3.