https://github.com/mweisel/cisco-nexus-ospf-p2p
This Vagrant project demonstrates a single area OSPF point-to-point network topology with three Cisco Nexus 9000v nodes.
https://github.com/mweisel/cisco-nexus-ospf-p2p
ansible cisco-nexus cisco-nx-os libvirt-provider vagrant vagrant-libvirt
Last synced: about 2 months ago
JSON representation
This Vagrant project demonstrates a single area OSPF point-to-point network topology with three Cisco Nexus 9000v nodes.
- Host: GitHub
- URL: https://github.com/mweisel/cisco-nexus-ospf-p2p
- Owner: mweisel
- License: mit
- Created: 2020-06-06T22:55:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-19T20:24:29.000Z (almost 6 years ago)
- Last Synced: 2025-07-02T07:06:11.337Z (12 months ago)
- Topics: ansible, cisco-nexus, cisco-nx-os, libvirt-provider, vagrant, vagrant-libvirt
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

This Vagrant project demonstrates a single area OSPF point-to-point network topology with three Cisco Nexus 9000v nodes.
## Ingredients
* [Vagrant](https://www.vagrantup.com)
* [vagrant-libvirt](https://github.com/vagrant-libvirt/vagrant-libvirt)
* [Cisco Nexus 9000v Vagrant box](https://github.com/mweisel/cisco-nxos9kv-vagrant-libvirt)
* [Python](https://www.python.org) >= 3.5
* [Ansible](https://www.ansible.com) >= 2.9
## Prerequisites
01\. Add a DHCP reservation for each Cisco Nexus 9000v management interface.
Refer to [Controlling Vagrant Box Management IP](https://codingpackets.com/blog/controlling-vagrant-box-management-ip) for more information.
$ virsh net-dumpxml vagrant-libvirt
<network ipv6='yes'>
<name>vagrant-libvirt</name>
<uuid>e9d9b270-22b2-46d9-a397-91ca3117430b</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr1' stp='on' delay='0'/>
<mac address='52:54:00:d9:f5:84'/>
<ip address='192.168.121.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.121.1' end='192.168.121.254'/>
<host mac='52:54:00:4f:ae:45' ip='192.168.121.31'/>
<host mac='52:54:00:4a:f1:ca' ip='192.168.121.32'/>
<host mac='52:54:00:38:33:22' ip='192.168.121.33'/>
</dhcp>
</ip>
</network>
02\. Set the SSH client configuration for the Cisco Nexus 9000v nodes.
Refer to [Vagrant SSH Config Trick](https://codingpackets.com/blog/vagrant-ssh-config-trick) for more information.
$ tail -n +1 $HOME/.ssh/config $HOME/.ssh/vagrant.d/sshconfig
==> /home/marc/.ssh/config <==
Include vagrant.d/sshconfig
==> /home/marc/.ssh/vagrant.d/sshconfig <==
### Cisco Nexus 9000v
Host nx01
HostName 192.168.121.31
User vagrant
Port 22
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile ~/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
Host nx02
HostName 192.168.121.32
User vagrant
Port 22
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile ~/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
Host nx03
HostName 192.168.121.33
User vagrant
Port 22
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile ~/.vagrant.d/insecure_private_key
IdentitiesOnly yes
LogLevel FATAL
## Steps
01\. Clone this GitHub repo and _cd_ into the `ansible` subdirectory.
$ git clone https://github.com/mweisel/cisco-nexus-ospf-p2p
$ cd cisco-nexus-ospf-p2p/ansible
02\. Create a Python virtual environment.
$ python3 -m venv .venv
03\. _Activate_ the Python virtual environment.
$ source .venv/bin/activate
04\. Update the `pip` and `setuptools` Python packages.
$ pip install -U pip setuptools
05\. _Reactivate_ the Python virtual environment.
$ deactivate && source .venv/bin/activate
06\. Install the `ansible` and `paramiko` Python packages.
$ pip install -r requirements.txt
07\. _Reactivate_ the Python virtual environment.
$ deactivate && source .venv/bin/activate
08\. Instantiate the Cisco Nexus 9000v nodes.
$ vagrant up --no-parallel
09\. Run the Ansible playbook to configure the Cisco Nexus 9000v nodes.
$ ansible-playbook set-config.yml
10\. Verify the configuration.
$ ssh nx02
nx02# show ip ospf neighbors
nx02# show ip ospf route
nx02# run bash for lo in 1 3; do ping -c5 192.0.2.${lo}; done
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details