Monday, January 1, 2018

Start to Network Automation



With Network automation in full swing, I was working on setting up my personal lab using GNS3. I tried to keep simple topology with a different flavor of device/vendors like Cisco, Palo Alto, Juniper, Linux etc. I integrated all those devices in GNS3, configured each virtual device, created multiple virtual interfaces etc. but it was not a cake walk, trust me! At the end, I was able to get all the devices configured as per my requirement.

I'm a newbie to scripting but I looked up on google and found bits and pieces of scripts, amended them as per my requirement. Then I wrote some basic Python scripts to automate some of the routine work. There are multiple ways to perform network automation by using different toolset like Ansibles, RESTful APIs, Yang, Netconf, even traditional CLI-scraping. Many network operating systems support APIs like Cisco support Python API, Juniper Junos supports PyEz etc.


Here is my GitHub repository:  GitHub Repository
AAMABADGAAgAAQAAAAAAAAsbAAAAJGEyNGY4ZTVmLTBkNWMtNGM5My1hNTFjLTZmMzdlNzBlZjc4NA
I encountered a few issues while configuring all those devices. Here are a few tips which will help and save your time while configuring virtual devices:

> Initial setup on Ubuntu 14.04:

  • Update repositories.
root@mail:/# apt-get update
root@mail:/# apt-get upgrade
  • Install SSH Server
root@mail:/# apt-get install openssh-server
root@mail:/# apt-get install openssh-client
  • After installation, configure ssh server. Open ssh config file with the following command:
root@mail:/# nano /etc/ssh/sshd_config
root@mail:/# service ssh restart/reload

> JUNIPER vSRX:

  • Perform the basic configuration on a vSRX machine:
root# set system host-name vSRX
root# set system domain-name XXXX
root# set system root-authentication plain-password XXXX
root# commit

root@vSRX# set interfaces ge-0/0/0 unit 0 family inet address XXXX/X
root@vSRX# set interfaces ge-0/0/1 unit 0 family inet address XXXX/X
root@vSRX# set system name-server XXXX

root@vSRX# set routing-options static route next-hop XXXX
root@vSRX# set security zones security-zone Trust interfaces ge-0/0/0.0 host-inbound-traffic system-services all

> Palo Alto:

  • Basic configuration on a vSRX machine:
admin@PA# set deviceconfig system ip-address XXXX
admin@PA# set deviceconfig system default-gateway XXXX
admin@PA# set deviceconfig system dns-setting server primary 8.8.8.8
admin@PA# commit

Now we can access GUI by web browser using https://xxxx
login using name=admin and password=admin 

Now, let's get started on more complex topology and configuration! Looking forward to create multiple scripts and services to automate network effectively. :-)



1 comment:

  1. very impressive...just an amature at this stuff, but it facinates me anyways. Keep it up and make the big buck doing what you like is your forte.

    ReplyDelete

Introduction to Virtual Private Network - VPN

VPN Tutorial Guide A VPN (Virtual private network) is a secure connection between two or more endpoints. It can also be seen as an ex...