This document explains how to connect GNS3 topologies to the Internet when using a local GNS3 server.
Use of the NAT node to allow topology nodes to access the internet is also an option. It is simpler than using the Cloud node, but devices on your LAN and the Internet will not be able to access them directly. Instructions on using the NAT node are covered here.
The topology created in this document looks as follows:
Ensure that your PC firewall is not blocking GNS3 traffic. If necessary, turn off your PC’s firewall.
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:
- Adding a cloud to the GNS3 topology
- Configuring IP addressing
- Configuring DNS resolution
- Configuring NAT on the Cisco router
- Advertising Routes in OSPF
- To create a new GNS3 topology, select a group of devices in the Devices Toolbar by clicking the Browse Routers button
- The routers available will depend on your GNS3 configuration. In this example both a local router and GNS3 VM router are available.
- Drag and drop a local router to the GNS3 Workspace. An instance of the node becomes available in the Workspace:
- Drag and drop another local server router to the GNS3 Workspace:
- Click the End devices button:
- Drag and drop a Cloud node to the Workspace, select a local server, and then click OK:
- The Cloud node will now appear in the Workspace:
- Click the Toolbar Device button again to collapse the group:
- Right click on the Cloud and then click Configure:
- A list of available Ethernet interfaces is listed:
Use of physical interfaces is recommended. However, it is possible to use other interfaces, like a bridge interface, or a wireless interface. Configuring those is outside the scope of this article.
Below are examples of enabling “show special ethernet interfaces”, and then viewing the dropdown list:
- 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:
- Click on the first router topology to display available interfaces (this is device dependant):
- Click the interface and then select the cloud in the topology to connect the interface to it. In this example FastEthernet 0/0 on R1 was selected. Next, click on the Cloud node, to see a list of available interfaces:
(notice that the listed interfaces on the Cloud node matches what we saw in its properties)
- Select an interface on the Cloud to complete the connection. In this example, Ethernet on Cloud 1 was selected:
- Add another link between R2 and R1:
- 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:
- If not already done, click the Show/Hide interface labels button on the GNS3 Toolbar to display interface labels in your topology:
- 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:
- You are now ready to configure your devices. Click the Console connect to all devices button on the Toolbar to open a connection to every device in the topology:
- A console connection is opened to each router in the topology:
- Configure IP addresses:
Option 1: DHCP If using DHCP, configure R1 as follows:
Result: An IP address is allocated to the router by the DHCP server:
Option 2: Manual configuration If configuring static IP address, configure R1 with an IP address in the same subnet as your local PC:
Configure a default gateway:
- Ping the router’s default gateway:
Result Pings should succeed.
- Ensure that the router is configured to use the correct DNS server:
- Ping google.com:
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.
- Configure IP addressing on the Internal GNS3 network:
Configuration on the routers:
- Configure OSPF on R1 and R2 and advertise a default route:
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.
- Configure DNS settings on R2:
- 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
- Test R2 connectivity to the Internet:
Result R2 is able to ping devices on the Internet.
- Congratulations! You have configure Internet connectivity from GNS3.