-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:napalm-automation/napalm into de…
…velop
- Loading branch information
Showing
18 changed files
with
382 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,4 @@ env | |
|
||
test/unit/test_devices.py | ||
|
||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ Documentation | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
installation | ||
tutorials/index | ||
support/index | ||
cli | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Installation | ||
============ | ||
|
||
Dependencies | ||
------------ | ||
|
||
Some of the available drivers depend on the Python [cryptography](https://cryptography.io/en/latest/) package. | ||
|
||
These drivers currently include: | ||
|
||
* `napalm_ios` | ||
|
||
To to ensure all dependencies are met for these drivers, use the following commands: | ||
|
||
**Debian/Ubuntu**: | ||
|
||
``` | ||
sudo apt-get install build-essential libssl-dev libffi-dev python-dev | ||
``` | ||
|
||
**Fedora and RHEL-derivatives**: | ||
|
||
``` | ||
sudo yum install gcc libffi-devel python-devel openssl-devel | ||
``` | ||
|
||
|
||
Full installation | ||
----------------- | ||
|
||
If you want to fully install NAPALM you can do it by executing: | ||
|
||
``` | ||
pip install napalm | ||
``` | ||
|
||
That will install all the drivers currently available. | ||
|
||
|
||
Partial Installation | ||
-------------------- | ||
|
||
If you want to install just a subset of the available modules you can just pick them as follows: | ||
|
||
``` | ||
pip install napalm-eos napalm-junos | ||
``` | ||
|
||
That will install only the `eos` and the `junos` drivers. If you want to remove or add a module later on you can just use `pip` to do it: | ||
|
||
``` | ||
pip uninstall napalm-junos | ||
pip install napalm-ios | ||
``` | ||
|
||
Check the ['Supported Network Operating Systems'](http://napalm.readthedocs.io/en/latest/support/index.html) section for more information about supported modules. | ||
|
||
|
||
Upgrading | ||
========= | ||
|
||
We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes. To upgrade napalm it's a simple as repeating the steps you performed while installing but adding the `-U` flag. For example: | ||
|
||
``` | ||
pip install napalm -U | ||
``` | ||
|
||
or: | ||
|
||
``` | ||
pip install napalm-eos napalm-junos -U | ||
``` | ||
|
||
We will be posting news on our slack channel and on Twitter (more details soon). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Vagrantfile for the quickstart tutorial | ||
|
||
# Script configuration: | ||
# | ||
# Arista vEOS box. | ||
# Please change this to match your installed version | ||
# (use `vagrant box list` to see what you have installed). | ||
VEOS_BOX = "vEOS-lab-4.15.5M-virtualbox" | ||
|
||
Vagrant.configure(2) do |config| | ||
|
||
config.vm.define "base" do |base| | ||
# This box will be downloaded and added automatically if you don't | ||
# have it already. | ||
base.vm.box = "hashicorp/precise64" | ||
base.vm.network :forwarded_port, guest: 22, host: 12200, id: 'ssh' | ||
base.vm.network "private_network", virtualbox__intnet: "link_1", ip: "10.0.1.100" | ||
base.vm.network "private_network", virtualbox__intnet: "link_2", ip: "10.0.2.100" | ||
base.vm.provision "shell", inline: "apt-get update; apt-get install lldpd -y" | ||
end | ||
|
||
config.vm.define "eos" do |eos| | ||
eos.vm.box = VEOS_BOX | ||
eos.vm.network :forwarded_port, guest: 22, host: 12201, id: 'ssh' | ||
eos.vm.network :forwarded_port, guest: 443, host: 12443, id: 'https' | ||
eos.vm.network "private_network", virtualbox__intnet: "link_1", ip: "169.254.1.11", auto_config: false | ||
eos.vm.network "private_network", virtualbox__intnet: "link_2", ip: "169.254.1.11", auto_config: false | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,24 @@ | ||
Installation | ||
============ | ||
|
||
Dependencies | ||
------------ | ||
Tools | ||
----- | ||
|
||
Some of the available drivers depend on the Python [cryptography](https://cryptography.io/en/latest/) package. | ||
You'll need a few tools: | ||
|
||
These drivers currently include: | ||
* Python | ||
* `pip <https://pip.pypa.io/en/stable/installing/>`_: The PyPA recommended tool for installing Python packages | ||
* `VirtualBox <https://www.virtualbox.org/>`_: a software virtualization tool | ||
* `Vagrant <https://www.vagrantup.com/downloads.html>`_: a command line utility for managing the lifecycle of virtual machines | ||
|
||
* `napalm_ios` | ||
As the focus of this tutorial is NAPALM, we don't even scratch the surface of these tools. If you're not familiar with them, please do some research [#f1]_ as they will be an important part of your development/ops toolkit. | ||
|
||
To to ensure all dependencies are met for these drivers, use the following commands: | ||
Install | ||
------- | ||
|
||
**Debian/Ubuntu**: | ||
Install NAPALM with pip:: | ||
|
||
``` | ||
sudo apt-get install build-essential libssl-dev libffi-dev python-dev | ||
``` | ||
|
||
**Fedora and RHEL-derivatives**: | ||
|
||
``` | ||
sudo yum install gcc libffi-devel python-devel openssl-devel | ||
``` | ||
|
||
|
||
Full installation | ||
----------------- | ||
|
||
If you want to fully install NAPALM you can do it by executing: | ||
|
||
``` | ||
pip install napalm | ||
``` | ||
|
||
That will install all the drivers currently available. | ||
|
||
|
||
Partial Installation | ||
-------------------- | ||
|
||
If you want to install just a subset of the available modules you can just pick them as follows: | ||
|
||
``` | ||
pip install napalm-eos napalm-junos | ||
``` | ||
|
||
That will install only the `eos` and the `junos` drivers. If you want to remove or add a module later on you can just use `pip` to do it: | ||
|
||
``` | ||
pip uninstall napalm-junos | ||
pip install napalm-ios | ||
``` | ||
|
||
Check the ['Supported Network Operating Systems'](http://napalm.readthedocs.io/en/latest/support/index.html) section for more information about supported modules. | ||
|
||
|
||
Upgrading | ||
========= | ||
|
||
We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes. To upgrade napalm it's a simple as repeating the steps you performed while installing but adding the `-U` flag. For example: | ||
|
||
``` | ||
pip install napalm -U | ||
``` | ||
|
||
or: | ||
|
||
``` | ||
pip install napalm-eos napalm-junos -U | ||
``` | ||
|
||
We will be posting news on our slack channel and on Twitter (more details soon). | ||
pip install napalm | ||
|
||
|
||
.. [#f1] Vagrant's `getting started guide <https://www.vagrantup.com/docs/getting-started/>`_ is worth reading and working through. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Setting up the lab | ||
================== | ||
|
||
We'll set up a lab using VirtualBox and Vagrant, with a virtual Arista device, and get some sample files for the following steps. | ||
|
||
Working directory | ||
----------------- | ||
|
||
Create a directory for your files anywhere on your machine. | ||
|
||
Arista vEOS | ||
----------- | ||
|
||
The Arista EOS image can be downloaded for free from the Arista site. | ||
|
||
Create an account at https://www.arista.com/en/user-registration, and go to https://www.arista.com/en/support/software-download. | ||
|
||
Download the latest "vEOS-lab-<version>-virtualbox.box" listed in the vEOS folder at the bottom of the page. | ||
|
||
Add it to your vagrant box list, changing the `<version>`:: | ||
|
||
$ vagrant box add --name vEOS-lab-<version>-virtualbox ~/Downloads/vEOS-lab-<version>-virtualbox.box | ||
$ vagrant box list | ||
vEOS-lab-quickstart (virtualbox, 0) | ||
|
||
You can delete the downloaded .box file once you have added it, as ``vagrant box add`` copies downloaded file to a designated directory (e.g., for Mac OS X and Linux: ``~/.vagrant.d/boxes``, Windows: ``C:/Users/USERNAME/.vagrant.d/boxes``). | ||
|
||
Starting Vagrant | ||
---------------- | ||
|
||
Create a file named ``Vagrantfile`` (no file extension) in your working directory with the following content: | ||
|
||
.. literalinclude:: Vagrantfile | ||
:language: ruby | ||
|
||
The above content is also available on `GitHub <https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/Vagrantfile>`_. | ||
|
||
This Vagrantfile creates a base box and a vEOS box when you call "vagrant up":: | ||
|
||
$ vagrant up | ||
... [output omitted] ... | ||
|
||
$ vagrant status | ||
Current machine states: | ||
base running (virtualbox) | ||
eos running (virtualbox) | ||
|
||
You may see some errors when the eos box is getting created [#f1]_. | ||
|
||
Troubleshooting | ||
^^^^^^^^^^^^^^^ | ||
|
||
* After running ``vagrant up``, ensure that you can ssh to the box with ``vagrant ssh eos``. | ||
* If you receive the warning "eos: Warning: Remote connection disconnect. Retrying...", see `this StackOverflow post <http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying>`_. | ||
|
||
Sample files | ||
------------ | ||
|
||
There are some sample Arista vEOS configuration files on `GitHub <https://github.com/napalm-automation/napalm/blob/master/docs/tutorials/sample_configs>`_. You can download them to your machine by copying them from GitHub, or using the commands below:: | ||
|
||
$ for f in new_good.conf merge_good.conf merge_typo.conf; do | ||
$ wget https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/sample_configs/$f | ||
$ done | ||
|
||
(Note: please open a GitHub issue if these URLs are invalid.) | ||
|
||
|
||
.. [#f1] Currently, ``vagrant up`` with the eos box prints some warnings: "No guest additions were detected on the base box for this VM! Guest additions are required for forwarded ports, shared folders, host only networking, and more. If SSH fails on this machine, please install the guest additions and repackage the box to continue. This is not an error message; everything may continue to work properly, in which case you may ignore this message." This is not a reassuring message, but everything still seems to work correctly. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Outline | ||
======= | ||
|
||
This tutorial gets you up-and-running quickly with NAPALM in a local virtual environment so you can see it in action in under an hour. We'll cover the following: | ||
|
||
#. Installing the required tools | ||
#. Creating a virtual lab with an Arista device | ||
#. Manually applying configuration to the device using NAPALM | ||
#. Driving NAPALM through Python code | ||
|
||
.. note:: This tutorial does not cover fully automated configuration management (e.g., using NAPALM in conjunction with Ansible, Chef, Salt, etc.). We hope that tutorials for these tools will be contributed soon so that you can evaluate the options for your particular environment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hostname NEWHOSTNAME | ||
|
||
interface Ethernet2 | ||
description BLALALAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hostname NEWHOSTNAME | ||
|
||
interface Ethernet2 | ||
descriptin BLALALAL |
Oops, something went wrong.