Monday, December 28, 2020

Create your Lab environment over GNS3

 # GNS3


Steps to Install GNS3 

1) go to https://www.gns3.com/software/download

   a) create your account ( free)

   b) download gns3 & VM for GNS3 

2) Depend upon your choice download Hypervisors 

   a) Virtualbox, VMware workstation, VMware player, ESXi, Fusion

   b) i am using Virtualbox

3) Download Virtualbox from Oracle 

   https://www.virtualbox.org/wiki/Downloads

4) Once ready install gns3 and import VM for GNS3 inside Virtualbox 


===== Create your own lab and topology and do the labs =========


## Telnet / SSH / Install Python to make lab ready 

PYTHON3 NAPALM INSTALL:

========================

Use the following commands to install Python3 Netmiko and NAPALM:


apt-get update

apt-get install python3

apt-get install python3-pip

pip3 install -U netmiko

pip3 install -U napalm

pip3 install -U simplejson

!

#pip3 install --upgrade pip


=====

apt-get install git

apt-get install python3-venv


 =====

 Install and Setup

Clone the code to your local machine.


git clone https://github.com/ai-devnet/Getting-started-with-Cisco-SD-WAN-REST-APIs.git

cd Getting-started-with-Cisco-SD-WAN-REST-APIs

Setup Python Virtual Environment (requires Python 3.6+)


apt-get install python3-venv

python3.6 -m venv venv

source venv/bin/activate

pip install -r requirements.txt

========



install wheel 

python3 -m pip install --user --upgrade setuptools wheel

apt-get install pandoc


=======

pip install pan-python

git clone https://github.com/PaloAltoNetworks/pandevice

cd pandevice/examples


pip install --upgrade pandevice


=======

git clone https://github.com/ralph089/nagios_check_paloalto



Data Formats: Understanding and using JSON, XML and YAML




 gagabit.json 


{

    "ietf-interfaces:interface": {

        "name": "GigabitEthernet2",

        "description": "Wide Area Network",

        "enabled": true,

        "ietf-ip:ipv4": {

            "address": [

                {

                    "ip": "192.168.1.2",

                    "netmask": "255.255.255.0"

                }

            ]

        }

    }

}


 gigabit.xml 

 

<?xml version="1.0" encoding="UTF-8" ?>

<interface xmlns="ietf-interfaces">

  <name>GigabitEthernet2</name>

  <description>Wide Area Network</description>

  <enabled>true</enabled>

  <ipv4>

    <address>

      <ip>192.168.1.2</ip>

      <netmask>255.255.255.0</netmask>

    </address>

  </ipv4>

</interface>


 gigabit.yaml

---

ietf-interfaces:interface:

  name: GigabitEthernet2

  description: Wide Area Network

  enabled: true

  ietf-ip:ipv4:

    address:

    - ip: 192.168.1.2

      netmask: 255.255.255.0

  


address_list.json 


{

  "addresses": [

    {

      "ip": "192.168.1.2",

      "netmask": "255.255.255.0"

    },

    {

      "ip": "192.168.1.3",

      "netmask": "255.255.255.0"

    },

    {

      "ip": "192.168.1.4",

      "netmask": "255.255.255.0"

    }

  ]

}


address_list.xml


<?xml version="1.0" encoding="UTF-8" ?>

<addresses>

  <ip>192.168.1.2</ip>

  <netmask>255.255.255.0</netmask>

</addresses>

<addresses>

  <ip>192.168.1.3</ip>

  <netmask>255.255.255.0</netmask>

</addresses>

<addresses>

  <ip>192.168.1.4</ip>

  <netmask>255.255.255.0</netmask>

</addresses>


address_list.yaml 


---

addresses:

- ip: 192.168.1.2

  netmask: 255.255.255.0

- ip: 192.168.1.3

  netmask: 255.255.255.0

- ip: 192.168.1.4

  netmask: 255.255.255.0