gns3 installation and detailed use tutorial

How to install GNS3

1. Preparation

The GNS3 software supports both virtual machine and physical machine modes. We recommend using the virtual machine mode, so before installing the
GNS3 software, make sure that the virtual machine software is installed on your computer. VMware software is recommended.

It is recommended to install the latest VMware workstation 15.5 in the Windows environment and VMware Fusion 8 or higher in the MAC environment.

If you do not plan to use the virtual machine mode, you can complete most of the experimental content, but some specific experimental content cannot be completed, such as: When using a wireless network card and in the network environment of the bedroom, the virtual device in GNS3 cannot connect to the external real network.

Required software

Windows Macos Virtual Machine Cisco router IOS
version 2.1.9 (tutorial version) version2.1.9 version2.1.9
GNS3-2.1.9-all-in-one.exe GNS3-2.1.9.dmg GNS3.VM.VMware.Workstation.2.1.9.zip Cisco router IOS image file (3725)
GNS3-2.1.19-all-in-one.exe GNS3-2.1.19.dmg GNS3.VM.VMware.Workstation.2.1.19.zip Cisco router IOS image file (3745)

Second, install the GNS3 virtual machine

  1. After the installation of the virtual machine software VMware is completed, download the GNS3 virtual machine corresponding to the operating system according to the operating system. After decompression, the file name is GNS3 VM.ova, as shown in the following figure. Then import the virtual machine file in VMware.
    gns3 installation and detailed use tutorial
    gns3 installation and detailed use tutorial

  2. The storage path can be customized. After the virtual machine is imported, it may not be run temporarily. It will run automatically when the GNS3 software is started later.

  3. Set the network card connection mode below, using the bridge mode
    gns3 installation and detailed use tutorial

3. Install GNS3 software

  1. The downloaded GNS3 installation program is shown below, click to install
    gns3 installation and detailed use tutorial

  2. When you choose to install components, if you have already installed wireshark on your computer (recommended to install it in advance), you can leave wireshark unselected, otherwise you will have to download it from the official website again, which will be very slow. Checking Dynamips, VPCS, GNS3 is mandatory.
    gns3 installation and detailed use tutorial

Note: It is recommended to customize the installation path, do not install it in the C drive.

  1. When asked if you need a free Solarwinds Toolset License, check No.

Fourth, the initial operation initialization

Please turn off *** on the computer before running GNS3 to avoid unknown network connection errors.

  1. When the software is run for the first time, it will ask which server to use. If the virtual machine Vmware is installed on this machine, please select the first item, otherwise please select the second item
    gns3 installation and detailed use tutorial

  2. Select the IP address and port of the local server. When the virtual machine is installed, multiple IP addresses will appear. Please select the IP connected to the physical network (such as the school network). It is recommended to select 127.0.0.1, so that when the network environment changes, you can still connect to the GNS virtual machine. Please check whether the default port is occupied by other programs. If it is occupied, replace a port or exit the program occupying the port.
    gns3 installation and detailed use tutorial

  3. Select the virtual machine. The GNS3 VM installed before will automatically appear in the VM name. If you forgot to install it before, you can also import the virtual machine according to Section 2 and press Refresh.
    gns3 installation and detailed use tutorial

After clicking Next, wait for the virtual machine to start up. The interface after the virtual machine is successfully started is as follows, displaying information such as the IP address of the machine (basically no need to operate this virtual machine later):
gns3 installation and detailed use tutorial

  1. Add 1 IOS image file from Cisco physical device (please download the 3725 or 3745 model file from the website first).
    gns3 installation and detailed use tutorial

Choose to run the IOS image from the GNS virtual machine:
gns3 installation and detailed use tutorial

  1. Select an image file from disk and unzip
    gns3 installation and detailed use tutorial

  2. Select the correct platform model based on the image file. If there is a warning that the model cannot be automatically detected, just ignore it.
    gns3 installation and detailed use tutorial

  3. Choose the memory size according to the image file. If the computer has less memory, it can be reduced to 128M.
    gns3 installation and detailed use tutorial

  4. In order to facilitate the experiment, add 3 Ethernet interface modules (which can also be added separately later):
    gns3 installation and detailed use tutorial
  5. According to experimental needs, add other modules (optional), NM-16ESW is a 16-port Ethernet switching module, NM-4T is a high-speed serial port module.
    gns3 installation and detailed use tutorial
  6. According to the needs of the experiment, add other module WAN blocks (optional), WIC-2T is a high-speed serial port module.
    gns3 installation and detailed use tutorial

  7. Set the device's Idle-PC value. Click Idle-PC-finder to automatically set the IDLE-PC value to avoid 100% of the host's CPU resources during runtime.
    gns3 installation and detailed use tutorial

  8. So far, we have created a Cisco IOS template. Click OK to enter the main interface. Give this project a name. You can also open previously saved projects.
    gns3 installation and detailed use tutorial

GNS3 detailed tutorial

V. Introduction to the main interface

  1. After entering the main interface, the buttons on the left side mainly have operations such as opening / closing the IOS model library list, opening / closing the PC library list, and connecting device network cables.
    gns3 installation and detailed use tutorial

  2. The buttons in the upper row are mainly used to save and open projects, run / pause / stop all devices. Click the run / pause / stop icon, all devices will run / pause / stop, or you can click a device to stop / run. The device will not automatically save the running configuration when it is stopped, so before stopping, make sure that the configuration has been saved by the write command in the device.

  3. The following is the GNS3 console, you can enter commands

  4. On the right is the device status and server resource consumption status (the more devices, the more resource consumption)

Six, add equipment

  1. Click the icon to open the IOS model library, there will be many models, but most of them do not have an installation image file, so they can not be used. Select Installed appliances in the drop-down list of Routes to display only the devices with installed image files.

  2. Drag one of the devices with the mouse to the middle window, and a device is automatically added. Right-click on the device and the menu appears. Can be configured, enter the Console port, start / stop.
    gns3 installation and detailed use tutorial

7. Start the device

Right-click on the device and the menu appears. Click Start to start the device. Right-click again and select Console from the menu to enter the device's console.
gns3 installation and detailed use tutorial

When the console device has just started, it will print a lot of information, waiting for the completion of startup, press the Enter key to appear >prompt. As shown below:
gns3 installation and detailed use tutorial

Note: Here you can bind the terminal emulation software used on your computer with GNS3, such as SecureCRT. For details, please refer to: How to associate SecureCRT with GNS

Eight, configuration equipment

First stop the device, then right-click on the device and select Configure from the menu to configure the device. If the computer has less memory, you can reduce the memory allocated to the router
(RAM size in Memories and disks). Click Slots to increase or decrease the network module.
gns3 installation and detailed use tutorial

Nine, connected equipment

  1. Click the network cable icon on the left, then click the first device, select the port to connect, then click the second device, select the port to connect. Red means not connected, green means connected. Only the red ones can be connected.

  2. If the connection is completed and you do not want to continue the connection, click the red cross on the left network cable icon.

  3. If you want to remove the connection, right-click delete
    gns3 installation and detailed use tutorial

Ten, set the appropriate Idle-pc value

When there are many devices, it may cause the CPU of the host to reach 100%, so the Idle-PC value needs to be adjusted automatically. Select a device, right-click, and select Auto Idle-PC in the pop-up menu, then the same type of device will recalculate the optimal value. The CPU utilization of the host will also drop.
gns3 installation and detailed use tutorial

11. Increase PC

Click the PC icon on the left, select VPCS in the list, and drag to the middle window. Select GNS3 VM as the server to run. Click the network cable icon on the left to connect the PC and the device. The difference between VPCS and Host is that VPCS is a complete virtual device and is not connected to the real network. Host is a virtual device connected to the real network using the host's network interface, which means that Host can communicate with devices on the real network (configured to communicate with The same subnet address as the real network is enough).
gns3 installation and detailed use tutorial
gns3 installation and detailed use tutorial

Twelve, increase the network cloud

  1. Click the PC icon on the left, select Cloud in the list, and drag to the middle window. Select GNS3 VM as the server to run.

  2. Click the network cable icon on the left to connect Cloud to the device. Select the appropriate port according to the experimental requirements (three ports correspond to the three network card modes, see the description below).
    gns3 installation and detailed use tutorial

  3. By looking at the VMware virtual machine settings, we see that by default, three network cards are installed on the virtual machine, using host mode, NAT mode, and bridge mode (see the figure below).
    gns3 installation and detailed use tutorial

  4. According to the experimental requirements, if only private network communication with the physical machine, select only the network interface corresponding to the host mode (ie eth0), if you want to share the external communication using the physical machine IP, select the NIC mode corresponding to the NIC interface (ie eth1 ), You need to use an independent IP on the same network segment as the physical machine to achieve external communication, then select the NIC interface (eth2) corresponding to the bridge mode.

  5. Generally, you can use the host mode. In this case, the router can only communicate with the software on the physical machine, for example, different virtual machines can access each other. If you need to access other servers than the physical machine, you can use NAT mode or bridge mode. In NAT mode, the router accesses outwards with the IP identity of the physical machine. Some functions may not be able to be experimented. For example, other external devices other than the physical machine ping the interface IP of the router. The bridge mode is that the router accesses outward with an independent IP identity. From the outside, it appears that there are two devices, the physical machine and the router.

  6. When using the bridge mode, the external physical network environment may affect the router's IP communication. For example, the external network needs to provide a DHCP server before the router can dynamically obtain an IP address. Otherwise, the IP address needs to be set manually; if the external network has restrictions on the MAC address, The router's MAC address may not be in the allowed list, so it cannot communicate with the external physical network.

Thirteen, save the configuration

The configuration of the router is divided into a startup configuration and a running configuration. The changes are saved in the running configuration. After restarting, the configuration is run according to the startup configuration. Therefore, before stopping the operation, use the write command to save the configuration. If an error warning appears after entering the write command, do not force it, otherwise it will not start after restart. You can only exit GNS3 at this time. So how to solve this problem?

Method 1 : Replace the router image file of different models (such as 3745 to 3725 or other).

Method 2 : Right-click on the router, select Edit Config on the menu, and then select private-config, copy the configuration content to the text box, and click Save.
gns3 installation and detailed use tutorial

Method 3 : Copy and paste the command into the console at one time

Fourteen, layer two switch

The emulator comes with a Layer 2 switch
gns3 installation and detailed use tutorial

The function of the Layer 2 switch is relatively simple, and only supports simple VLAN settings. Click the right mouse button on the Switch and select the configure menu function, you can set the VLAN to which each port of the switch belongs, or you can set the port to Trunk mode (select dot1q):
gns3 installation and detailed use tutorial

Fifteen, use a router to simulate a layer 3 switch

  1. After adding the switch module to the router, it can be used as a layer 3 switch. First turn off the router, then right-click the router, select the Configure menu function, and first change the device name to Switch, which is convenient for distinguishing ordinary routers:
    gns3 installation and detailed use tutorial

  2. On the Memories and disks tab, add a memory card (otherwise VLAN data cannot be saved):
    gns3 installation and detailed use tutorial

  3. Click on the Slots tab to add the NM-16ESW switching module to the free Slots:
    gns3 installation and detailed use tutorial

  4. Double-click to enter the configuration window, you can see the interface names of the Switch module. These interfaces cannot be configured with IP addresses, but you can configure the VLAN to which they belong:
    gns3 installation and detailed use tutorial

16. Address binding

By default, the first network interface of the GNS VM is in host mode, and the IP address is assigned by VMware, if the virtual machine environment is reconfigured; or when you select the IP address of the physical network interface during installation As the host binding address, when the physical network environment changes, the IP address of the GNS VM may change, so the GNS software cannot connect to the GNS VM according to the original IP. In this case, you need to enter the Edit -->Preference menu to modify the Server ’s Host binding is the new IP address. It is recommended to change this address to 127.0.0.1 so that there is no need to change it later:
gns3 installation and detailed use tutorial

17. ATM switch

gns3 installation and detailed use tutorial

  1. The function of this ATM switch is relatively simple and only supports simple tunnel setup. Click the right mouse button on the Switch and select the configure menu function to set up a tunnel. A tunnel consists of a pair of source and target. Each source or target is composed of Port, VPI, and VCI. Port represents the physical port of the switch. Can be connected with router;

  2. In ATM, VPI stands for Virtual Path Identifier, and VCI stands for Virtual Channel Identifier. A virtual path can contain multiple virtual channels, and VPI + VCI uniquely represents a virtual circuit.
    gns3 installation and detailed use tutorial

After the tunnel is established successfully, the router or other switches can be connected to the ports of the ATM switch. Multiple tunnels can be established as needed.

18. Frame Relay Switch

gns3 installation and detailed use tutorial

  1. The FR switch function is relatively simple, and only supports simple data link settings. Click the right mouse button on the Switch and select the configure menu function to set the data link. A data link is composed of a pair of source and target. Each source or target is composed of Port and DLCI. Port represents the physical state of the switch. The port can be connected to the router; in FR, DLCI stands for Data Link Connection Identifier.
    gns3 installation and detailed use tutorial

  2. Once the data link is established, the router or other switches can be connected to the ports of the FR switch. Multiple data links can be established as needed. A physical port can create multiple data links with different DLCIs, and then use sub-interfaces to configure, for example, R5 connects to Port 1 in the following figure, you can create 2 data links to connect R7 and R9, respectively 1: 101-10 : 202, 1: 102-11: 203.
    gns3 installation and detailed use tutorial

Refer to the zhang0peter article to complete

Guess you like

Origin blog.51cto.com/13909428/2486676