Chapter 7 Tactical Playbooks

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 118
lines: 
        -  vlan 10  
        -  name GREEN_OPZone 
      provider: "{{ ioscli }}" 
 
- hosts: ACCESS01 
  tasks: 
  - name: Add VLAN to Port-channel 1 
    ios_config: 
      lines: 
        -  switchport trunk allowed vlan add 10 
      parents: interface Port-channel1 
      provider: "{{ ioscli }}" 
 
- hosts: ACCESS01 
  tasks: 
  - name: Place Access ports on VLAN 10  
    ios_config: 
      lines: 
        -  switchport mode access 
        -  switchport access vlan 10 
        -  spanning-tree portfast 
        -  no shutdown  
      parents: interface range GigabitEthernet1/0/2-20 
      provider: "{{ ioscli }}" 
 
- hosts: ACCESS01 
  tasks: 
  - name: Copy running-config to startup-config on ACCESS01 
    ios_command: 
      lines: 
        -  copy run start 
      provider: "{{ ioscli }}" 
 
OSPF Point-to-Point 
 
This next example includes a change that is disruptive to the network and downtime is unavoidable. 
Should the operator make an error on either end or perform the change in the wrong order it could leave 
the network offline until somebody visits the remote device with a console cable and restores 
connectivity. This is avoided with automation.

The example involves interface configurations for OSPF. There are two building distribution switches connected to the core through layer 3 port-channels. Each side of the link is logically a single interface, so this should be connected as an OSPF point-to-point connection. This is not the default configuration for layer 3 port-channels and must be configured explicitly on the interface. The default is a broadcast type for OSPF. While broadcast will still work, and connectivity will be established there are some worthwhile advantages to following best practices. If running OSPF and point-to-point connections, configure the OSPF point-to-point type under those layer 3 interfaces. The OSPF hello interval as well as the dead detection interval is much higher using P2P, adjacency time is only 2 seconds (fast) versus over 40 seconds (very slow) with P2P versus broadcast. There is one less Link State Advertisement (LSA) per 30 seconds with P2P (2) versus broadcast (3) making this an extremely important setting especially as the network scales.