Skip to content

Instantly share code, notes, and snippets.

@shrutikaponde
Last active December 18, 2020 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrutikaponde/4126e2c66680ba83fbd8a99bfb2f9646 to your computer and use it in GitHub Desktop.
Save shrutikaponde/4126e2c66680ba83fbd8a99bfb2f9646 to your computer and use it in GitHub Desktop.
Install GNS3 on cloud(Azure VM, EC2, etc).

Create Cisco Topology

To configure a Cisco topology, you must first add IOS images to GNS3. Watch this video to understand how to add images and setup Cisco topology.

Example 1: GNS3 topology consisting of two Cisco routers

The official document explains to configure a simple GNS3 topology consisting of two Cisco routers.

Example 2: Set-up Cisco router configuration to receive/forward data packets between computer networks

Final topology snapshot:

CISCO_TOPTLOGY

Open console for respective node and copy following commands.

PC1 configuration:
ip 192.168.10.1 255.255.255.0 192.168.10.2
PC2 configuration:
ip 192.168.20.1 255.255.255.0 192.168.20.2
Router(R1) configuration:

ip address of interface fa0/0 will be same as default Gateway(192.168.10.2) of PC1.

Router>enable
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip address 192.168.10.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int serial0/0
Router(config-if)#clock rate 128000
Router(config-if)#ip address 192.168.30.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.30.3
Router(config)#exit
Router#wr
Router(R2) configuration:

ip address of interface fa0/0 will be same as default Gateway(192.168.20.2) of PC2.

Router>enable
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip address 192.168.20.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int serial0/0
Router(config-if)#clock rate 128000
Router(config-if)#ip address 192.168.30.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.30.3
Router(config)#exit
Router#wr

Test the topology :

  • From PC1 ping 192.168.20.1(PC2)
  • From PC2 ping 192.168.10.1(PC1)

Both should be able to ping sucessfully

References:

Create GNS3 Topology

If the installation was successful you can access VPN at http://172.16.253.1:3080/. Follow these steps to create your first topology.

Work in progress ...

Install GNS3 on Local Linux Machine (Ubuntu 16.04)

Steps:

  1. Install Dynamips and Ubridge

    sudo apt install dynamips ubridge
    
    • Verify installation
    dynamips
    ubridge -v
    
  2. Install Virtual PC Simulator(VPCS)

    • Download vpcs and extract the zip.
    cd vpcs-0.6.2/src
    ./mk.sh 64 # i386 | amd64 | 32 | 64 ---> mention any of the option
    sudo mv vpcs /usr/local/bin
    
    • Verify the location and version for VPCS
    which vpcs
    vpcs -v
    
  3. Install QEMU

  4. Install Docker

  5. Install Wireshark

  6. Install GNS3 Create a python virtual environment and install gns3-server, gns3-gui and other dependencies inside virutal environment:

    python -m venv ~/.gns3-venv
    source /home/user/.gns-vnev/bin/activate
    pip install -U gns3-gui gns3-server PyQt5-sip pyqt5==5.14.0
    

    The steps to install other dependiences ar not mentioned here. Please check official documentation to install all dependencies.

  7. Launch GNS3 gui with command:

    gns3
    

    If installation was successful, it will launch the application.

Errors:

Error 1

2020-12-17 19:48:15 CRITICAL topology.py:258 uBridge is not available, path doesn't exist, or you just installed GNS3 and need to restart your user session to refresh user permissions.

Restart your machine or change ubridge permissions using following command:

sudo chmod 777 /usr/bin/ubridge

Error 2

No path to a VPCS executable has been set

Download vpcs. Go to Edit > Preferences > VPCS Preferences > Set Path to a VPCS executable. You may need to restart GNS3.

Install GNS3 on Cloud (Azure VM, EC2, etc)

Steps:

  1. Create the remote server
  • To create a Linux virtual machine in the Azure portal follow these steps.

  • To create Amazon EC2 Linux instance follow these steps.

  1. Open port 1194 for the remote server.

  2. Install GNS3 on a remote server Commands:

    cd /tmp
    curl https://raw.githubusercontent.com/GNS3/gns3-server/master/scripts/remote-install.sh > gns3-remote-install.sh
    bash gns3-remote-install.sh --with-openvpn --with-iou --with-i386-repository
    

    Explaination for commands is provided here.

  3. Download the certificate. You can also find the certificate in /root/client.ovpn. You can also use scp command. First copy /root/client.ovpn to /home/<remote_user>, then you can use scp to copy it locally.

    scp <remote_user>@<remote_ip>:/home/<remote_user>/client.ovpn client.ovpn
    
  4. VPN connection on local Linux

    sudo apt-get install openvpn
    sudo openvpn --config client.ovpn --auth-retry interact
    
  5. VPN connection on Windows Download and install OpenVPN for Windows.

    • Click on “Show Hidden Items” in the Taskbar
    • Right-click on “OpenVPN-GUI”, and select “Import file”
    • Select the .ovpn file you downloaded, and click “Import”
    • Right-click on “OpenVPN-GUI” again, and select “Connect”
  6. If the VPN works, this page should work: http://172.16.253.1:3080/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment