12/1/2021

Gns3 Ansible

Description

Oct 06, 2020 Ansible Initial Setup – 2 (Actual setup) In my experimental setup i’ve used the Graphical Network Simulator-3 (GNS3) in Windows which is a network software emulator and allows the combination of virtual and real devices, used to simulate complex networks. Install and setup GNS3, GNS3-VM and how to integrate GNS-VM to GNS3-GUI. Learn Network Automation with GNS3 and Ansible. Do you want to program networks using Ansible, but not sure where to start? Well, this course will show you how you can start programming Cisco networks within 30 minutes. This course was created for network engineers. Sep 10, 2017 Ansible & GNS3 Lab With the constantly moving landscape in IT it’s always worth your while to get to know new stuff, if nothing more than to know what someone in a meeting is talking about. To that extent I’ve recently been playing around with Ansible, which is a method to automate IT infrastructure – Networking kit in my realm. Ansible-Galaxy collections repository for GNS3 Server REST API using gns3fy - see the docs. Ansible-Galaxy collections repository for GNS3 Server REST API using gns3fy - see the docs.

Learn Network Automation with GNS3 and Ansible.

Do you want to program networks using Ansible, but not sure where to start? Well, this course will show you how you can start programming Cisco networks within 30 minutes.

Gns3 ansible

This course was created for network engineers. There are too many other Ansible courses out there that try to make network engineers server administrators. They concentrate on server administration, installation of software packages and other server admin tasks.

This course is different.

This course is practical. I won't talk about programming in abstract terms and make you wait before you can start automating networks. I will show you how you can quickly and easily start network programming by using GNS3, Cisco IOS and Ansible.

You will see demonstrations of the configuration of both Cisco routers and switches in GNS3. For example, how to configure multiple VLANs on a multiple switches, or how to configure OSPF on a router and more much more.

Learn how you can use Ansible to troubleshoot networks! Use a single Ansible command to retrieve mac address table information from multiple switches in seconds. Then pipe the output to a regular expression to filter down to a single MAC address.You will never troubleshoot networks the same way again!

This course shows you practical examples of using Ansible to programmatically configure Cisco network devices rather then just talking about it.

The days of configuring Cisco networks only with the command line interface (CLI) are drawing to a close. You need to add network programmability using Ansible to your skill set.

Learn how to automate networks using:

- SSH

- Ansible Network modules

- Ansible Playbooks

- Ansible ad hoc commands

Don't reinvent the wheel. Use the tools available to you to quickly and easily automate your networks.

Here are some comments about my automation courses:

Gns3

'Knowing the material from just the first video would have saved me hours of work and rework in the past.'

'It's the easiest, most fun, and most valuable course I've completed yet on Python Programming for Networking. Love it! Thanks again David!!!' Darby Weaver

'Excellent course on Network Programming using Python with lot's of practical network configuration examples.'

'Great way of explanation.Nice video and inspiring words! Thank you so much David. You are genius.'

'I've been doing network automation for a while, even so, I've learned new things through this course. The instructor start from a basic example, adding improvements in each step. It's a skill that's worth it.'

'A must for all network engineers who want to learn python!!! I had very 'very' basic programming skills, and couldn't just get the bridge between network and programming (mainly Python - since that's where the hype is now), this course was amazing, I have never been glued to a training course since I can remember. The couple of things I loved the most about this course: 1- David's clear voice. 2- Real world application, not only will David interduce different real-world practical modules that you can import and use, but he shows you how to apply them on ios devices.'

'Excellent course on Network Programming using Python with lot's of practical network configuration examples. High quality content.'

if coupon works please click

This is the first post of a series on setting up an Mega-lab for Network Automation in GNS3 with around 1000 devices in the network, thanks to Dmitry Figol and his Network Automation marathon. To set up a big lab, we need to automate as much as possible all the steps. For example, we have to setup SSH key on each device so that we can connectto it using different management platforms, including Ansible, Python netmiko, Nornir. It would be very a heavy task if we have to set up the SSH key manually on 1000 routers. Also, the configurations of IP addresses for all devices are tedious considering a huge number of devices. A good solution would involve the use of a DHCP server to assign IP address for each device automatically when it starts up.

We will go through the following steps using Zero-Touch Provisioning (ZTP) approach.Zero-touch provisioning promises that you can install new devices without moving your hands. To someone who is used to connecting a console cable to each and every device, this can seem like wondrous magic. The process of installing a new device with ZTP instead of doing the same thing manually is a breeze. One thing that a lot of people forget about this process is that all the hard work lies in the preparation. A very good reference on ZTP can be found here.

We set up the topology with the following details in mind.

  • Networks:
    • Host-only: VMnet1 - 192.168.134.0/24
    • NAT: VMnet8 - 192.168.100.0/24
  • Ubuntu-desktop-control-station:
    • Connect to VMnet1 at 192.168.134.130
    • Connect to VMnet8 at 192.168.100.147
  • GNS3:
    • Router image: i86bi-linux-l3-adventerprisek9-15.5.2T
    • The startup-config is here
    • Note: this startup-config has to be copied in 2 folders in order to work.
      • In the host machine: C:UserskimdoGNS3configsmega-lab-router.txt (kimdo is my computername).
      • In the GNS3 vm: /GNS3/projects/
  • IP Adressing:

Our goal is to automate the Zero Touch Provision to bring up the lab, as canbe seen in the following demo.

  • Automatically add routers to the topology using GNS3 APIs.
  • Set up the DHCP server, so that when each router is added and started up, it will receivean assigned IP address based on router name, and where it is connected in the network.

1.1. Define the initial topology

The topology is defined as in figure below.

The topology is built with three layers: ACCESS, CORE, and EDGE.

Configure EDGE router

The steps are as follow:

  • Generate RSA key for ssh connection
  • config e0/0: 192.168.134.101
  • config e0/1: 10.15.200.100
  • config lo0: 10.13.100.100/32
  • config EIGRP:
  • Add static route and redistribute under EIGRP

Configure CORE1 router

The steps are as follow:

  • Generate RSA key for ssh connection
  • config e0/0: 10.15.200.1
  • config e0/1: 10.15.1.254
  • config lo0: 10.13.1.1/32
  • config EIGRP

Configure R1

The steps are as follow:

  • Generate RSA key for ssh connection
  • config e0/0: 10.15.1.1
  • config lo0: 10.14.1.1/32
  • config EIGRP

Add static route in the Ubuntu control station

1.2. Extend the initial topology

Set up DHCP server on CORE1 (may be not work)

  • Set up a DHCP pool, example here.
  • Check the DHCP binding with sh ip dhcp binding.
  • This solution does not work when allocate new router DHCP based onrouter name. NEED another solution!!!

Set up DHCP server on Ubuntu-control-station

  • Using isc-dhcp-server.
  • Install with apt install -y isc-dhcp-server.
  • Configure to listen on the interface ens38 (192.168.134.130) in/etc/default/isc-dhcp-server.
  • Define domain name, DHCP server IP address and gateway IP address in/etc/dhcp/dhcpd.conf.
  • Run isc-dhcp-server

Set up the ip helper-address on CORE1

  • Delete the dhcp pool created ip dhcp pool 1.
  • Setup ip helper address

Adding more routers to the topology

The topology as follow:

Gns3 Ansible Appliance

  • Update domain name, DHCP server IP address and gateway IP address in/etc/dhcp/dhcpd.conf.
    • The full configuration is here
  • Start the routers from R3 to R10, and check the ip address of eachrouter.
    • R3 should have ip 10.15.1.3.
    • R4 should have ip 10.15.1.4.
    • R5 should have ip 10.15.1.5.