Top Banner
 1 GNS3 1.2.X in the “Cloud” using CentOS 7.X  Document Owner: Gian-Luca Casella (gcasella) Email: gcasella@casellan etworks.ca Website: http://www.casellanetworks.ca  (Under Construction) Version: 1.3 
29

GNS3 on CentOS 7.X in the Cloud v1.3

Nov 03, 2015

Download

Documents

Manual
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 1

    GNS3 1.2.X in the Cloud using CentOS 7.X

    Document Owner: Gian-Luca Casella (gcasella)

    Email: [email protected]

    Website: http://www.casellanetworks.ca (Under Construction)

    Version: 1.3

  • 2

    This document in full will provide detailed instructions on how to have your GNS3 installation accessible anywhere and everywhere without burdening your local machine with the resources required to run multiple Cisco IOU devices. The

    main purpose of this document is to allow an end-user running the GNS3 client on their Windows 7/8.X machine, and

    connect to their remote GNS3 Server installation. This document does not go through the procedure of installing and

    configuring ESXi 5.5 or OwnCloud services.

    The hardware/software I have used to accomplish this is as follows;

    - I have a dedicated ESXi 5.5 Server.

    - 1 Virtual Machine configured as my OwnCloud server.

    - 1 Virtual Machine configured as my GNS3 Server running CentOS 7.X.

    - The OwnCloud Client installed on both my GNS3 Server Virtual Machine running CentOS 7.X and my Windows

    7/8.X Laptop.

    Note: Using DropBox for this solution should work the same way. Also at the end of this document will include items I

    still have yet to accomplish.

    This document is broken up into 4 sections;

    Section 1: Install and set up GNS3 Server on CentOS 7

    Section 2: Install and setup GNS3 Client on Windows 8

    Section 3: Test your new configuration

    Section 4: Additional Information and Issues

    Section 5: Revisions

  • 3

    Section 1: Install and set up GNS3 Server on CentOS 7

    This section will provide detailed instructions on how to only install the GNS3 Server application on your CentOS 7.X

    system. Note: this tutorial should work on any variant of Linux you prefer.

    Pre-requisites Before beginning with the installation of GNS3 1.0, you will need necessary packages to be installed on the system. This section will go over what is needed. Note that all these commands will need to be used as root unless stated. Development tools will need to be installed (this can be done during the initial installation of CentOS 7.x, or you can use the following command as root to install the necessary packages;

    yum groupinstall Development Tools Next, youll need to install some additional packages in order to begin the process of building your GNS3 environment on CentOS, also its recommended to perform a system update, issue the following two commands. yum update y yum install telnet openssl-devel cmake elfutils-devel uuid-devel libuuid-devel libpcap-devel iniparser

    iniparser-devel wireshark wireshark-devel wireshark-gnome pyqt4-devel If running 64-bit centos you need to install 32-bit openssl libraries use; yum install openssl-devel.i686 openssl-libs.i686 then run the command ln -s /usr/lib/libcrypto.so.1.0.1e /usr/lib/i686/libcrypto.so.4

    Next its recommended to disable SELinux to do so edit the /etc/sysconfig/selinux file and replace enforced with disabled

    # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced.

    # permissive - SELinux prints warnings instead of enforcing.

    # disabled - No SELinux policy is loaded. #SELINUX=enforced SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection.

    SELINUXTYPE=targeted Once all the above tasks are completed it is again recommended to reboot your system to ensure everything takes effect before moving forward.

    Python3 Installation Youll need Python3 to proceed with the following sections, you can install Python3 by using the commands note this will install setuptools automatically for you;

    cd /tmp && wget https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz tar zxvf Python-3.4.2.tgz cd Python-3.4.2

    ./configure --enable-shared && make && make install To ensure your Python3 installation works correctly make sure you edit the /etc/ld.so.conf file and add "/usr/local/lib" (without quotes) on its own line, save the file and run the ldconfig command.

  • 4

    GNS3 SERVER INSTALLATION In order to start installing the GNS3 1.0 Server youll need to install some additional Python3 packages, use the following commands to accomplish this;

    pip3 install gns3-server pip3 install pyzmq pip3 install tornado pip3 install netifaces pip3 install jsonschema pip3 install setuptools

    git clone https://github.com/gns3/iouyap cd /home/username/Downloads/iouyap make && make install

    To install the most up to date version of the above packages use the option --upgrade with pip3, for example pip3 install setuptools --upgrade Note: GNS3 Server works fine using the most up to date version of tornado. Running pip3 install gns3-server should automatically install most if not all pre-requisites for GNS3 to run properly. If you chose to obtain the most up to date GitHub of GNS3 server using the git clone https://github.com/GNS3/gns3-server you can complete this action using the following commands; cd /home/username/Downloads/gns3-server python3 setup.py install Important Note: If you plan to follow this document exactly, and you plan to have your GNS3 Client on Windows 7/8.X pleas refrain from using the GitHub clone as the Client and Server must have matching versions to work properly.

    This completes the installation of the GNS3 server on CentOS 7.X, as the non-root user you can run the server by using the /usr/local/bin/gns3server command, or add this GNS3Server.desktop file to your ~/Desktop directory and set the appropriate permissions;

    [user@gns3-iouvm ~]$ vi ~/Desktop/GNS3Server.desktop

    [Desktop Entry] Name=GNS3 Server Exec=/usr/local/bin/gns3server Path=/usr/local/bin Terminal=true

    Type=Application Categories=X-Red-Hat-Extra;Network;GTK;X-Fedora;

    Save and exit the file and set the appropriate permissions [user@gns3-iouvm ~]$ chmod 777 ~/Desktop/GNS3Server.desktop

    Important Note: By default the installation and configuration of the GNS3Server will automatically create a directory called ~/GNS3/projects in your home directory. In order to use this cloud based solution, you will need to modify line number 96 the /usr/local/lib/python3.4/site-packages/gns3_server-1.2.3-py3.4.egg/gns3server/server.py file with the appropriate directory that synchronizes with your OwnCloud / DropBox account. For example, the screenshot below shows I have configured my GNS3 Server to make its active directory ~/ownCloud/GNS3/projects

    Next we will need to enable some rules on the firewall in CentOS 7.X. Run the following commands in order to open

    the ports required by the GNS3 Server to allow for remote connections;

  • 5

    firewall-cmd --permanent --zone=public --add-port=8000/tcp firewall-cmd --permanent --zone=public --add-port=3501-5000/tcp firewall-cmd --reload

    One completed, you can go ahead and start your GNS3 Server and move onto the next section to set up your GNS3 Client on Windows 7/8.X. If you are interested like myself to get the GNS3 Server to start on boot up as your designated user you can perform the following steps this has been testing and is fully functional. This is a very simple procedure with CentOS 7.X by using the systemd that is included with the operating system;

    As root create the following file /etc/systemd/system/gns3server.service with the following information;

    [Unit] Description=gns3server Service After=network.target

    [Service] Type=simple

    User= Group= ExecStart=/usr/local/bin/gns3server --quiet TimeoutSec=30

    [Install] WantedBy=multi-user.target

    Save and close this file and run the following set of commands;

    After reboot, log in as your non-root user or your user you set to run gns3server with and run these simple commands which can show that the service started successfully, you should expect similar output;

    The ps aux | grep gns3server Shows all processes running as expected

    The netstat aunt | grep 8000 shows my GNS3 client connecting to my gns3server remotely.

  • 6

    The tail -n 100 /var/log/messages | grep gns3server command will show in your system log messages the server

    starting successfully and whenever you start adding and powering on new devices. (I know the image is very hard to interpret)

  • 7

    Section 2: Install and setup GNS3 Client on Windows 8

    First youll need to download and install the GNS3 Client for Windows from the GNS3 Website. Before we begin with

    the configuration of the client, make sure you have your iourc.txt stored in your C:\Program Files\GNS3 directory.

    Once installed go ahead and start the application and follow the next set of instructions and screenshots.

    Open the GNS3 Client preferences and set My projects: to the folder where your ownCloud or DropBox synchronizes

    in my example you will see I have selected my ownCloud\GNS3\projects the same I configured in the server.py file;

    Next configure the GNS3 Server if you dont want the server to start on your Windows 7/8.X remove the data

    entered in the Path: field and uncheck the Automatically start the server on startup;

  • 8

    Move to the Remote Servers tab to enter the settings of your remote GNS3 server, as you can see I have my GNS3

    Server set up at 192.168.1.11 on port 8000;

  • 9

    Once completed press Apply but dont close this window yet, the next steps will show how to set up IOU. To do so

    click on the IOS on UNIX and browse for your iourc.txt file which will be pushed to the GNS3 Server and then move

    onto the Server settings tab;

  • 10

    Make sure the Always use the local server (Linux only) is unchecked;

  • 11

    Once complete, click Apply and move to the IOU devices section of the preferences, once you arrive to that

    screen, click on New to add a new IOU device;

  • 12

    Click Next and enter the path of your IOU .bin file that is located on your remote server for example and then click

    Finish;

    Now youre done with the configuration; you can go ahead and press Apply and OK to close off the preferences of

    GNS3. It is best to restart the client fully before testing.

    The next section will cover the testing of this new configuration.

  • 13

    Section 3: Test your new configuration

    Here we go, time to test out your new configuration of GNS3. Open up the GNS3 client and create a new project and

    start adding your new IOU device to the topology the project name for this document is CentOS7_Doc;

    These screenshots shows the first screenshot I added 3 IOU devices, 2 routers and 1 switch. Screenshot two is a

    snippet from my GNS3 Server running on CentOS 7.X.

    Once completed you can shut down your devices and save your project once you save your project you will see all of

    your files have synchronized.

    Windows 7/8.X

    CentOS 7.X GNS3 Server

    The next section will go over some tips and tricks that Ive come across while trying to complete this task.

  • 14

    Section 4: Additional Information and Issues

    If you wish to have VPCS run on your remote server you can complete this by performing the same instructions for

    the GNS3 Server. Ensure that you point your VPCS settings to your remote server.

    Ive stumbled across a few issues while trying to complete this little project. They are listed below in no particular

    order;

    1) Remote VirtualBox manager I wanted to set up Virtual Box Virtual Machines on my CentOS 7.X GNS3 Server

    and set up my Windows 7/8.X GNS3 Client to use those virtual machines, when doing so I got the exception

    log below;

    2) Using Wireshark for packet captures, it seems because the project directory is showing in a Linux format and

    pointing to a completely different directory I get the following error;

    It would be nice to change the working directory that your Wireshark looks in for all *.pcap files.

    I have yet to run into any other issues. If there is any other information that others would like to know or additional

    information that I could add to this document please feel free to contact me at [email protected].

    One thing I love about this is that weather Im at work, at a friends house, at home, or at a coffee shop, as long as I

    have the GNS3 client installed configured with my ownCloud Client and/or DropBox client, I will have all my topologies

    wherever I am and use any computer I wish.

  • 15

    Many people have been asking about dynamips as well. Below youll see my success with dynamips and my setup

    described throughout the document.

    First youll need to get the dynamips install from https://github.com/GNS3, to set up and configure it please follow the

    steps below.

    [root@gns3-iouvm ~]# cd /tmp && git clone https://github.com/gns3/dynamips

    [root@gns3-iouvm ~]# cd dynamips && mkdir build && cd build/

    [root@gns3-iouvm ~]# cmake .. && make && make install

    At the end of the installation your dynamips will be installed in /usr/local/bin/dynamips. To test your installation

    run the command /usr/local/bin/dynamips H 7200.

    Once successful were going to need to open up some more firewall rules on the CentOS 7.X gns3server for dynamips;

    firewall-cmd --permanent --zone=public --add-port=2001-3000/tcp

    firewall-cmd --permanent --zone=public --add-port=7200-7700/tcp

    firewall-cmd --reload

    After dynamips is installed and configured I copied a Cisco IOS image to the following directory

    /home/gcasella/ownCloud/GNS3/dynamips.

    Next a series of screenshots will show the configuration of your GNS3 client on Windows 7/8.X for dynamips on your

    remote server;

  • 16

    In the GNS3 client preferences, youll want to select Dynamips and set the following parameters. Ensure the Path

    to Dynamips is set to where it installed on your CentOS 7.X gns3server install. In this case it installed in

    /usr/local/bin/dynamips. Next move to the Server Settings tab and make sure the Always use the local server

    option is unchecked.

  • 17

    Next, hit Apply and move to IOS Routers under the option for Dynamips, we will start the configuration of a new

    device. When you arrive to that screen click on New and follow the next set of screenshots;

  • 18

    Select the remote server you wish to use and then hit Next, the path for your IOS image is the location on your

    CentOS 7.X gns3server as shown below;

    Once set, hit Next and select the appropriate Name, Platform, and Chassis information for the IOS Image that

    you selected, when completed click Next and select your Default RAM for the device for this example I am using

    a Cisco 2691 Router image;

  • 19

    The last part of adding your device would be to select which network interfaces you want and how many of them, Ive

    selected the default Slot 0: GT96100-FE and added wic 0: WIC-2T to this device;

  • 20

    Once completed click Finish and see your new device added to the list of IOS Routers

  • 21

    Lastly, hit Apply and OK and start building your topology. The next set of screenshots will show both the topology and

    the log messages from the CentOS 7.X gns3server.

  • 22

    Power on the devices and watch the Log messages generated;

  • 23

    Next you can just console to your devices and start configuring IP address configuration and a quick ping test will

    show the devices working as expected;

    This concludes the set up and configuration of dynamips on a remote GNS3 server running on CentOS 7.X.

  • 24

    Next we will go through the installation of QEMU on your remote gns3server running on CentOS 7.X and connecting to

    it via your Windows 7/8.X machine. First youll need to install QEMU on CentOS 7.X in order to install all of the binary

    files needed you can do this by using the yum install qemu -y command. Follow the next set of steps to get yourself

    setup.

    Next, download your favourite QEMU .img file from the GNS3 website or any other source, for this tutorial Ive

    selected linux-microcore-4.0.2-clean.img. Ive placed this file in my ~/ownCloud/GNS3/images/qemu/ directory.

    Before moving forward with the configuration of your GNS3 client you will need to open the range of ports needed for

    QEMU on your CentOS 7.X gns3server by using the following commands;

    firewall-cmd --permanent --zone=public --add-port=5001-6000/tcp

    firewall-cmd --reload

    Now we will configure your GNS3 client on Windows 7/8.X to use your remote gns3server to run your QEMU images.

    First open your preferences in GNS3 and select QEMU and make sure the Always use the local server option is

    unchecked;

    Once set, select QEMU VMs and start creating your new QEMU machine, select New and follow the next set of

    screenshots;

  • 25

    Next give your QEMU host a name, for this documentation Ive named it GNS3 Server Documentation, once youve

    named it click Next and proceed;

  • 26

    Next select the Qemu binary: of your choosing and RAM allocation for your QEMU VM, for this Ive selected qemu-

    system-x86_64 and the default 256 MB of RAM, click Next and proceed;

    Next youll need to select your Disk image (hda):, this image must be located on your gns3server in order for it to

    run properly. Once youve selected your Disk image, press Finish, then Apply and start creating your topology.

  • 27

    After playing around with this, Ive noticed that specific options need to be configured in the advanced settings of the

    QEMU image, after you finish your addition of your new QEMU VM, click on Edit and then Advanced Settings and

    enter the additional Options: the reason for this is because of it being remote there is no way to remotely

    manage the devices unless its through the serial/console session, without these options it appears a

    connection refused will occur;

  • 28

    Next you should be able to console to all of your devices and configure them as you wish below I configured simple

    IP Addressing and issued a ping test;

  • 29

    Section 5: Revisions

    January 28, 2015 Added instructions to get gns3server to start on boot-up on CentOS 7.X using systemd. Updated document to Version 1.1

    January 30, 2015 Added instructions to install and set up dynamips on a remote CentOS 7.X gns3server. Updated document to Version 1.2

    February 2, 2015 Added instructions to install QEMU and set up the GNS3 client to connect remotely for QEMU VMs Updated document to Version 1.3