In this lesson, we will cover how to use Batfish to validate,

  • No duplicate IP addresses are configured.
  • Jumbo frames are enabled on the links between core and aggregation.
  • Trunked VLANs from access to aggregation are correct.
  • BGP multipath is enabled.

First of all, let's dive into using Batfish by performing some configuration analysis.

Import Snapshot

Import the snapshot for this section using the supplied helper script and snapshot:

$ ./scripts/bf_snapshot_importer.py -p snapshots/001-base

IP Owners

First of all we will use the ipOwners() question to return each of the IPs, the interface and the node owner within our environment. Below shows an example.

>>> bfq.ipOwners().answer().frame()
...
           Node         VRF           Interface            IP Mask Active
0   nxos-aggr1   default     Vlan20              10.2.20.254   24   True 
1   nxos-aggr1   default     Ethernet1/4         10.1.1.2      24   True 
2   nxos-aggr2   management  mgmt0               172.29.133.4  24   False
3   nxos-aggr2   default     Vlan20              10.2.20.254   24   True 
4   nxos-core1   default     Ethernet1/2         10.1.2.1      24   True 
5   nxos-core2   default     Ethernet1/3         10.1.3.2      24   True 
6   nxos-aggr2   default     loopback0           192.168.1.4   32   True 
7   nxos-core1   default     Ethernet1/1         10.1.1.1      24   True 
8   nxos-core1   default     Ethernet1/3         10.1.3.1      24   True 
9   nxos-core1   management  mgmt0               172.29.133.1  24   False
10  nxos-aggr2   default     Vlan10              10.2.10.254   24   True 
11  server3      default     eth0                10.2.30.1     24   True 
12  nxos-core1   default     loopback0           192.168.1.1   32   True 
13  nxos-core2   default     loopback0           192.168.1.2   32   True 
14  server2      default     eth0                10.2.20.1     24   True 
15  nxos-aggr1   default     loopback0           192.168.1.3   32   True 
16  nxos-aggr1   management  mgmt0               172.29.133.3  24   False
17  nxos-core2   management  mgmt0               172.29.133.2  24   False
18  nxos-aggr1   default     Vlan10              10.2.10.254   24   True 
19  nxos-aggr2   default     Ethernet1/5         10.1.2.2      24   True 
20  qfx-access1  default     em1.0               169.254.0.2   24   True 
21  nxos-aggr1   default     Ethernet1/5         10.2.2.2      24   True 
22  ios-access2  default     GigabitEthernet0/0  172.29.133.6  24   True 
23  nxos-core2   default     Ethernet1/1         10.2.1.1      24   True 
24  nxos-core2   default     Ethernet1/2         10.2.2.1      24   True 
25  server1      default     eth0                10.2.10.1     24   True 
26  nxos-aggr2   default     Ethernet1/4         10.2.1.2      24   True 
27  nxos-aggr1   default     Vlan30              10.2.30.254   24   True 
28  nxos-aggr2   default     Ethernet1/6         10.3.4.2      24   False
29  eos-access3  default     Management1         172.29.133.7  24   False
30  nxos-aggr2   default     Vlan30              10.2.30.254   24   True 
31  qfx-access1  default     em0.0               172.29.133.5  24   False
32  nxos-aggr1   default     Ethernet1/6         10.3.4.1      24   False

Duplicate IP Detection

The question provides the ability to return duplicate IP entries via the duplicatesOnly input, as shown below.

>>> bfq.ipOwners(duplicatesOnly=True).answer().frame()
...
         Node      VRF Interface           IP Mask Active
0  nxos-aggr1  default  Vlan20    10.2.20.254  24   True 
1  nxos-aggr2  default  Vlan10    10.2.10.254  24   True 
2  nxos-aggr1  default  Vlan30    10.2.30.254  24   True 
3  nxos-aggr2  default  Vlan20    10.2.20.254  24   True 
4  nxos-aggr2  default  Vlan30    10.2.30.254  24   True 
5  nxos-aggr1  default  Vlan10    10.2.10.254  24   True 
Members Only Content
Join today and get access to:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 Multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Monthly online meetups

100% Satisfaction Guaranteed!
Cancel your membership at any time.


Join Today
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.