This Vagrant project demonstrates a single area OSPF point-to-point network topology with three Cisco Nexus 9000v nodes.
- Vagrant
- vagrant-libvirt
- Cisco Nexus 9000v Vagrant box
- Python >= 3.5
- Ansible >= 2.9
01. Add a DHCP reservation for each Cisco Nexus 9000v management interface.
Refer to 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 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
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
This project is licensed under the MIT License - see the LICENSE file for details
