Setup a GNS3 Server on AWS EC2 instance

In this topic we will walk through the process of installation GNS3 server on AWS. There are few advantages of this method.
  • Easy access from different sources, we need openvpn client + GNS3 client for this.
  • Scaling or de-scaling based on our needs, we can change EC2 instance type.
  • We can share our environment with others 
Prerequisites:
Steps:
Launch Instance:
Please open AWS Management Console and navigate to Services, Compute,  EC2 and launch new instance

Choose AMI:
As an Amazon Machine Image (AMI) select latest Ubuntu Server

Choose Instance Type:
We will use free tier eligible instance


Configure Instance
You can leave as default if you are going launch instance on default VPC, otherwise please select your VPC on "Network" selection tab.

Add Storage:
Leave as default

Add Tags:
Press "Add Tag" button set Key as "Name" and  value "GNS3Server"

Configure Security Groups:
If you don't have security group, please create new security group and put below rules
  • type-ssh, protocol-tcp, port range-22, source-My IP-, Description- Open ssh port from your network
  • type-custom, protocol-udp, port range-1194, source-My IP, Description- OpenVPN port
  • type-custom, portocol-tcp, port range-8003, source-My IP, Descruption- to download VPN config from server

Review Instance Launch:
In order to ssh instance we need key pair. If you don't have key pair in selected AWS Region  create new one  and download and then launch instance.


SSH to GNS3 Server's public IP address/DNS name using your favorite ssh client.
To install GNS3 server on this server , please run these commands as root
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
This will install all the required packages and setup a VPN. When the installation is done, reboot the server.

The details of arguments that you can pass to the script are:
  • --with-openvpn: Install Open VPN to allow access over insecure network
  • --with-iou: Install IOU
  • --with-i386-repository: Add i386 repositories require by IOU if they are not available on the system. Warning this will replace your source.list in order to use official ubuntu mirror
  • --help: Show the help
  • --unstable: Use the unstable repository (for installing beta, release candidate…)
  • The options with-i386-repository is required only for certain providers where the ubuntu mirror doesn't include 32 bits package (example: packet.net) but you can use it without problem on any host.  The 32 bit package are require for IOU.


Installation and configuration of OpenVPNclient.

Download OpenVPN client:
Please go to this link and download relevant client and install it. After installation, please re connect to GNS3 server instance , you will see something similar.


Please open provided URL on your browser and download the VPN configuration file.

Import Configuration:
OpenVPN client application and import downloaded file then click connect.

Installation and configuration of GNS3 client.

Go to this link and select installer for your OS
Install the application, during the first launch, select "Run appliances on a remote server" option
As a destination host we need to put IP address of tunnel endpoint. Please return back to GNS3server console and copy that address.
On the Setup Wizard page, previously copied address as Host address. We are not using authentication so you can disable it.
When wizard finishes, client will connect to GNS3 server, and you will see something similar below. Now you can start to create your projects.







No comments:

Post a Comment