diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4080412..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Packt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index 5cbd285..9089cd3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# Segment-Routing-101 -Segment Routing 101, published by Packt +Supported ansible-playbook for Cisco IOS-XR labs diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..80ae33f --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,17 @@ +[defaults] +host_key_checking = False +inventory = inventory/hosts.ini +forks=30 +stdout_callback = yaml +display_skipped_hosts = false + +# https://www.redhat.com/sysadmin/faster-ansible-playbook-execution +[ssh_connection] +ssh_args = -o ControlMaster=auto -o ControlPersist=60s + +[persistent_connection] +connect_timeout = 120 +connect_retry_timeout = 30 +# The following is used to replace config as libssh has a bug +#ssh_type = paramiko + diff --git a/inventory/group_vars/routers.yaml b/inventory/group_vars/routers.yaml new file mode 100644 index 0000000..4cacd23 --- /dev/null +++ b/inventory/group_vars/routers.yaml @@ -0,0 +1,3 @@ +--- +ansible_connection: ansible.netcommon.network_cli +ansible_network_os: cisco.iosxr.iosxr diff --git a/inventory/host_vars/P2.yaml b/inventory/host_vars/P2.yaml new file mode 100644 index 0000000..265f49b --- /dev/null +++ b/inventory/host_vars/P2.yaml @@ -0,0 +1,44 @@ +--- +hostname: P2 +interfaces: + - name : Loopback0 + address: 2.2.2.2/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 23.0.0.2/24 + description: P2_to_P3 + - name : GigabitEthernet0/0/0/1 + address: 26.0.0.2/24 + description: P2_to_P6 + - name : GigabitEthernet0/0/0/2 + address: 12.0.0.2/24 + description: P2_to_PE1 + - name : GigabitEthernet0/0/0/3 + address: 27.0.0.2/24 + description: P2_to_P7 + - name : GigabitEthernet0/0/0/5 + address: 29.0.0.2/24 + description: P2_to_P9 +protocols: + isis: + - net: 49.0000.0000.0002.00 + sid: 2 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/3 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/5 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P3.yaml b/inventory/host_vars/P3.yaml new file mode 100644 index 0000000..288742a --- /dev/null +++ b/inventory/host_vars/P3.yaml @@ -0,0 +1,38 @@ +--- +hostname: P3 +interfaces: + - name : Loopback0 + address: 3.3.3.3/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 23.0.0.3/24 + description: P3_to_P2 + - name : GigabitEthernet0/0/0/1 + address: 37.0.0.3/24 + description: P3_to_P7 + - name : GigabitEthernet0/0/0/2 + address: 34.0.0.3/24 + description: P3_to_P4 + - name : GigabitEthernet0/0/0/3 + address: 39.0.0.3/24 + description: P3_to_P9 +protocols: + isis: + - net: 49.0000.0000.0003.00 + sid: 3 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/3 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P4.yaml b/inventory/host_vars/P4.yaml new file mode 100644 index 0000000..b59498e --- /dev/null +++ b/inventory/host_vars/P4.yaml @@ -0,0 +1,38 @@ +--- +hostname: P4 +interfaces: + - name : Loopback0 + address: 4.4.4.4/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 45.0.0.4/24 + description: P4_to_PE5 + - name : GigabitEthernet0/0/0/1 + address: 48.0.0.4/24 + description: P4_to_P8 + - name : GigabitEthernet0/0/0/2 + address: 34.0.0.4/24 + description: P4_to_P3 + - name : GigabitEthernet0/0/0/4 + address: 47.0.0.4/24 + description: P4_to_P7 +protocols: + isis: + - net: 49.0000.0000.0004.00 + sid: 4 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/4 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P6.yaml b/inventory/host_vars/P6.yaml new file mode 100644 index 0000000..1583f9b --- /dev/null +++ b/inventory/host_vars/P6.yaml @@ -0,0 +1,26 @@ +--- +hostname: P6 +interfaces: + - name : Loopback0 + address: 6.6.6.6/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 67.0.0.6/24 + description: P6_to_P7 + - name : GigabitEthernet0/0/0/1 + address: 26.0.0.6/24 + description: P6_to_P2 +protocols: + isis: + - net: 49.0000.0000.0006.00 + sid: 6 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P7.yaml b/inventory/host_vars/P7.yaml new file mode 100644 index 0000000..5f41980 --- /dev/null +++ b/inventory/host_vars/P7.yaml @@ -0,0 +1,44 @@ +--- +hostname: P7 +interfaces: + - name : Loopback0 + address: 7.7.7.7/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 67.0.0.7/24 + description: P7_to_P6 + - name : GigabitEthernet0/0/0/1 + address: 37.0.0.7/24 + description: P7_to_P7 + - name : GigabitEthernet0/0/0/2 + address: 78.0.0.7/24 + description: P7_to_P8 + - name : GigabitEthernet0/0/0/3 + address: 27.0.0.7/24 + description: P7_to_P2 + - name : GigabitEthernet0/0/0/4 + address: 47.0.0.7/24 + description: P7_to_P4 +protocols: + isis: + - net: 49.0000.0000.0007.00 + sid: 7 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/3 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/4 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P8.yaml b/inventory/host_vars/P8.yaml new file mode 100644 index 0000000..d8bb7c3 --- /dev/null +++ b/inventory/host_vars/P8.yaml @@ -0,0 +1,29 @@ +--- +hostname: P8 +interfaces: + - name : Loopback0 + address: 8.8.8.8/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/1 + address: 48.0.0.8/24 + description: P8_to_P4 + - name : GigabitEthernet0/0/0/2 + address: 78.0.0.8/24 + description: P8_to_P7 +protocols: + isis: + - net: 49.0000.0000.0008.00 + sid: 8 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/1 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/P9.yaml b/inventory/host_vars/P9.yaml new file mode 100644 index 0000000..6bdb767 --- /dev/null +++ b/inventory/host_vars/P9.yaml @@ -0,0 +1,26 @@ +--- +hostname: P9 +interfaces: + - name : Loopback0 + address: 9.9.9.9/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/3 + address: 39.0.0.9/24 + description: P9_to_P3 + - name : GigabitEthernet0/0/0/5 + address: 29.0.0.9/24 + description: P9_to_P2 +protocols: + isis: + - net: 49.0000.0000.0009.00 + sid: 9 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/3 + loopback: False + metric: 10 + - name: GigabitEthernet0/0/0/5 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/PE1.yaml b/inventory/host_vars/PE1.yaml new file mode 100644 index 0000000..f4fcdc4 --- /dev/null +++ b/inventory/host_vars/PE1.yaml @@ -0,0 +1,19 @@ +hostname: PE1 +interfaces: + - name : Loopback0 + address: 1.1.1.1/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/2 + address: 12.0.0.1/24 + description: PE1_to_P2 +protocols: + isis: + - net: 49.0000.0000.0001.00 + sid: 1 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/2 + loopback: False + metric: 10 + diff --git a/inventory/host_vars/PE5.yaml b/inventory/host_vars/PE5.yaml new file mode 100644 index 0000000..49e6915 --- /dev/null +++ b/inventory/host_vars/PE5.yaml @@ -0,0 +1,20 @@ +--- +hostname: PE5 +interfaces: + - name : Loopback0 + address: 5.5.5.5/32 + description: System_Loopback_Interface + - name : GigabitEthernet0/0/0/0 + address: 45.0.0.5/24 + description: PE5_to_P4 +protocols: + isis: + - net: 49.0000.0000.0005.00 + sid: 5 + interfaces: + - name: Loopback0 + loopback: True + - name: GigabitEthernet0/0/0/0 + loopback: False + metric: 10 + diff --git a/inventory/hosts.ini b/inventory/hosts.ini new file mode 100644 index 0000000..b2739f2 --- /dev/null +++ b/inventory/hosts.ini @@ -0,0 +1,16 @@ +###hosts.ini +[routers] +PE1 ansible_host=192.168.18.1 +P2 ansible_host=192.168.18.2 +P3 ansible_host=192.168.18.3 +P4 ansible_host=192.168.18.4 +PE5 ansible_host=192.168.18.5 +P6 ansible_host=192.168.18.6 +P7 ansible_host=192.168.18.7 +P8 ansible_host=192.168.18.8 +P9 ansible_host=192.168.18.9 + +[zstilfa] +P2 ansible_host=192.168.18.2 +P6 ansible_host=192.168.18.6 +P7 ansible_host=192.168.18.7 diff --git a/main.yml b/main.yml new file mode 100644 index 0000000..16c460a --- /dev/null +++ b/main.yml @@ -0,0 +1,138 @@ +--- +- name: "0. RESTORE BASE TOPOLOGY" + hosts: routers + gather_facts: false + roles: + - lab_0_revert_to_base_topology + tags: + - lab_0 + +- name: "1. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - GETTING STARTED" + hosts: routers !P9 + gather_facts: false + roles: + - lab_1_getting_started + tags: + - lab_1 + +- name: "1.x CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - GETTING STARTED" + hosts: PE1, P2, P3, P7, P4 + serial: 1 + gather_facts: false + roles: + - lab_1x_getting_started + tags: + - lab_1 + +- name: "2. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - INTRODUCE SEGMENT ROUTING" + hosts: PE1, P2, P3, P6, P7 + gather_facts: false + roles: + - lab_2_intro_segment_routing + tags: + - lab_2 + +- name: "3. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - SR <-> LDP INTERWORKING" + hosts: routers !P9 + gather_facts: false + roles: + - lab_3_sr_ldp_interworking + tags: + - lab_3 + +- name: "4. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TOPOLOGY INDEPENDENT LOOPFREE ALTERNATE" + hosts: routers !P9 + gather_facts: false + roles: + - lab_4_tilfa + tags: + - lab_4 + +- name: "5. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - ZERO SEGMENT TI-LFA" + hosts: zstilfa + gather_facts: false + roles: + - lab_5_zs_tilfa + tags: + - lab_5 + +- name: "6. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - SINGLE SEGMENT TI-LFA" + hosts: zstilfa !P6 + gather_facts: false + roles: + - lab_6_ss_tilfa + tags: + - lab_6 + +- name: "7. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - DOUBLE SEGMENT TI-LFA" + hosts: P2, P4, P8 + gather_facts: false + roles: + - lab_7_ds_tilfa + tags: + - lab_7 + +- name: "8. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - MICROLOOP AVOIDANCE" + hosts: P2, P7, P8 + gather_facts: false + roles: + - lab_8_microloop_avoidance + tags: + - lab_8 + +- name: "9. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - MPLS TRAFFIC-ENGINEERING" + hosts: routers !P9 + gather_facts: false + roles: + - lab_9_mpls_traffic_eng + tags: + - lab_9 + +- name: "10. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA NODE + SRLG PROTECTION PREPARATION" + hosts: P4, P6, P7, P8 + gather_facts: false + roles: + - lab_10_tilfa_ns_prep + tags: + - lab_10 + +- name: "11. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA NODE PROTECTION" + hosts: P2 + gather_facts: false + roles: + - lab_11_tilfa_ns_node + tags: + - lab_11 + +- name: "12. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA LOCAL SRLG-DISJOINT PROTECTION" + hosts: P2 + gather_facts: false + roles: + - lab_12_tilfa_ns_local_srlg + tags: + - lab_12 + +- name: "13. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA GLOBAL WEIGHTED SRLG PROTECTION" + hosts: P2, P7 + gather_facts: false + roles: + - lab_13_tilfa_ns_global_srlg + tags: + - lab_13 + +- name: "14. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA NODE + SRLG PROTECTION" + hosts: P2 + gather_facts: false + roles: + - lab_14_tilfa_ns_node_plus_srlg + tags: + - lab_14 + +- name: "15. CISCO XRV9K SR WITH TI-LFA LAB PLAYBOOK - TI-LFA TIEBREAKER LINK vs NODE vs SRLG PROTECTION" + hosts: P2, P3, P9 + gather_facts: false + roles: + - lab_15_tilfa_tiebrkr_link_node_srlg + tags: + - lab_15 + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6ff9267 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,61 @@ +ansible==7.3.0 +ansible-core==2.14.3 +ansible-pylibssh==1.1.0 +bcrypt==4.0.1 +bitarray==2.7.3 +black==23.1.0 +certifi==2022.12.7 +cffi==1.15.1 +charset-normalizer==3.0.1 +click==8.1.3 +colorama==0.4.6 +cryptography==39.0.0 +dicttoxml==1.7.16 +enum34==1.1.10 +future==0.18.3 +ghp-import==2.1.0 +idna==3.4 +Jinja2==3.1.2 +lxml==4.9.2 +Markdown==3.3.7 +MarkupSafe==2.1.2 +mergedeep==1.3.4 +mike==1.1.2 +mkdocs==1.4.2 +mkdocs-material==9.0.11 +mkdocs-material-extensions==1.1.1 +mypy-extensions==1.0.0 +ntc-templates==3.2.0 +ordereddict==1.1 +packaging==23.0 +paramiko==3.0.0 +pathspec==0.11.1 +pexpect==4.8.0 +platformdirs==3.1.1 +ptyprocess==0.7.0 +pyang==2.5.3 +pyangbind==0.8.1 +pycparser==2.21 +Pygments==2.14.0 +pymdown-extensions==9.9.2 +PyNaCl==1.5.0 +pyserial==3.5 +python-dateutil==2.8.2 +PyYAML==6.0 +pyyaml_env_tag==0.1 +regex==2022.10.31 +requests==2.28.2 +resolvelib==0.8.1 +ruamel.yaml==0.17.21 +ruamel.yaml.clib==0.2.7 +scp==0.14.5 +six==1.16.0 +tenacity==8.2.0 +textfsm==1.1.2 +tomli==2.0.1 +ttp==0.9.2 +urllib3==1.26.14 +verspec==0.1.0 +watchdog==2.2.1 +xmlplain==1.6.0 +xmltodict==0.13.0 diff --git a/roles/lab_0_revert_to_base_topology/tasks/main.yml b/roles/lab_0_revert_to_base_topology/tasks/main.yml new file mode 100644 index 0000000..65ddff6 --- /dev/null +++ b/roles/lab_0_revert_to_base_topology/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: 0.0 RENDER AND DISPLAY THE BASE CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 0.1 RENDER AND SAVE THE BASE CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_0_{{ hostname }}.base.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 0.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 0.3 RENDER AND APPLY THE BASE CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + replace: config diff --git a/roles/lab_0_revert_to_base_topology/templates/restore_topology_template.j2 b/roles/lab_0_revert_to_base_topology/templates/restore_topology_template.j2 new file mode 100644 index 0000000..3092ea0 --- /dev/null +++ b/roles/lab_0_revert_to_base_topology/templates/restore_topology_template.j2 @@ -0,0 +1,36 @@ +username cisco + group root-lr + group cisco-support + secret 10 $6$m69UO/m0cK.e3O/.$EtYXDVl3/aphJkazxKy145fyIY/./Xxt1fi7B3tjYemXr6pzHEJRNfq1DxNJ..WlAQx4wFr6kJesSGtKLv8/k/ +! +vrf mgmt +! +call-home + service active + contact smart-licensing + profile CiscoTAC-1 + active + destination transport-method email disable + destination transport-method http + ! +! +interface MgmtEth0/RP0/CPU0/0 + vrf mgmt + ipv4 address 192.168.18.{{ protocols.isis[0].sid }} 255.255.255.0 + no shutdown +! +grpc + dscp cs4 + port 57400 + no-tls + max-streams 128 + max-streams-per-user 128 + address-family dual + max-request-total 256 + max-request-per-user 32 +! +ssh server vrf mgmt +ssh server vrf default +root +! + diff --git a/roles/lab_0_revert_to_base_topology/vars/main.yml b/roles/lab_0_revert_to_base_topology/vars/main.yml new file mode 100644 index 0000000..bdc1ac2 --- /dev/null +++ b/roles/lab_0_revert_to_base_topology/vars/main.yml @@ -0,0 +1,6 @@ +--- +#The default ssh_type ansible-pylibssh has a bug while replacing config +ansible_network_cli_ssh_type: paramiko +slow_secs: 1 +templates: +- restore_topology_template.j2 diff --git a/roles/lab_10_tilfa_ns_prep/tasks/main.yml b/roles/lab_10_tilfa_ns_prep/tasks/main.yml new file mode 100644 index 0000000..dcb6132 --- /dev/null +++ b/roles/lab_10_tilfa_ns_prep/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: 10.0 RENDER AND DISPLAY THE TI-LFA NODE + SRLG PROTECTION PREPARATION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 10.1 RENDER AND SAVE THE TI-LFA NODE + SRLG PROTECTION PREPARATION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_9_{{ hostname }}.tilfa_ns_prep.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 10.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 10.3 RENDER AND APPLY THE TI-LFA NODE + SRLG PROTECTION PREPARATION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none \ No newline at end of file diff --git a/chapter10/lab_9_P4.tilfa_ns_prep.xrcfg b/roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p4.j2 similarity index 100% rename from chapter10/lab_9_P4.tilfa_ns_prep.xrcfg rename to roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p4.j2 diff --git a/chapter10/lab_9_P6.tilfa_ns_prep.xrcfg b/roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p6.j2 similarity index 100% rename from chapter10/lab_9_P6.tilfa_ns_prep.xrcfg rename to roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p6.j2 diff --git a/chapter10/lab_9_P7.tilfa_ns_prep.xrcfg b/roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p7.j2 similarity index 100% rename from chapter10/lab_9_P7.tilfa_ns_prep.xrcfg rename to roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p7.j2 diff --git a/chapter10/lab_9_P8.tilfa_ns_prep.xrcfg b/roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p8.j2 similarity index 100% rename from chapter10/lab_9_P8.tilfa_ns_prep.xrcfg rename to roles/lab_10_tilfa_ns_prep/templates/tilfa_ns_prep_p8.j2 diff --git a/roles/lab_10_tilfa_ns_prep/vars/main.yml b/roles/lab_10_tilfa_ns_prep/vars/main.yml new file mode 100644 index 0000000..9d19bc3 --- /dev/null +++ b/roles/lab_10_tilfa_ns_prep/vars/main.yml @@ -0,0 +1,5 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa_ns_prep_{{ inventory_hostname | lower }}.j2 diff --git a/roles/lab_11_tilfa_ns_node/tasks/main.yml b/roles/lab_11_tilfa_ns_node/tasks/main.yml new file mode 100644 index 0000000..5183118 --- /dev/null +++ b/roles/lab_11_tilfa_ns_node/tasks/main.yml @@ -0,0 +1,69 @@ +--- +- name: 11.0 RENDER AND DISPLAY THE TI-LFA NODE PROTECTION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 11.1 RENDER AND SAVE THE TI-LFA NODE PROTECTION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_9_{{ hostname }}.tilfa_ns_node.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 11.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 11.3 RENDER AND APPLY THE TI-LFA NODE PROTECTION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 11.4 RUN COMMANDS TO VERIFY TI-LFA NODE PROTECTION + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + +- name: 11.5 DISPLAY OUTPUT FOR THE COMMANDS RUN IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + +- name: 11.6 RENDER AND DISPLAY THE TI-LFA NODE PROTECTION REVERSAL CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + +- name: 11.7 RENDER AND SAVE THE TI-LFA NODE PROTECTION REVERSAL CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_9_{{ hostname }}.tilfa_ns_node_revert.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 11.8 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 11.9 RENDER AND APPLY THE TI-LFA NODE PROTECTION REVERSAL CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none diff --git a/chapter10/lab_9_P2.tilfa_ns_node.xrcfg b/roles/lab_11_tilfa_ns_node/templates/tilfa_ns_node.j2 similarity index 100% rename from chapter10/lab_9_P2.tilfa_ns_node.xrcfg rename to roles/lab_11_tilfa_ns_node/templates/tilfa_ns_node.j2 diff --git a/chapter10/lab_9_P2.tilfa_ns_node_revert.xrcfg b/roles/lab_11_tilfa_ns_node/templates/tilfa_ns_node_revert.j2 similarity index 100% rename from chapter10/lab_9_P2.tilfa_ns_node_revert.xrcfg rename to roles/lab_11_tilfa_ns_node/templates/tilfa_ns_node_revert.j2 diff --git a/roles/lab_11_tilfa_ns_node/vars/main.yml b/roles/lab_11_tilfa_ns_node/vars/main.yml new file mode 100644 index 0000000..2531c73 --- /dev/null +++ b/roles/lab_11_tilfa_ns_node/vars/main.yml @@ -0,0 +1,9 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa_ns_node.j2 +- tilfa_ns_node_revert.j2 +command_set_1: +- sh isis fast-reroute 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_12_tilfa_ns_local_srlg/tasks/main.yml b/roles/lab_12_tilfa_ns_local_srlg/tasks/main.yml new file mode 100644 index 0000000..39b13f5 --- /dev/null +++ b/roles/lab_12_tilfa_ns_local_srlg/tasks/main.yml @@ -0,0 +1,44 @@ +--- +- name: 12.0 RENDER AND DISPLAY THE TI-LFA LOCAL SRLG-DISJOINT PROTECTION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 12.1 RENDER AND SAVE THE TI-LFA LOCAL SRLG-DISJOINT PROTECTION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_10_{{ hostname }}.tilfa_ns_local_srlg.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 12.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 12.3 RENDER AND APPLY THE TI-LFA LOCAL SRLG-DISJOINT PROTECTION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 12.4 RUN COMMANDS TO VERIFY TI-LFA LOCAL SRLG-DISJOINT PROTECTION + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + +- name: 12.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx diff --git a/chapter11/lab_10_P2.tilfa_ns_local_srlg.xrcfg b/roles/lab_12_tilfa_ns_local_srlg/templates/tilfa_ns_local_srlg.j2 similarity index 100% rename from chapter11/lab_10_P2.tilfa_ns_local_srlg.xrcfg rename to roles/lab_12_tilfa_ns_local_srlg/templates/tilfa_ns_local_srlg.j2 diff --git a/roles/lab_12_tilfa_ns_local_srlg/vars/main.yml b/roles/lab_12_tilfa_ns_local_srlg/vars/main.yml new file mode 100644 index 0000000..bc28abd --- /dev/null +++ b/roles/lab_12_tilfa_ns_local_srlg/vars/main.yml @@ -0,0 +1,8 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa_ns_local_srlg.j2 +command_set_1: +- sh isis fast-reroute 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_13_tilfa_ns_global_srlg/tasks/main.yml b/roles/lab_13_tilfa_ns_global_srlg/tasks/main.yml new file mode 100644 index 0000000..47ad815 --- /dev/null +++ b/roles/lab_13_tilfa_ns_global_srlg/tasks/main.yml @@ -0,0 +1,71 @@ +--- +- name: 13.0 RENDER AND DISPLAY THE TI-LFA GLOBAL WEIGHTED SRLG PROTECTION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 13.1 RENDER AND SAVE THE TI-LFA GLOBAL WEIGHTED SRLG PROTECTION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_11_{{ hostname }}.tilfa_ns_gw_srlg.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 13.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 13.3 RENDER AND APPLY THE TI-LFA GLOBAL WEIGHTED SRLG PROTECTION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 13.4 RUN COMMANDS TO VERIFY TI-LFA GLOBAL WEIGHTED SRLG PROTECTION + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + when: inventory_hostname == "P2" + +- name: 13.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" + +- name: 13.6 RENDER AND DISPLAY THE TI-LFA GLOBAL WEIGHTED SRLG REVERSAL CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + +- name: 13.7 RENDER AND SAVE THE TI-LFA GLOBAL WEIGHTED SRLG REVERSAL CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_11_{{ hostname }}.tilfa_ns_gw_srlg_revert.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 13.8 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 13.9 RENDER AND APPLY THE TI-LFA GLOBAL WEIGHTED SRLG REVERSAL CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none \ No newline at end of file diff --git a/chapter12/lab_11_P2.tilfa_ns_gw_srlg.xrcfg b/roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_p2.j2 similarity index 100% rename from chapter12/lab_11_P2.tilfa_ns_gw_srlg.xrcfg rename to roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_p2.j2 diff --git a/chapter12/lab_11_P7.tilfa_ns_gw_srlg.xrcfg b/roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_p7.j2 similarity index 100% rename from chapter12/lab_11_P7.tilfa_ns_gw_srlg.xrcfg rename to roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_p7.j2 diff --git a/chapter12/lab_11_P2.tilfa_ns_gw_srlg_revert.xrcfg b/roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_revert_p2.j2 similarity index 100% rename from chapter12/lab_11_P2.tilfa_ns_gw_srlg_revert.xrcfg rename to roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_revert_p2.j2 diff --git a/chapter12/lab_11_P7.tilfa_ns_gw_srlg_revert.xrcfg b/roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_revert_p7.j2 similarity index 100% rename from chapter12/lab_11_P7.tilfa_ns_gw_srlg_revert.xrcfg rename to roles/lab_13_tilfa_ns_global_srlg/templates/tilfa_ns_global_srlg_revert_p7.j2 diff --git a/roles/lab_13_tilfa_ns_global_srlg/vars/main.yml b/roles/lab_13_tilfa_ns_global_srlg/vars/main.yml new file mode 100644 index 0000000..cebf73e --- /dev/null +++ b/roles/lab_13_tilfa_ns_global_srlg/vars/main.yml @@ -0,0 +1,10 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa_ns_global_srlg_{{ inventory_hostname | lower }}.j2 +- tilfa_ns_global_srlg_revert_{{ inventory_hostname | lower }}.j2 +command_set_1: +- show isis database verbose internal P7 | utility egrep -A10 SRLG +- sh isis fast-reroute 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_14_tilfa_ns_node_plus_srlg/tasks/main.yml b/roles/lab_14_tilfa_ns_node_plus_srlg/tasks/main.yml new file mode 100644 index 0000000..5809750 --- /dev/null +++ b/roles/lab_14_tilfa_ns_node_plus_srlg/tasks/main.yml @@ -0,0 +1,70 @@ +--- +- name: 14.0 RENDER AND DISPLAY THE TI-LFA NODE + SRLG PROTECTION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 14.1 RENDER AND SAVE THE TI-LFA NODE + SRLG PROTECTION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_12_{{ hostname }}.tilfa_ns_node_plus_srlg.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 14.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 14.3 RENDER AND APPLY THE TI-LFA NODE + SRLG PROTECTION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 14.4 RUN COMMANDS TO VERIFY TI-LFA NODE + SRLG PROTECTION + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + +- name: 14.5 DISPLAY OUTPUT FOR THE COMMANDS RUN IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + +- name: 14.6 RUN AND PARSE WITH TTP(TEMPLATE TEXT PARSER) TO CAPTURE TUNNEL-ID + ansible.utils.cli_parse: + command: show cef 5.5.5.5/32 + parser: + name: ansible.utils.ttp + template_path: "templates/iosxr_show_cef_5_5_5_5_32.ttp" + set_fact: show_cef_5_5_5_5_32 + +- name: 14.7 DISPLAY OUTPUT FOR THE COMMANDS RUN IN THE PREVIOUS TASK + debug: + msg: + - "show cef 5.5.5.5/32" + - "{{ show_cef_5_5_5_5_32 }}" + +- name: 14.8 USE THE CAPTURED TUNNEL-ID TO VERIFY LABEL STACK + cisco.iosxr.iosxr_command: + commands: + - show mpls traffic-eng tunnels {{ show_cef_5_5_5_5_32[0][0].tunnelid }} + register: output + +- name: 14.9 DISPLAY OUTPUT FOR THE COMMANDS RUN IN THE PREVIOUS TASK + debug: + msg: + - "show mpls traffic-eng tunnels {{ show_cef_5_5_5_5_32[0][0].tunnelid }}" + - "{{ output.stdout_lines[0] }}" \ No newline at end of file diff --git a/chapter13/lab_12_P2.tilfa_ns_node_plus_srlg.xrcfg b/roles/lab_14_tilfa_ns_node_plus_srlg/templates/tilfa_ns_node.j2 similarity index 100% rename from chapter13/lab_12_P2.tilfa_ns_node_plus_srlg.xrcfg rename to roles/lab_14_tilfa_ns_node_plus_srlg/templates/tilfa_ns_node.j2 diff --git a/roles/lab_14_tilfa_ns_node_plus_srlg/vars/main.yml b/roles/lab_14_tilfa_ns_node_plus_srlg/vars/main.yml new file mode 100644 index 0000000..76ea5e7 --- /dev/null +++ b/roles/lab_14_tilfa_ns_node_plus_srlg/vars/main.yml @@ -0,0 +1,8 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa_ns_node.j2 +command_set_1: +- show isis fast-reroute 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/tasks/main.yml b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/tasks/main.yml new file mode 100644 index 0000000..d41b758 --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/tasks/main.yml @@ -0,0 +1,183 @@ +--- +- name: 15.0 RENDER AND DISPLAY P9 PREP CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + when: inventory_hostname == "P9" + +- name: 15.1 RENDER AND SAVE P9 PREP CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_13_{{ hostname }}.prep.xrcfg" + register: output + when: inventory_hostname == "P9" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 15.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P9" + +- name: 15.3 RENDER AND APPLY P9 PREP CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + when: inventory_hostname == "P9" + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 15.4 RENDER AND DISPLAY THE TI-LFA LINK PROTECTION PREFER CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + when: inventory_hostname == "P2" + +- name: 15.5 RENDER AND SAVE THE TI-LFA LINK PROTECTION PREFER CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_13_{{ hostname }}.tilfa_tiebrkr_prefer_link.xrcfg" + when: inventory_hostname == "P2" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 15.6 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P2" + +- name: 15.7 RENDER AND APPLY THE TI-LFA LINK PROTECTION PREFER CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none + when: inventory_hostname == "P2" + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 15.8 RUN COMMANDS TO VERIFY TI-LFA LINK PROTECTION PREFER + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + when: inventory_hostname == "P2" + +- name: 15.9 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" + +- name: 15.10 RENDER AND DISPLAY THE TI-LFA SRLG PROTECTION PREFER CONFIGURATION + debug: + msg: + - "template: {{ templates[2] }}" + - "{{ lookup('template', templates[2]).split('\n') }}" + when: inventory_hostname == "P9" + +- name: 15.11 RENDER AND SAVE THE TI-LFA SRLG PROTECTION PREFER CONFIGURATION + template: + src: "{{ templates[2] }}" + dest: "xrcfg/lab_13_{{ hostname }}.tilfa_tiebrkr_prefer_srlg.xrcfg" + register: output + when: inventory_hostname == "P9" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 15.12 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P9" + +- name: 15.13 RENDER AND APPLY THE TI-LFA SRLG PROTECTION PREFER CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[2] }}" + match: none + when: inventory_hostname == "P9" + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 15.14 RUN COMMANDS TO VERIFY TI-LFA SRLG PROTECTION PREFER + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + when: inventory_hostname == "P2" + +- name: 15.15 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" + +- name: 15.16 RENDER AND DISPLAY TI-LFA NODE PROTECTION PREFER CONFIGURATION + debug: + msg: + - "template: {{ templates[3] }}" + - "{{ lookup('template', templates[3]).split('\n') }}" + when: inventory_hostname == "P2" + +- name: 15.17 RENDER AND SAVE TI-LFA NODE PROTECTION PREFERCONFIGURATION + template: + src: "{{ templates[3] }}" + dest: "xrcfg/lab_13_{{ hostname }}.prep.xrcfg" + register: output + when: inventory_hostname == "P2" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 15.18 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P2" + +- name: 15.19 RENDER AND APPLY TI-LFA NODE PROTECTION PREFER CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[3] }}" + match: none + when: inventory_hostname == "P2" + +- name: "{{ mins }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 15.20 RUN COMMANDS TO VERIFY TI-LFA NODE PROTECTION PREFER + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + register: output + when: inventory_hostname == "P2" + +- name: 15.21 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/ip_igp_ldp_template.j2 b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/ip_igp_ldp_template.j2 new file mode 100644 index 0000000..56a6f9c --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/ip_igp_ldp_template.j2 @@ -0,0 +1,54 @@ + +hostname {{ hostname }} +root + +{% for interface in interfaces -%} + +interface {{ interface.name }} + ipv4 address {{ interface.address }} + description {{ interface.description }} + no shutdown +! +root + +{% endfor -%} + +router isis IGP + is-type level-2-only + net {{ protocols.isis.0.net }} + log adjacency changes + address-family ipv4 unicast + mpls ldp auto-config + metric-style wide level 2 + ! + {% for interface in protocols.isis[0].interfaces -%} + + interface {{ interface.name }} + {% if interface.loopback == True -%} + passive + address-family ipv4 unicast + ! + ! + {% else -%} + circuit-type level-2-only + point-to-point + hello-padding disable + address-family ipv4 unicast + metric {{ interface.metric }} + ! + ! + {% endif -%} + {% endfor %} +! +root + +mpls oam +! +mpls ldp + log + neighbor + ! +! +root +! + diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/prep_p9.j2 b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/prep_p9.j2 new file mode 100644 index 0000000..6fe3d3a --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/prep_p9.j2 @@ -0,0 +1,11 @@ +{% include "ip_igp_ldp_template.j2" %} + +{% include "sr_template.j2" %} + +{% include "sr_only_remove_ldp.j2" %} + +{% include "sr_prefer_template.j2" %} + +{% include "tilfa.j2" %} +! + diff --git a/chapter4/lab_3_P2.noldp.xrcfg b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_only_remove_ldp.j2 similarity index 100% rename from chapter4/lab_3_P2.noldp.xrcfg rename to roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_only_remove_ldp.j2 diff --git a/chapter3/lab_2_P2.srprefer.xrcfg b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_prefer_template.j2 similarity index 100% rename from chapter3/lab_2_P2.srprefer.xrcfg rename to roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_prefer_template.j2 diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_template.j2 b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_template.j2 new file mode 100644 index 0000000..9e307ee --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/sr_template.j2 @@ -0,0 +1,11 @@ +router isis IGP + address-family ipv4 unicast + segment-routing mpls + ! + interface Loopback0 + address-family ipv4 unicast + prefix-sid index {{ protocols.isis[0].sid }} + ! + ! +! + diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa.j2 b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa.j2 new file mode 100644 index 0000000..936c5bf --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa.j2 @@ -0,0 +1,8 @@ +{% for interface in protocols.isis[0].interfaces -%} +{% if interface.loopback != True -%} +router isis IGP interface {{ interface.name }} address-family ipv4 unicast fast-reroute per-prefix +router isis IGP interface {{ interface.name }} address-family ipv4 unicast fast-reroute per-prefix ti-lfa +{% endif -%} +{% endfor -%} +! + diff --git a/chapter14/lab_13_P2.tilfa_tiebrkr_prefer_link.xrcfg b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_link.j2 similarity index 100% rename from chapter14/lab_13_P2.tilfa_tiebrkr_prefer_link.xrcfg rename to roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_link.j2 diff --git a/chapter14/lab_13_P2.prep.xrcfg b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_node.j2 similarity index 100% rename from chapter14/lab_13_P2.prep.xrcfg rename to roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_node.j2 diff --git a/chapter14/lab_13_P9.tilfa_tiebrkr_prefer_srlg.xrcfg b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_srlg.j2 similarity index 100% rename from chapter14/lab_13_P9.tilfa_tiebrkr_prefer_srlg.xrcfg rename to roles/lab_15_tilfa_tiebrkr_link_node_srlg/templates/tilfa_tiebrkr_prefer_srlg.j2 diff --git a/roles/lab_15_tilfa_tiebrkr_link_node_srlg/vars/main.yml b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/vars/main.yml new file mode 100644 index 0000000..4edddb8 --- /dev/null +++ b/roles/lab_15_tilfa_tiebrkr_link_node_srlg/vars/main.yml @@ -0,0 +1,12 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- prep_p9.j2 +- tilfa_tiebrkr_prefer_link.j2 +- tilfa_tiebrkr_prefer_srlg.j2 +- tilfa_tiebrkr_prefer_node.j2 +command_set_1: +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show cef 5.5.5.5/32 diff --git a/roles/lab_1_getting_started/tasks/main.yml b/roles/lab_1_getting_started/tasks/main.yml new file mode 100644 index 0000000..1aec77d --- /dev/null +++ b/roles/lab_1_getting_started/tasks/main.yml @@ -0,0 +1,53 @@ +--- +- name: 1.0 RENDER AND DISPLAY THE IP, ISIS & LDP CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 1.1 RENDER AND SAVE THE IP, ISIS & LDP CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_1_{{ hostname }}.ip_mpls.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 1.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 1.3 RENDER AND APPLY THE IP, ISIS & LDP CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} mins PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 1.4 RUN COMMANDS TO CAPTURE IP, ISIS & LDP STATE + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "PE1" + register: output + +- name: 1.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "PE1" + +- name: 1.6 RUN COMMANDS TO TRACE LABELS FROM PE1 TO PE5 + cisco.iosxr.iosxr_command: + commands: + - show mpls forwarding prefix 5.5.5.5/32 + when: inventory_hostname == "PE1" or hostname == "P2" or hostname == "P3" or hostname == "P7" or hostname == "P4" + register: output diff --git a/roles/lab_1_getting_started/templates/ip_igp_ldp_template.j2 b/roles/lab_1_getting_started/templates/ip_igp_ldp_template.j2 new file mode 100644 index 0000000..56a6f9c --- /dev/null +++ b/roles/lab_1_getting_started/templates/ip_igp_ldp_template.j2 @@ -0,0 +1,54 @@ + +hostname {{ hostname }} +root + +{% for interface in interfaces -%} + +interface {{ interface.name }} + ipv4 address {{ interface.address }} + description {{ interface.description }} + no shutdown +! +root + +{% endfor -%} + +router isis IGP + is-type level-2-only + net {{ protocols.isis.0.net }} + log adjacency changes + address-family ipv4 unicast + mpls ldp auto-config + metric-style wide level 2 + ! + {% for interface in protocols.isis[0].interfaces -%} + + interface {{ interface.name }} + {% if interface.loopback == True -%} + passive + address-family ipv4 unicast + ! + ! + {% else -%} + circuit-type level-2-only + point-to-point + hello-padding disable + address-family ipv4 unicast + metric {{ interface.metric }} + ! + ! + {% endif -%} + {% endfor %} +! +root + +mpls oam +! +mpls ldp + log + neighbor + ! +! +root +! + diff --git a/roles/lab_1_getting_started/vars/main.yml b/roles/lab_1_getting_started/vars/main.yml new file mode 100644 index 0000000..be78c68 --- /dev/null +++ b/roles/lab_1_getting_started/vars/main.yml @@ -0,0 +1,18 @@ +--- +mins: 2 +slow_secs: 1 +templates: +- ip_igp_ldp_template.j2 +command_set_1: +- show ipv4 interface brief +- ping 12.0.0.2 +- show isis adjacency +- show route +- show isis route 5.5.5.5/32 detail +- show route 5.5.5.5/32 detail +- show mpls ldp neighbor brief +- show mpls label table +- show mpls forwarding +- show cef 5.5.5.5/32 +- traceroute mpls ipv4 5.5.5.5/32 +- traceroute mpls multipath ipv4 5.5.5.5/32 verbose diff --git a/roles/lab_1x_getting_started/tasks/main.yml b/roles/lab_1x_getting_started/tasks/main.yml new file mode 100644 index 0000000..77da360 --- /dev/null +++ b/roles/lab_1x_getting_started/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "show mpls forwarding prefix 5.5.5.5/32" + - "{{ output.stdout_lines[0] }}" diff --git a/roles/lab_2_intro_segment_routing/tasks/main.yml b/roles/lab_2_intro_segment_routing/tasks/main.yml new file mode 100644 index 0000000..c44b9e1 --- /dev/null +++ b/roles/lab_2_intro_segment_routing/tasks/main.yml @@ -0,0 +1,92 @@ +--- +- name: 2.0 RENDER AND DISPLAY SEGMENT ROUTING CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 2.1 RENDER AND SAVE THE SEGMENT ROUTING CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_2_{{ hostname }}.sr.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 2.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 2.3 RENDER AND APPLY THE SEGMENT ROUTING CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 2.4 RUN COMMANDS TO VERIFY SR AND LDP STATE + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "PE1" + register: output + +- name: 2.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "PE1" + +- name: 2.6 RENDER AND DISPLAY THE SR-PREFER CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + +- name: 2.7 RENDER AND SAVE THE SR-PREFER CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_2_{{ hostname }}.srprefer.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 2.8 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 2.9 RENDER AND APPLY THE SR-PREFER CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 2.10 RUN COMMANDS TO VERIFY SR-PREFER STATE + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_2 }}" + when: hostname == "PE1" + register: output + +- name: 2.11 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_2 }}" + loop_control: + index_var: idx + when: hostname == "PE1" \ No newline at end of file diff --git a/chapter3/lab_2_P3.srprefer.xrcfg b/roles/lab_2_intro_segment_routing/templates/sr_prefer_template.j2 similarity index 100% rename from chapter3/lab_2_P3.srprefer.xrcfg rename to roles/lab_2_intro_segment_routing/templates/sr_prefer_template.j2 diff --git a/roles/lab_2_intro_segment_routing/templates/sr_template.j2 b/roles/lab_2_intro_segment_routing/templates/sr_template.j2 new file mode 100644 index 0000000..9e307ee --- /dev/null +++ b/roles/lab_2_intro_segment_routing/templates/sr_template.j2 @@ -0,0 +1,11 @@ +router isis IGP + address-family ipv4 unicast + segment-routing mpls + ! + interface Loopback0 + address-family ipv4 unicast + prefix-sid index {{ protocols.isis[0].sid }} + ! + ! +! + diff --git a/roles/lab_2_intro_segment_routing/vars/main.yml b/roles/lab_2_intro_segment_routing/vars/main.yml new file mode 100644 index 0000000..067f01e --- /dev/null +++ b/roles/lab_2_intro_segment_routing/vars/main.yml @@ -0,0 +1,19 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- sr_template.j2 +- sr_prefer_template.j2 +command_set_1: +- show mpls label table detail +- show isis adjacency detail +- show isis database verbose PE1 +- show isis segment-routing label table +- show route 7.7.7.7/32 detail +- show mpls forwarding +- show cef 7.7.7.7/32 +- traceroute mpls ipv4 7.7.7.7/32 +- traceroute sr-mpls 7.7.7.7/32 +command_set_2: +- traceroute mpls ipv4 7.7.7.7/32 +- traceroute mpls ipv4 5.5.5.5/32 diff --git a/roles/lab_3_sr_ldp_interworking/tasks/main.yml b/roles/lab_3_sr_ldp_interworking/tasks/main.yml new file mode 100644 index 0000000..b109e00 --- /dev/null +++ b/roles/lab_3_sr_ldp_interworking/tasks/main.yml @@ -0,0 +1,258 @@ +--- +- name: 3.0 RENDER AND DISPLAY THE LDP REMOVAL CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + when: hostname == "PE1" or hostname == "P2" or hostname == "P6" + +- name: 3.1 RENDER AND SAVE THE LDP REMOVAL CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_3_{{ hostname }}.noldp.xrcfg" + register: output + when: hostname == "PE1" or hostname == "P2" or hostname == "P6" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 3.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: hostname == "PE1" or hostname == "P2" or hostname == "P6" + +- name: 3.3 RENDER AND APPLY THE LDP REMOVAL CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + when: hostname == "PE1" or hostname == "P2" or hostname == "P6" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 3.4 TRACEOUTE MPLS 5.5.5.5/32 + cisco.iosxr.iosxr_command: + commands: + - traceroute mpls ipv4 5.5.5.5/32 + when: hostname == "PE1" + register: output + +- name: 3.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "traceroute mpls ipv4 5.5.5.5/32" + - "{{ output.stdout_lines[0] }}" + when: hostname == "PE1" + +- name: 3.6 STITCH LDP TO SR (works automatically) TRACEROUTE MPLS 1.1.1.1/32 + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "PE5" + register: output + +- name: 3.7 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "PE5" + +- name: 3.8 RUN COMMANDS TO VERIFY LDP TO SR LABEL STITCHING + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_2 }}" + when: hostname == "P3" + register: output + +- name: 3.9 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_2 }}" + loop_control: + index_var: idx + when: hostname == "P3" + +- name: 3.10 RUN AND PARSE WITH TTP(TEMPLATE TEXT PARSER) TO CAPTURE LOCAL LDP LABEL + ansible.utils.cli_parse: + command: show mpls ldp forwarding 1.1.1.1/32 + parser: + name: ansible.utils.ttp + template_path: "templates/iosxr_show_mpls_forwarding_prefix.ttp" + set_fact: show_mpls_ldp_forwarding_1_1_1_1 + when: hostname == "P3" + +- name: 3.11 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "show mpls ldp forwarding 1.1.1.1/32" + - "{{ show_mpls_ldp_forwarding_1_1_1_1 }}" + when: hostname == "P3" + +- name: 3.12 USE THE CAPTURED LOCAL/IN LABEL TO VERIFY STITCHED SR LABEL + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_3 }}" + when: hostname == "P3" + register: output + +- name: 3.13 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_3 }}" + loop_control: + index_var: idx + when: hostname == "P3" + +- name: 3.14 RENDER AND DISPLAY SRMS [SEGMENT ROUTING MAPPING SERVER] CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + when: hostname == "P6" + +- name: 3.15 RENDER AND SAVE SRMS [SEGMENT ROUTING MAPPING SERVER] CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_3_{{ hostname }}.srms.xrcfg" + register: output + when: hostname == "P6" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 3.16 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: hostname == "P6" + +- name: 3.17 STITCH SR TO LDP (RENDER AND CONFIGURE SRMS [SEGMENT ROUTING MAPPING SERVER]) + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none + when: hostname == "P6" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 3.18 RUN COMMANDS TO VERIFY SR TO LDP LABEL STITCHING + cisco.iosxr.iosxr_command: + commands: + - show cef 5.5.5.5/32 + when: hostname == "P3" + register: output + +- name: 3.19 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "show cef 5.5.5.5/32" + - "{{ output.stdout_lines }}" + when: hostname == "P3" + +- name: 3.20 TRACEOUTE MPLS 5.5.5.5/32 + cisco.iosxr.iosxr_command: + commands: + - traceroute sr-mpls 5.5.5.5/32 + when: hostname == "PE1" + register: output + +- name: 3.21 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "traceroute sr-mpls 5.5.5.5/32" + - "{{ output.stdout_lines }}" + when: hostname == "PE1" + +- name: 3.22 RENDER AND DISPLAY SR-PREFER CONFIGURATION + debug: + msg: + - "template: {{ templates[2] }}" + - "{{ lookup('template', templates[2]).split('\n') }}" + when: hostname == "PE5" or hostname == "P4" or hostname == "P8" + +- name: 3.23 RENDER AND SAVE THE SR-PREFER CONFIGURATION + template: + src: "{{ templates[2] }}" + dest: "xrcfg/lab_3_{{ hostname }}.sronly_p1.xrcfg" + register: output + when: hostname == "PE5" or hostname == "P4" or hostname == "P8" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 3.24 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: hostname == "PE5" or hostname == "P4" or hostname == "P8" + +- name: 3.25 CONFIGURE SR WITH SR-PREFER ON REMAINING ROUTERS + cisco.iosxr.iosxr_config: + src: "{{ templates[2] }}" + match: none + when: hostname == "PE5" or hostname == "P4" or hostname == "P8" + +- name: 3.26 RENDER AND DISPLAY REMOVE LDP CONFIGURATION + debug: + msg: + - "template: {{ templates[3] }}" + - "{{ lookup('template', templates[3]).split('\n') }}" + +- name: 3.27 RENDER AND SAVE REMOVE LDP CONFIGURATION + template: + src: "{{ templates[3] }}" + dest: "xrcfg/lab_3_{{ hostname }}.noldp.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 3.28 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 3.29 REMOVE LDP FROM ALL ROUTERS + cisco.iosxr.iosxr_config: + src: "{{ templates[3] }}" + match: none + +- name: 3.30 RENDER AND DISPLAY SRMS REMOVAL CONFIGURATION + debug: + msg: + - "template: {{ templates[4] }}" + - "{{ lookup('template', templates[4]).split('\n') }}" + when: hostname == "P6" + +- name: 3.31 RENDER AND SAVE SRMS REMOVAL CONFIGURATION + template: + src: "{{ templates[4] }}" + dest: "xrcfg/lab_3_{{ hostname }}.nosrms.xrcfg" + when: hostname == "P6" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 3.32 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: hostname == "P6" + +- name: 3.33 RENDER AND REMOVE SRMS CONFIGURATION FROM P6 + cisco.iosxr.iosxr_config: + src: "{{ templates[4] }}" + match: none + when: hostname == "P6" diff --git a/roles/lab_3_sr_ldp_interworking/templates/iosxr_show_mpls_forwarding_prefix.ttp b/roles/lab_3_sr_ldp_interworking/templates/iosxr_show_mpls_forwarding_prefix.ttp new file mode 100644 index 0000000..800586b --- /dev/null +++ b/roles/lab_3_sr_ldp_interworking/templates/iosxr_show_mpls_forwarding_prefix.ttp @@ -0,0 +1 @@ +1.1.1.1/32 {{ in_label }} {{ out_label }} Gi0/0/0/0 23.0.0.2 diff --git a/roles/lab_3_sr_ldp_interworking/templates/sr_ldp_template.j2 b/roles/lab_3_sr_ldp_interworking/templates/sr_ldp_template.j2 new file mode 100644 index 0000000..fe97ded --- /dev/null +++ b/roles/lab_3_sr_ldp_interworking/templates/sr_ldp_template.j2 @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + no mpls ldp auto-config + ! +! + diff --git a/roles/lab_3_sr_ldp_interworking/templates/sr_only_part1.j2 b/roles/lab_3_sr_ldp_interworking/templates/sr_only_part1.j2 new file mode 100644 index 0000000..2571b79 --- /dev/null +++ b/roles/lab_3_sr_ldp_interworking/templates/sr_only_part1.j2 @@ -0,0 +1,11 @@ +router isis IGP + address-family ipv4 unicast + segment-routing mpls sr-prefer + ! + interface Loopback0 + address-family ipv4 unicast + prefix-sid index {{ protocols.isis[0].sid }} + ! + ! +! + diff --git a/chapter4/lab_3_P3.noldp.xrcfg b/roles/lab_3_sr_ldp_interworking/templates/sr_only_remove_ldp.j2 similarity index 100% rename from chapter4/lab_3_P3.noldp.xrcfg rename to roles/lab_3_sr_ldp_interworking/templates/sr_only_remove_ldp.j2 diff --git a/chapter4/lab_3_P6.nosrms.xrcfg b/roles/lab_3_sr_ldp_interworking/templates/sr_only_remove_srms.j2 similarity index 100% rename from chapter4/lab_3_P6.nosrms.xrcfg rename to roles/lab_3_sr_ldp_interworking/templates/sr_only_remove_srms.j2 diff --git a/chapter4/lab_3_P6.srms.xrcfg b/roles/lab_3_sr_ldp_interworking/templates/srms_template.j2 similarity index 100% rename from chapter4/lab_3_P6.srms.xrcfg rename to roles/lab_3_sr_ldp_interworking/templates/srms_template.j2 diff --git a/roles/lab_3_sr_ldp_interworking/vars/main.yml b/roles/lab_3_sr_ldp_interworking/vars/main.yml new file mode 100644 index 0000000..21ecbcb --- /dev/null +++ b/roles/lab_3_sr_ldp_interworking/vars/main.yml @@ -0,0 +1,19 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- sr_ldp_template.j2 +- srms_template.j2 +- sr_only_part1.j2 +- sr_only_remove_ldp.j2 +- sr_only_remove_srms.j2 +command_set_1: +- traceroute mpls ipv4 1.1.1.1/32 +- traceroute mpls multipath ipv4 1.1.1.1/32 verbose +command_set_2: +- show cef 1.1.1.1/32 +- show mpls forwarding prefix 1.1.1.1/32 +- show mpls ldp forwarding 1.1.1.1/32 +command_set_3: +- show mpls forwarding labels {{ show_mpls_ldp_forwarding_1_1_1_1[0][0].in_label }} +- show cef mpls local-label {{ show_mpls_ldp_forwarding_1_1_1_1[0][0].in_label }} eOS detail diff --git a/roles/lab_4_tilfa/tasks/main.yml b/roles/lab_4_tilfa/tasks/main.yml new file mode 100644 index 0000000..8af244f --- /dev/null +++ b/roles/lab_4_tilfa/tasks/main.yml @@ -0,0 +1,46 @@ +--- +- name: 4.0 RENDER AND DISPLAY THE TI-LFA CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 4.1 RENDER AND SAVE THE TI-LFA CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_4_{{ hostname }}.tilfa.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 4.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 4.3 RENDER AND APPLY THE TI-LFA CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 4.4 RUN COMMANDS TO VERIFY TI-LFA IS ENABLED + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "P2" + register: output + +- name: 4.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "P2" diff --git a/roles/lab_4_tilfa/templates/tilfa.j2 b/roles/lab_4_tilfa/templates/tilfa.j2 new file mode 100644 index 0000000..936c5bf --- /dev/null +++ b/roles/lab_4_tilfa/templates/tilfa.j2 @@ -0,0 +1,8 @@ +{% for interface in protocols.isis[0].interfaces -%} +{% if interface.loopback != True -%} +router isis IGP interface {{ interface.name }} address-family ipv4 unicast fast-reroute per-prefix +router isis IGP interface {{ interface.name }} address-family ipv4 unicast fast-reroute per-prefix ti-lfa +{% endif -%} +{% endfor -%} +! + diff --git a/roles/lab_4_tilfa/vars/main.yml b/roles/lab_4_tilfa/vars/main.yml new file mode 100644 index 0000000..91dde7d --- /dev/null +++ b/roles/lab_4_tilfa/vars/main.yml @@ -0,0 +1,10 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- tilfa.j2 +command_set_1: +- show isis interface GigabitEthernet 0/0/0/0 +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show cef 5.5.5.5/32 diff --git a/roles/lab_5_zs_tilfa/tasks/main.yml b/roles/lab_5_zs_tilfa/tasks/main.yml new file mode 100644 index 0000000..6ae7af6 --- /dev/null +++ b/roles/lab_5_zs_tilfa/tasks/main.yml @@ -0,0 +1,71 @@ +--- +- name: 5.0 RENDER AND DISPLAY THE ZERO SEGMENT TI-LFA CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 5.1 RENDER AND SAVE THE ZERO SEGMENT TI-LFA CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_5_{{ hostname }}.zs_tilfa.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 5.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 5.3 RENDER AND APPLY THE ZERO SEGMENT TI-LFA CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 5.4 RUN COMMANDS TO VERIFY ZERO SEGMENT TI-LFA SCENARIO + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "P2" + register: output + +- name: 5.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "P2" + +- name: 5.6 RENDER AND DISPLAY THE ZERO SEGMENT TI-LFA REVERSAL CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + +- name: 5.7 RENDER AND SAVE THE ZERO SEGMENT TI-LFA REVARSAL CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_5_{{ hostname }}.zs_tilfa_revert.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 5.8 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 5.9 RENDER AND REVERT ZERO SEGMENT TI-LFA SCENARIO CHANGES + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none \ No newline at end of file diff --git a/chapter6/lab_5_P2.zs_tilfa.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_p2.j2 similarity index 100% rename from chapter6/lab_5_P2.zs_tilfa.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_p2.j2 diff --git a/chapter6/lab_5_P6.zs_tilfa.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_p6.j2 similarity index 100% rename from chapter6/lab_5_P6.zs_tilfa.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_p6.j2 diff --git a/chapter6/lab_5_P7.zs_tilfa.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_p7.j2 similarity index 100% rename from chapter6/lab_5_P7.zs_tilfa.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_p7.j2 diff --git a/chapter6/lab_5_P2.zs_tilfa_revert.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p2.j2 similarity index 100% rename from chapter6/lab_5_P2.zs_tilfa_revert.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p2.j2 diff --git a/chapter6/lab_5_P6.zs_tilfa_revert.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p6.j2 similarity index 100% rename from chapter6/lab_5_P6.zs_tilfa_revert.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p6.j2 diff --git a/chapter6/lab_5_P7.zs_tilfa_revert.xrcfg b/roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p7.j2 similarity index 100% rename from chapter6/lab_5_P7.zs_tilfa_revert.xrcfg rename to roles/lab_5_zs_tilfa/templates/zs_tilfa_revert_p7.j2 diff --git a/roles/lab_5_zs_tilfa/vars/main.yml b/roles/lab_5_zs_tilfa/vars/main.yml new file mode 100644 index 0000000..f81b1b3 --- /dev/null +++ b/roles/lab_5_zs_tilfa/vars/main.yml @@ -0,0 +1,11 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- zs_tilfa_{{ inventory_hostname | lower }}.j2 +- zs_tilfa_revert_{{ inventory_hostname | lower }}.j2 +command_set_1: +- show isis route 5.5.5.5/32 detail +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show cef 5.5.5.5/32 diff --git a/roles/lab_6_ss_tilfa/tasks/main.yml b/roles/lab_6_ss_tilfa/tasks/main.yml new file mode 100644 index 0000000..36e23dc --- /dev/null +++ b/roles/lab_6_ss_tilfa/tasks/main.yml @@ -0,0 +1,50 @@ +--- +- name: 6.0 RENDER AND DISPLAY THE SINGLE SEGMENT TI-LFA CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + when: inventory_hostname == "P7" + +- name: 6.1 RENDER AND SAVE THE SINGLE SEGMENT TI-LFA CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_6_{{ hostname }}.ss_tilfa.xrcfg" + register: output + when: inventory_hostname == "P7" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 6.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P7" + +- name: 6.3 RENDER AND APPLY THE SINGLE SEGMENT TI-LFA CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + when: inventory_hostname == "P7" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 6.4 RUN COMMANDS TO VERIFY SINGLE SEGMENT TI-LFA SCENARIO + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: inventory_hostname == "P2" + register: output + +- name: 6.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" diff --git a/chapter7/lab_6_P7.ss_tilfa.xrcfg b/roles/lab_6_ss_tilfa/templates/ss_tilfa_p7.j2 similarity index 100% rename from chapter7/lab_6_P7.ss_tilfa.xrcfg rename to roles/lab_6_ss_tilfa/templates/ss_tilfa_p7.j2 diff --git a/roles/lab_6_ss_tilfa/vars/main.yml b/roles/lab_6_ss_tilfa/vars/main.yml new file mode 100644 index 0000000..2fbc31b --- /dev/null +++ b/roles/lab_6_ss_tilfa/vars/main.yml @@ -0,0 +1,10 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- ss_tilfa_{{ inventory_hostname | lower }}.j2 +command_set_1: +- show isis route 5.5.5.5/32 detail +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show cef 5.5.5.5/32 diff --git a/roles/lab_7_ds_tilfa/tasks/main.yml b/roles/lab_7_ds_tilfa/tasks/main.yml new file mode 100644 index 0000000..5491617 --- /dev/null +++ b/roles/lab_7_ds_tilfa/tasks/main.yml @@ -0,0 +1,96 @@ +--- +- name: 7.0 RENDER AND DISPLAY THE DOUBLE SEGMENT TI-LFA CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + when: inventory_hostname == "P4" or hostname == "P8" + +- name: 7.1 RENDER AND SAVE THE DOUBLE SEGMENT TI-LFA CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_7_{{ hostname }}.ds_tilfa.xrcfg" + register: output + when: inventory_hostname == "P4" or hostname == "P8" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 7.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P4" or hostname == "P8" + +- name: 7.3 RENDER AND APPLY THE DOUBLE SEGMENT TI-LFA CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + when: inventory_hostname == "P4" or hostname == "P8" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 7.4 RUN COMMANDS TO VERIFY DOUBLE SEGMENT TI-LFA SCENARIO...(A) + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: inventory_hostname == "P8" + register: output + +- name: 7.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P8" + +- name: 7.6 RUN COMMANDS TO VERIFY DOUBLE SEGMENT TI-LFA SCENARIO...(B) + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_2 }}" + when: inventory_hostname == "P2" + register: output + +- name: 7.7 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_2 }}" + loop_control: + index_var: idx + when: inventory_hostname == "P2" + +- name: 7.8 RENDER AND DISPLAY DOUBLE SEGMENT TI-LFA REVERSAL CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + when: inventory_hostname == "P4" or hostname == "P8" + +- name: 7.9 RENDER AND SAVE THE DOUBLE SEGMENT TI-LFA REVERSAL CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_7_{{ hostname }}.ds_tilfa_revert.xrcfg" + register: output + when: inventory_hostname == "P4" or hostname == "P8" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 7.10 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P4" or hostname == "P8" + +- name: 7.11 RENDER AND APPLY THE DOUBLE SEGMENT TI-LFA REVERSAL CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none + when: inventory_hostname == "P4" or hostname == "P8" diff --git a/chapter8/lab_7_P4.ds_tilfa.xrcfg b/roles/lab_7_ds_tilfa/templates/ds_tilfa.j2 similarity index 100% rename from chapter8/lab_7_P4.ds_tilfa.xrcfg rename to roles/lab_7_ds_tilfa/templates/ds_tilfa.j2 diff --git a/chapter8/lab_7_P4.ds_tilfa_revert.xrcfg b/roles/lab_7_ds_tilfa/templates/ds_tilfa_revert.j2 similarity index 100% rename from chapter8/lab_7_P4.ds_tilfa_revert.xrcfg rename to roles/lab_7_ds_tilfa/templates/ds_tilfa_revert.j2 diff --git a/roles/lab_7_ds_tilfa/vars/main.yml b/roles/lab_7_ds_tilfa/vars/main.yml new file mode 100644 index 0000000..e5166fc --- /dev/null +++ b/roles/lab_7_ds_tilfa/vars/main.yml @@ -0,0 +1,12 @@ +--- +mins: 1 +slow_secs: 1 +templates: +- ds_tilfa.j2 +- ds_tilfa_revert.j2 +command_set_1: +- traceroute sr-mpls 5.5.5.5/32 +- show isis adjacency Gi0/0/0/1 detail +command_set_2: +- show isis fast-reroute 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_8_microloop_avoidance/tasks/main.yml b/roles/lab_8_microloop_avoidance/tasks/main.yml new file mode 100644 index 0000000..9e52357 --- /dev/null +++ b/roles/lab_8_microloop_avoidance/tasks/main.yml @@ -0,0 +1,162 @@ +--- +- name: 8.0 RENDER AND DISPLAY THE PREPARATION CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + when: inventory_hostname == "P2" or hostname == "P8" + +- name: 8.1 RENDER AND SAVE THE PREPARATION CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_8_{{ hostname }}.mlaprep.xrcfg" + register: output + when: inventory_hostname == "P2" or hostname == "P8" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 8.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P2" or hostname == "P8" + +- name: 8.3 RENDER AND APPLY THE PREPARATION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none + when: inventory_hostname == "P2" or hostname == "P8" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 8.4 RUN COMMANDS TO CHECK PATH to PE5 IS VIA P3 + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_1 }}" + when: hostname == "P2" + register: output + +- name: 8.5 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_1 }}" + loop_control: + index_var: idx + when: hostname == "P2" + +- name: 8.6 RENDER AND DISPLAY THE MICROLOOP AVOIDANCE CONFIGURATION + debug: + msg: + - "template: {{ templates[1] }}" + - "{{ lookup('template', templates[1]).split('\n') }}" + when: inventory_hostname == "P2" + +- name: 8.7 RENDER AND SAVE THE MICROLOOP AVOIDANCE CONFIGURATION + template: + src: "{{ templates[1] }}" + dest: "xrcfg/lab_8_{{ hostname }}.mla.xrcfg" + register: output + when: inventory_hostname == "P2" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 8.8 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P2" + +- name: 8.9 RENDER AND APPLY THE MICROLOOP AVOIDANCE CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[1] }}" + match: none + when: inventory_hostname == "P2" + +- name: "{{ mins }} minutes PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + minutes: "{{ mins }}" + +- name: 8.10 RENDER AND DISPLAY THE MICROLOOP TRIGGER CONFIGURATION + debug: + msg: + - "template: {{ templates[2] }}" + - "{{ lookup('template', templates[2]).split('\n') }}" + when: inventory_hostname == "P8" + +- name: 8.11 RENDER AND SAVE THE MICROLOOP TRIGGER CONFIGURATION + template: + src: "{{ templates[2] }}" + dest: "xrcfg/lab_8_{{ hostname }}.mlatrgr.xrcfg" + register: output + when: inventory_hostname == "P8" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 8.12 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P8" + +- name: 8.13 RENDER AND APPLY THE MICROLOOP TRIGGER CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[2] }}" + match: none + when: inventory_hostname == "P8" + +- name: "{{ secs }} seconds PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ secs }}" + +- name: 8.14 RUN COMMANDS TO VERIFY MICROLOOP AVOIDANCE + cisco.iosxr.iosxr_command: + commands: + - "{{ item }}" + loop: "{{ command_set_2 }}" + when: hostname == "P2" + register: output + +- name: 8.15 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + msg: + - "{{ output.results[idx].stdout_lines }}" + loop: "{{ command_set_2 }}" + loop_control: + index_var: idx + when: hostname == "P2" + +- name: 8.16 RENDER AND DISPLAY THE RESTORATION CONFIGURATION + debug: + msg: + - "template: {{ templates[3] }}" + - "{{ lookup('template', templates[3]).split('\n') }}" + when: inventory_hostname == "P2" or hostname == "P7" + +- name: 8.17 RENDER AND SAVE THE RESTORATION CONFIGURATION + template: + src: "{{ templates[3] }}" + dest: "xrcfg/lab_8_{{ hostname }}.mlarestore.xrcfg" + register: output + when: inventory_hostname == "P2" or hostname == "P7" + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 8.18 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + when: inventory_hostname == "P2" or hostname == "P7" + +- name: 8.19 RENDER AND APPLY THE RESTORATION CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[3] }}" + match: none + when: inventory_hostname == "P2" or hostname == "P7" diff --git a/chapter9/lab_8_P2.mlaprep.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2.j2 similarity index 100% rename from chapter9/lab_8_P2.mlaprep.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2.j2 diff --git a/chapter9/lab_8_P2.mla.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2_enable.j2 similarity index 100% rename from chapter9/lab_8_P2.mla.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2_enable.j2 diff --git a/chapter9/lab_8_P2.mlarestore.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2_restore.j2 similarity index 100% rename from chapter9/lab_8_P2.mlarestore.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p2_restore.j2 diff --git a/chapter9/lab_8_P7.mlarestore.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p7_restore.j2 similarity index 100% rename from chapter9/lab_8_P7.mlarestore.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p7_restore.j2 diff --git a/chapter9/lab_8_P8.mlaprep.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p8.j2 similarity index 100% rename from chapter9/lab_8_P8.mlaprep.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p8.j2 diff --git a/chapter9/lab_8_P8.mlatrgr.xrcfg b/roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p8_trigger.j2 similarity index 100% rename from chapter9/lab_8_P8.mlatrgr.xrcfg rename to roles/lab_8_microloop_avoidance/templates/microloop_avoidance_p8_trigger.j2 diff --git a/roles/lab_8_microloop_avoidance/vars/main.yml b/roles/lab_8_microloop_avoidance/vars/main.yml new file mode 100644 index 0000000..cb208b2 --- /dev/null +++ b/roles/lab_8_microloop_avoidance/vars/main.yml @@ -0,0 +1,19 @@ +--- +mins: 1 +slow_secs: 1 +secs: 15 +templates: +- microloop_avoidance_{{ inventory_hostname | lower }}.j2 +- microloop_avoidance_{{ inventory_hostname | lower }}_enable.j2 +- microloop_avoidance_{{ inventory_hostname | lower }}_trigger.j2 +- microloop_avoidance_{{ inventory_hostname | lower }}_restore.j2 +command_set_1: +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show cef 5.5.5.5/32 +command_set_2: +- show isis protocol | utility egrep -A2 Micro +- show isis fast-reroute 5.5.5.5/32 detail +- show route 5.5.5.5/32 +- show route 5.5.5.5/32 detail +- show cef 5.5.5.5/32 diff --git a/roles/lab_9_mpls_traffic_eng/tasks/main.yml b/roles/lab_9_mpls_traffic_eng/tasks/main.yml new file mode 100644 index 0000000..c93046a --- /dev/null +++ b/roles/lab_9_mpls_traffic_eng/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: 9.0 RENDER AND DISPLAY THE MPLS TRAFFIC-ENGINEERING CONFIGURATION + debug: + msg: + - "template: {{ templates[0] }}" + - "{{ lookup('template', templates[0]).split('\n') }}" + +- name: 9.1 RENDER AND SAVE THE MPLS TRAFFIC-ENGINEERING CONFIGURATION + template: + src: "{{ templates[0] }}" + dest: "xrcfg/lab_9_{{ hostname }}.mpls_traffic_eng.xrcfg" + register: output + +- name: "{{ slow_secs }} secs PAUSE FOR CONVERGENCE" + ansible.builtin.pause: + seconds: "{{ slow_secs }}" + +- name: 9.2 DISPLAY THE OUTPUT REGISTERED IN THE PREVIOUS TASK + debug: + var: output.dest + +- name: 9.3 RENDER AND APPLY THE MPLS TRAFFIC-ENGINEERING CONFIGURATION + cisco.iosxr.iosxr_config: + src: "{{ templates[0] }}" + match: none \ No newline at end of file diff --git a/chapter10/lab_9_P2.mpls_traffic_eng.xrcfg b/roles/lab_9_mpls_traffic_eng/templates/mpls_traff_eng.j2 similarity index 100% rename from chapter10/lab_9_P2.mpls_traffic_eng.xrcfg rename to roles/lab_9_mpls_traffic_eng/templates/mpls_traff_eng.j2 diff --git a/roles/lab_9_mpls_traffic_eng/vars/main.yml b/roles/lab_9_mpls_traffic_eng/vars/main.yml new file mode 100644 index 0000000..3dcd0f8 --- /dev/null +++ b/roles/lab_9_mpls_traffic_eng/vars/main.yml @@ -0,0 +1,6 @@ +--- +mins: 1 +slow_secs: 1 +secs: 15 +templates: +- mpls_traff_eng.j2 diff --git a/templates/iosxr_show_cef_5_5_5_5_32.ttp b/templates/iosxr_show_cef_5_5_5_5_32.ttp new file mode 100644 index 0000000..9fdb7f7 --- /dev/null +++ b/templates/iosxr_show_cef_5_5_5_5_32.ttp @@ -0,0 +1 @@ + via 0.0.0.0/32, tunnel-te{{ tunnelid }}, 9 dependencies, weight 0, class 0, backup (Local-LFA) [flags 0x300] diff --git a/templates/iosxr_show_isis_adjacency.ttp b/templates/iosxr_show_isis_adjacency.ttp new file mode 100644 index 0000000..4248684 --- /dev/null +++ b/templates/iosxr_show_isis_adjacency.ttp @@ -0,0 +1 @@ +{{ neighbor }} {{ interface }} *PtoP* Up {{hold}} {{changed}} Yes None None diff --git a/templates/iosxr_show_mpls_forwarding_prefix.ttp b/templates/iosxr_show_mpls_forwarding_prefix.ttp new file mode 100644 index 0000000..800586b --- /dev/null +++ b/templates/iosxr_show_mpls_forwarding_prefix.ttp @@ -0,0 +1 @@ +1.1.1.1/32 {{ in_label }} {{ out_label }} Gi0/0/0/0 23.0.0.2 diff --git a/startup-config/lab_0_P2.base.xrcfg b/xrcfg/lab_0_P2.base.xrcfg similarity index 100% rename from startup-config/lab_0_P2.base.xrcfg rename to xrcfg/lab_0_P2.base.xrcfg diff --git a/startup-config/lab_0_P3.base.xrcfg b/xrcfg/lab_0_P3.base.xrcfg similarity index 100% rename from startup-config/lab_0_P3.base.xrcfg rename to xrcfg/lab_0_P3.base.xrcfg diff --git a/startup-config/lab_0_P4.base.xrcfg b/xrcfg/lab_0_P4.base.xrcfg similarity index 100% rename from startup-config/lab_0_P4.base.xrcfg rename to xrcfg/lab_0_P4.base.xrcfg diff --git a/startup-config/lab_0_P6.base.xrcfg b/xrcfg/lab_0_P6.base.xrcfg similarity index 100% rename from startup-config/lab_0_P6.base.xrcfg rename to xrcfg/lab_0_P6.base.xrcfg diff --git a/startup-config/lab_0_P7.base.xrcfg b/xrcfg/lab_0_P7.base.xrcfg similarity index 100% rename from startup-config/lab_0_P7.base.xrcfg rename to xrcfg/lab_0_P7.base.xrcfg diff --git a/startup-config/lab_0_P8.base.xrcfg b/xrcfg/lab_0_P8.base.xrcfg similarity index 100% rename from startup-config/lab_0_P8.base.xrcfg rename to xrcfg/lab_0_P8.base.xrcfg diff --git a/startup-config/lab_0_P9.base.xrcfg b/xrcfg/lab_0_P9.base.xrcfg similarity index 100% rename from startup-config/lab_0_P9.base.xrcfg rename to xrcfg/lab_0_P9.base.xrcfg diff --git a/startup-config/lab_0_PE1.base.xrcfg b/xrcfg/lab_0_PE1.base.xrcfg similarity index 100% rename from startup-config/lab_0_PE1.base.xrcfg rename to xrcfg/lab_0_PE1.base.xrcfg diff --git a/startup-config/lab_0_PE5.base.xrcfg b/xrcfg/lab_0_PE5.base.xrcfg similarity index 100% rename from startup-config/lab_0_PE5.base.xrcfg rename to xrcfg/lab_0_PE5.base.xrcfg diff --git a/xrcfg/lab_10_P2.tilfa_ns_local_srlg.xrcfg b/xrcfg/lab_10_P2.tilfa_ns_local_srlg.xrcfg new file mode 100644 index 0000000..a5841a5 --- /dev/null +++ b/xrcfg/lab_10_P2.tilfa_ns_local_srlg.xrcfg @@ -0,0 +1,15 @@ +srlg + interface GigabitEthernet0/0/0/0 + name SRLG-100 + ! + interface GigabitEthernet0/0/0/3 + name SRLG-100 + ! + name SRLG-100 value 100 +! +router isis IGP + address-family ipv4 unicast + fast-reroute per-prefix tiebreaker srlg-disjoint index 100 + ! +! + diff --git a/xrcfg/lab_11_P2.tilfa_ns_gw_srlg.xrcfg b/xrcfg/lab_11_P2.tilfa_ns_gw_srlg.xrcfg new file mode 100644 index 0000000..41a40b0 --- /dev/null +++ b/xrcfg/lab_11_P2.tilfa_ns_gw_srlg.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + fast-reroute per-prefix srlg-protection weighted-global + ! +! + diff --git a/xrcfg/lab_11_P2.tilfa_ns_gw_srlg_revert.xrcfg b/xrcfg/lab_11_P2.tilfa_ns_gw_srlg_revert.xrcfg new file mode 100644 index 0000000..23e6a51 --- /dev/null +++ b/xrcfg/lab_11_P2.tilfa_ns_gw_srlg_revert.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + no fast-reroute per-prefix srlg-protection weighted-global + ! +! + diff --git a/xrcfg/lab_11_P7.tilfa_ns_gw_srlg.xrcfg b/xrcfg/lab_11_P7.tilfa_ns_gw_srlg.xrcfg new file mode 100644 index 0000000..e315111 --- /dev/null +++ b/xrcfg/lab_11_P7.tilfa_ns_gw_srlg.xrcfg @@ -0,0 +1,11 @@ +srlg + interface GigabitEthernet0/0/0/1 + name SRLG-100 + ! + name SRLG-100 + value 100 + ! +! +router isis IGP address-family ipv4 unicast advertise application lfa link-attributes srlg +! + diff --git a/xrcfg/lab_11_P7.tilfa_ns_gw_srlg_revert.xrcfg b/xrcfg/lab_11_P7.tilfa_ns_gw_srlg_revert.xrcfg new file mode 100644 index 0000000..51aed7f --- /dev/null +++ b/xrcfg/lab_11_P7.tilfa_ns_gw_srlg_revert.xrcfg @@ -0,0 +1,3 @@ +no router isis IGP address-family ipv4 unicast advertise application lfa link-attributes srlg +! + diff --git a/xrcfg/lab_12_P2.tilfa_ns_node_plus_srlg.xrcfg b/xrcfg/lab_12_P2.tilfa_ns_node_plus_srlg.xrcfg new file mode 100644 index 0000000..c325e2d --- /dev/null +++ b/xrcfg/lab_12_P2.tilfa_ns_node_plus_srlg.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + fast-reroute per-prefix tiebreaker node-protecting index 200 + ! +! + diff --git a/xrcfg/lab_13_P2.prep.xrcfg b/xrcfg/lab_13_P2.prep.xrcfg new file mode 100644 index 0000000..78bd681 --- /dev/null +++ b/xrcfg/lab_13_P2.prep.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + fast-reroute per-prefix tiebreaker srlg-disjoint index 255 + ! +! + diff --git a/xrcfg/lab_13_P2.tilfa_tiebrkr_prefer_link.xrcfg b/xrcfg/lab_13_P2.tilfa_tiebrkr_prefer_link.xrcfg new file mode 100644 index 0000000..d098339 --- /dev/null +++ b/xrcfg/lab_13_P2.tilfa_tiebrkr_prefer_link.xrcfg @@ -0,0 +1,6 @@ +srlg + interface GigabitEthernet0/0/0/1 + name SRLG-100 + ! +! + diff --git a/chapter14/lab_13_P9.prep.xrcfg b/xrcfg/lab_13_P9.prep.xrcfg similarity index 100% rename from chapter14/lab_13_P9.prep.xrcfg rename to xrcfg/lab_13_P9.prep.xrcfg diff --git a/xrcfg/lab_13_P9.tilfa_tiebrkr_prefer_srlg.xrcfg b/xrcfg/lab_13_P9.tilfa_tiebrkr_prefer_srlg.xrcfg new file mode 100644 index 0000000..fe2ac98 --- /dev/null +++ b/xrcfg/lab_13_P9.tilfa_tiebrkr_prefer_srlg.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/3 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/chapter2/lab_1_P2.ip_mpls.xrcfg b/xrcfg/lab_1_P2.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P2.ip_mpls.xrcfg rename to xrcfg/lab_1_P2.ip_mpls.xrcfg diff --git a/chapter2/lab_1_P3.ip_mpls.xrcfg b/xrcfg/lab_1_P3.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P3.ip_mpls.xrcfg rename to xrcfg/lab_1_P3.ip_mpls.xrcfg diff --git a/chapter2/lab_1_P4.ip_mpls.xrcfg b/xrcfg/lab_1_P4.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P4.ip_mpls.xrcfg rename to xrcfg/lab_1_P4.ip_mpls.xrcfg diff --git a/chapter2/lab_1_P6.ip_mpls.xrcfg b/xrcfg/lab_1_P6.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P6.ip_mpls.xrcfg rename to xrcfg/lab_1_P6.ip_mpls.xrcfg diff --git a/chapter2/lab_1_P7.ip_mpls.xrcfg b/xrcfg/lab_1_P7.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P7.ip_mpls.xrcfg rename to xrcfg/lab_1_P7.ip_mpls.xrcfg diff --git a/chapter2/lab_1_P8.ip_mpls.xrcfg b/xrcfg/lab_1_P8.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_P8.ip_mpls.xrcfg rename to xrcfg/lab_1_P8.ip_mpls.xrcfg diff --git a/chapter2/lab_1_PE1.ip_mpls.xrcfg b/xrcfg/lab_1_PE1.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_PE1.ip_mpls.xrcfg rename to xrcfg/lab_1_PE1.ip_mpls.xrcfg diff --git a/chapter2/lab_1_PE5.ip_mpls.xrcfg b/xrcfg/lab_1_PE5.ip_mpls.xrcfg similarity index 100% rename from chapter2/lab_1_PE5.ip_mpls.xrcfg rename to xrcfg/lab_1_PE5.ip_mpls.xrcfg diff --git a/chapter3/lab_2_P2.sr.xrcfg b/xrcfg/lab_2_P2.sr.xrcfg similarity index 100% rename from chapter3/lab_2_P2.sr.xrcfg rename to xrcfg/lab_2_P2.sr.xrcfg diff --git a/chapter3/lab_2_P6.srprefer.xrcfg b/xrcfg/lab_2_P2.srprefer.xrcfg similarity index 100% rename from chapter3/lab_2_P6.srprefer.xrcfg rename to xrcfg/lab_2_P2.srprefer.xrcfg diff --git a/chapter3/lab_2_P3.sr.xrcfg b/xrcfg/lab_2_P3.sr.xrcfg similarity index 100% rename from chapter3/lab_2_P3.sr.xrcfg rename to xrcfg/lab_2_P3.sr.xrcfg diff --git a/chapter3/lab_2_P7.srprefer.xrcfg b/xrcfg/lab_2_P3.srprefer.xrcfg similarity index 100% rename from chapter3/lab_2_P7.srprefer.xrcfg rename to xrcfg/lab_2_P3.srprefer.xrcfg diff --git a/chapter3/lab_2_P6.sr.xrcfg b/xrcfg/lab_2_P6.sr.xrcfg similarity index 100% rename from chapter3/lab_2_P6.sr.xrcfg rename to xrcfg/lab_2_P6.sr.xrcfg diff --git a/chapter3/lab_2_PE1.srprefer.xrcfg b/xrcfg/lab_2_P6.srprefer.xrcfg similarity index 100% rename from chapter3/lab_2_PE1.srprefer.xrcfg rename to xrcfg/lab_2_P6.srprefer.xrcfg diff --git a/chapter3/lab_2_P7.sr.xrcfg b/xrcfg/lab_2_P7.sr.xrcfg similarity index 100% rename from chapter3/lab_2_P7.sr.xrcfg rename to xrcfg/lab_2_P7.sr.xrcfg diff --git a/xrcfg/lab_2_P7.srprefer.xrcfg b/xrcfg/lab_2_P7.srprefer.xrcfg new file mode 100644 index 0000000..56f947e --- /dev/null +++ b/xrcfg/lab_2_P7.srprefer.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + segment-routing mpls sr-prefer + ! +! + diff --git a/chapter3/lab_2_PE1.sr.xrcfg b/xrcfg/lab_2_PE1.sr.xrcfg similarity index 100% rename from chapter3/lab_2_PE1.sr.xrcfg rename to xrcfg/lab_2_PE1.sr.xrcfg diff --git a/xrcfg/lab_2_PE1.srprefer.xrcfg b/xrcfg/lab_2_PE1.srprefer.xrcfg new file mode 100644 index 0000000..56f947e --- /dev/null +++ b/xrcfg/lab_2_PE1.srprefer.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + segment-routing mpls sr-prefer + ! +! + diff --git a/chapter4/lab_3_P4.noldp.xrcfg b/xrcfg/lab_3_P2.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_P4.noldp.xrcfg rename to xrcfg/lab_3_P2.noldp.xrcfg diff --git a/chapter4/lab_3_P6.noldp.xrcfg b/xrcfg/lab_3_P3.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_P6.noldp.xrcfg rename to xrcfg/lab_3_P3.noldp.xrcfg diff --git a/chapter4/lab_3_P7.noldp.xrcfg b/xrcfg/lab_3_P4.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_P7.noldp.xrcfg rename to xrcfg/lab_3_P4.noldp.xrcfg diff --git a/chapter4/lab_3_P4.sronly_p1.xrcfg b/xrcfg/lab_3_P4.sronly_p1.xrcfg similarity index 100% rename from chapter4/lab_3_P4.sronly_p1.xrcfg rename to xrcfg/lab_3_P4.sronly_p1.xrcfg diff --git a/chapter4/lab_3_P8.noldp.xrcfg b/xrcfg/lab_3_P6.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_P8.noldp.xrcfg rename to xrcfg/lab_3_P6.noldp.xrcfg diff --git a/xrcfg/lab_3_P6.nosrms.xrcfg b/xrcfg/lab_3_P6.nosrms.xrcfg new file mode 100644 index 0000000..703c44e --- /dev/null +++ b/xrcfg/lab_3_P6.nosrms.xrcfg @@ -0,0 +1,10 @@ +router isis IGP + address-family ipv4 unicast + no segment-routing prefix-sid-map advertise-local + ! +! +root + +no segment-routing +! + diff --git a/xrcfg/lab_3_P6.srms.xrcfg b/xrcfg/lab_3_P6.srms.xrcfg new file mode 100644 index 0000000..87d6133 --- /dev/null +++ b/xrcfg/lab_3_P6.srms.xrcfg @@ -0,0 +1,21 @@ +segment-routing + mapping-server + prefix-sid-map + address-family ipv4 + 4.4.4.4/32 4 + 5.5.5.5/32 5 + 8.8.8.8/32 8 + ! + ! + ! +! +root + +router isis IGP + address-family ipv4 unicast + segment-routing prefix-sid-map advertise-local + ! +! +root +! + diff --git a/chapter4/lab_3_PE1.noldp.xrcfg b/xrcfg/lab_3_P7.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_PE1.noldp.xrcfg rename to xrcfg/lab_3_P7.noldp.xrcfg diff --git a/chapter4/lab_3_PE5.noldp.xrcfg b/xrcfg/lab_3_P8.noldp.xrcfg similarity index 100% rename from chapter4/lab_3_PE5.noldp.xrcfg rename to xrcfg/lab_3_P8.noldp.xrcfg diff --git a/chapter4/lab_3_P8.sronly_p1.xrcfg b/xrcfg/lab_3_P8.sronly_p1.xrcfg similarity index 100% rename from chapter4/lab_3_P8.sronly_p1.xrcfg rename to xrcfg/lab_3_P8.sronly_p1.xrcfg diff --git a/xrcfg/lab_3_PE1.noldp.xrcfg b/xrcfg/lab_3_PE1.noldp.xrcfg new file mode 100644 index 0000000..4bae887 --- /dev/null +++ b/xrcfg/lab_3_PE1.noldp.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + no mpls ldp auto-config + ! +! + diff --git a/xrcfg/lab_3_PE5.noldp.xrcfg b/xrcfg/lab_3_PE5.noldp.xrcfg new file mode 100644 index 0000000..4bae887 --- /dev/null +++ b/xrcfg/lab_3_PE5.noldp.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + no mpls ldp auto-config + ! +! + diff --git a/chapter4/lab_3_PE5.sronly_p1.xrcfg b/xrcfg/lab_3_PE5.sronly_p1.xrcfg similarity index 100% rename from chapter4/lab_3_PE5.sronly_p1.xrcfg rename to xrcfg/lab_3_PE5.sronly_p1.xrcfg diff --git a/chapter5/lab_4_P2.tilfa.xrcfg b/xrcfg/lab_4_P2.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P2.tilfa.xrcfg rename to xrcfg/lab_4_P2.tilfa.xrcfg diff --git a/chapter5/lab_4_P3.tilfa.xrcfg b/xrcfg/lab_4_P3.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P3.tilfa.xrcfg rename to xrcfg/lab_4_P3.tilfa.xrcfg diff --git a/chapter5/lab_4_P4.tilfa.xrcfg b/xrcfg/lab_4_P4.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P4.tilfa.xrcfg rename to xrcfg/lab_4_P4.tilfa.xrcfg diff --git a/chapter5/lab_4_P6.tilfa.xrcfg b/xrcfg/lab_4_P6.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P6.tilfa.xrcfg rename to xrcfg/lab_4_P6.tilfa.xrcfg diff --git a/chapter5/lab_4_P7.tilfa.xrcfg b/xrcfg/lab_4_P7.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P7.tilfa.xrcfg rename to xrcfg/lab_4_P7.tilfa.xrcfg diff --git a/chapter5/lab_4_P8.tilfa.xrcfg b/xrcfg/lab_4_P8.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_P8.tilfa.xrcfg rename to xrcfg/lab_4_P8.tilfa.xrcfg diff --git a/chapter5/lab_4_PE1.tilfa.xrcfg b/xrcfg/lab_4_PE1.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_PE1.tilfa.xrcfg rename to xrcfg/lab_4_PE1.tilfa.xrcfg diff --git a/chapter5/lab_4_PE5.tilfa.xrcfg b/xrcfg/lab_4_PE5.tilfa.xrcfg similarity index 100% rename from chapter5/lab_4_PE5.tilfa.xrcfg rename to xrcfg/lab_4_PE5.tilfa.xrcfg diff --git a/xrcfg/lab_5_P2.zs_tilfa.xrcfg b/xrcfg/lab_5_P2.zs_tilfa.xrcfg new file mode 100644 index 0000000..b57cae4 --- /dev/null +++ b/xrcfg/lab_5_P2.zs_tilfa.xrcfg @@ -0,0 +1,13 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 100 + ! + ! + interface GigabitEthernet0/0/0/3 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/xrcfg/lab_5_P2.zs_tilfa_revert.xrcfg b/xrcfg/lab_5_P2.zs_tilfa_revert.xrcfg new file mode 100644 index 0000000..d836769 --- /dev/null +++ b/xrcfg/lab_5_P2.zs_tilfa_revert.xrcfg @@ -0,0 +1,13 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 10 + ! + ! + interface GigabitEthernet0/0/0/3 + address-family ipv4 unicast + metric 10 + ! + ! +! + diff --git a/chapter8/lab_7_P8.ds_tilfa.xrcfg b/xrcfg/lab_5_P6.zs_tilfa.xrcfg similarity index 100% rename from chapter8/lab_7_P8.ds_tilfa.xrcfg rename to xrcfg/lab_5_P6.zs_tilfa.xrcfg diff --git a/chapter8/lab_7_P8.ds_tilfa_revert.xrcfg b/xrcfg/lab_5_P6.zs_tilfa_revert.xrcfg similarity index 100% rename from chapter8/lab_7_P8.ds_tilfa_revert.xrcfg rename to xrcfg/lab_5_P6.zs_tilfa_revert.xrcfg diff --git a/xrcfg/lab_5_P7.zs_tilfa.xrcfg b/xrcfg/lab_5_P7.zs_tilfa.xrcfg new file mode 100644 index 0000000..fe2ac98 --- /dev/null +++ b/xrcfg/lab_5_P7.zs_tilfa.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/3 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/xrcfg/lab_5_P7.zs_tilfa_revert.xrcfg b/xrcfg/lab_5_P7.zs_tilfa_revert.xrcfg new file mode 100644 index 0000000..f5f6f83 --- /dev/null +++ b/xrcfg/lab_5_P7.zs_tilfa_revert.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/3 + address-family ipv4 unicast + metric 10 + ! + ! +! + diff --git a/xrcfg/lab_6_P7.ss_tilfa.xrcfg b/xrcfg/lab_6_P7.ss_tilfa.xrcfg new file mode 100644 index 0000000..09bdf2d --- /dev/null +++ b/xrcfg/lab_6_P7.ss_tilfa.xrcfg @@ -0,0 +1,12 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + shutdown + ! + interface GigabitEthernet0/0/0/3 + shutdown + ! + interface GigabitEthernet0/0/0/4 + shutdown + ! +! + diff --git a/xrcfg/lab_7_P4.ds_tilfa.xrcfg b/xrcfg/lab_7_P4.ds_tilfa.xrcfg new file mode 100644 index 0000000..fa2afec --- /dev/null +++ b/xrcfg/lab_7_P4.ds_tilfa.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/xrcfg/lab_7_P4.ds_tilfa_revert.xrcfg b/xrcfg/lab_7_P4.ds_tilfa_revert.xrcfg new file mode 100644 index 0000000..d3faf09 --- /dev/null +++ b/xrcfg/lab_7_P4.ds_tilfa_revert.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 10 + ! + ! +! + diff --git a/xrcfg/lab_7_P8.ds_tilfa.xrcfg b/xrcfg/lab_7_P8.ds_tilfa.xrcfg new file mode 100644 index 0000000..fa2afec --- /dev/null +++ b/xrcfg/lab_7_P8.ds_tilfa.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/xrcfg/lab_7_P8.ds_tilfa_revert.xrcfg b/xrcfg/lab_7_P8.ds_tilfa_revert.xrcfg new file mode 100644 index 0000000..d3faf09 --- /dev/null +++ b/xrcfg/lab_7_P8.ds_tilfa_revert.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + address-family ipv4 unicast + metric 10 + ! + ! +! + diff --git a/xrcfg/lab_8_P2.mla.xrcfg b/xrcfg/lab_8_P2.mla.xrcfg new file mode 100644 index 0000000..b6d7779 --- /dev/null +++ b/xrcfg/lab_8_P2.mla.xrcfg @@ -0,0 +1,7 @@ +router isis IGP + address-family ipv4 unicast + microloop avoidance segment-routing + microloop avoidance rib-update-delay 60000 + ! +! + diff --git a/xrcfg/lab_8_P2.mlaprep.xrcfg b/xrcfg/lab_8_P2.mlaprep.xrcfg new file mode 100644 index 0000000..ceb4898 --- /dev/null +++ b/xrcfg/lab_8_P2.mlaprep.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/0 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/xrcfg/lab_8_P2.mlarestore.xrcfg b/xrcfg/lab_8_P2.mlarestore.xrcfg new file mode 100644 index 0000000..8273c8f --- /dev/null +++ b/xrcfg/lab_8_P2.mlarestore.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/0 + address-family ipv4 unicast + metric 10 + ! + ! +! + diff --git a/xrcfg/lab_8_P7.mlarestore.xrcfg b/xrcfg/lab_8_P7.mlarestore.xrcfg new file mode 100644 index 0000000..50a6672 --- /dev/null +++ b/xrcfg/lab_8_P7.mlarestore.xrcfg @@ -0,0 +1,12 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + no shutdown + ! + interface GigabitEthernet0/0/0/3 + no shutdown + ! + interface GigabitEthernet0/0/0/4 + no shutdown + ! +! + diff --git a/xrcfg/lab_8_P8.mlaprep.xrcfg b/xrcfg/lab_8_P8.mlaprep.xrcfg new file mode 100644 index 0000000..4f53e69 --- /dev/null +++ b/xrcfg/lab_8_P8.mlaprep.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + shutdown + ! +! + diff --git a/xrcfg/lab_8_P8.mlatrgr.xrcfg b/xrcfg/lab_8_P8.mlatrgr.xrcfg new file mode 100644 index 0000000..a8f6962 --- /dev/null +++ b/xrcfg/lab_8_P8.mlatrgr.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + no shutdown + ! +! + diff --git a/chapter10/lab_9_P3.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P2.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_P3.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P2.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_P2.tilfa_ns_node.xrcfg b/xrcfg/lab_9_P2.tilfa_ns_node.xrcfg new file mode 100644 index 0000000..c325e2d --- /dev/null +++ b/xrcfg/lab_9_P2.tilfa_ns_node.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + fast-reroute per-prefix tiebreaker node-protecting index 200 + ! +! + diff --git a/xrcfg/lab_9_P2.tilfa_ns_node_revert.xrcfg b/xrcfg/lab_9_P2.tilfa_ns_node_revert.xrcfg new file mode 100644 index 0000000..468384b --- /dev/null +++ b/xrcfg/lab_9_P2.tilfa_ns_node_revert.xrcfg @@ -0,0 +1,6 @@ +router isis IGP + address-family ipv4 unicast + no fast-reroute per-prefix tiebreaker node-protecting index 200 + ! +! + diff --git a/chapter10/lab_9_P4.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P3.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_P4.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P3.mpls_traffic_eng.xrcfg diff --git a/chapter10/lab_9_P6.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P4.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_P6.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P4.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_P4.tilfa_ns_prep.xrcfg b/xrcfg/lab_9_P4.tilfa_ns_prep.xrcfg new file mode 100644 index 0000000..a78944a --- /dev/null +++ b/xrcfg/lab_9_P4.tilfa_ns_prep.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/4 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/chapter10/lab_9_P7.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P6.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_P7.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P6.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_P6.tilfa_ns_prep.xrcfg b/xrcfg/lab_9_P6.tilfa_ns_prep.xrcfg new file mode 100644 index 0000000..ceb4898 --- /dev/null +++ b/xrcfg/lab_9_P6.tilfa_ns_prep.xrcfg @@ -0,0 +1,8 @@ +router isis IGP + interface GigabitEthernet0/0/0/0 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/chapter10/lab_9_P8.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P7.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_P8.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P7.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_P7.tilfa_ns_prep.xrcfg b/xrcfg/lab_9_P7.tilfa_ns_prep.xrcfg new file mode 100644 index 0000000..bc8f8b6 --- /dev/null +++ b/xrcfg/lab_9_P7.tilfa_ns_prep.xrcfg @@ -0,0 +1,13 @@ +router isis IGP + interface GigabitEthernet0/0/0/0 + address-family ipv4 unicast + metric 100 + ! + ! + interface GigabitEthernet0/0/0/4 + address-family ipv4 unicast + metric 100 + ! + ! +! + diff --git a/chapter10/lab_9_PE1.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_P8.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_PE1.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_P8.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_P8.tilfa_ns_prep.xrcfg b/xrcfg/lab_9_P8.tilfa_ns_prep.xrcfg new file mode 100644 index 0000000..d809b1e --- /dev/null +++ b/xrcfg/lab_9_P8.tilfa_ns_prep.xrcfg @@ -0,0 +1,9 @@ +router isis IGP + interface GigabitEthernet0/0/0/1 + shutdown + ! + interface GigabitEthernet0/0/0/2 + shutdown + ! +! + diff --git a/chapter10/lab_9_PE5.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_PE1.mpls_traffic_eng.xrcfg similarity index 100% rename from chapter10/lab_9_PE5.mpls_traffic_eng.xrcfg rename to xrcfg/lab_9_PE1.mpls_traffic_eng.xrcfg diff --git a/xrcfg/lab_9_PE5.mpls_traffic_eng.xrcfg b/xrcfg/lab_9_PE5.mpls_traffic_eng.xrcfg new file mode 100644 index 0000000..095c771 --- /dev/null +++ b/xrcfg/lab_9_PE5.mpls_traffic_eng.xrcfg @@ -0,0 +1,5 @@ +ipv4 unnumbered mpls traffic-eng Loopback0 +router isis IGP address-family ipv4 unicast mpls traffic-eng router-id Loopback0 +mpls traffic-eng +! +