├── .gitignore ├── LICENSE ├── README.md ├── lab_net_build ├── INITIAL_CFGS │ ├── arista-p1.txt │ ├── arista-p2.txt │ ├── arista-p3.txt │ ├── arista-p4.txt │ ├── arista-p5.txt │ ├── arista-p6.txt │ ├── cisco-p1.txt │ ├── cisco-p2.txt │ ├── cisco-p3.txt │ ├── cisco-p4.txt │ ├── cisco-p5.txt │ ├── cisco-p6.txt │ ├── cisco1.txt │ ├── cisco2.txt │ ├── juniper-p1.txt │ ├── juniper-p2.txt │ ├── juniper-p3.txt │ ├── juniper-p4.txt │ ├── juniper-p5.txt │ ├── juniper-p6.txt │ ├── juniper1.txt │ ├── juniper2.txt │ ├── pynet-sw6.txt │ ├── pynet-sw7.txt │ └── pynet-sw8.txt ├── group_vars │ └── cisco.yml ├── load_initial_cfgs.yml ├── merge.conf └── napalm_test.py ├── lab_svr_build ├── roles │ ├── ansible_extras │ │ └── tasks │ │ │ └── main.yml │ ├── ansible_general │ │ ├── files │ │ │ └── .ansible.cfg │ │ └── tasks │ │ │ └── main.yml │ ├── arista │ │ └── tasks │ │ │ └── main.yml │ ├── juniper │ │ └── tasks │ │ │ └── main.yml │ ├── napalm │ │ └── tasks │ │ │ └── main.yml │ ├── netmiko │ │ └── tasks │ │ │ └── main.yml │ ├── nexus │ │ └── tasks │ │ │ └── main.yml │ ├── python_pkgs │ │ ├── files │ │ │ ├── .ansible.cfg │ │ │ ├── .vimrc │ │ │ ├── email_helper.py │ │ │ └── snmp_helper.py │ │ ├── tasks │ │ │ └── main.yml │ │ ├── templates │ │ │ └── bashrc.j2 │ │ └── vars │ │ │ └── main.yml │ └── server_pkgs │ │ ├── files │ │ ├── .bashrc │ │ ├── .vimrc │ │ └── hosts │ │ └── tasks │ │ └── main.yml └── site.yml ├── napalm ├── eos │ └── ntp_config.txt ├── ios │ └── ntp_config.txt ├── junos │ └── ntp_config.txt ├── my_devices.py ├── napalm_connect.py ├── napalm_connect_simple.py ├── napalm_facts_1.py ├── napalm_facts_2.py ├── napalm_facts_3.py ├── napalm_merge.py ├── napalm_merge_1.py └── remove_ntp.txt ├── netmiko ├── logging_change.txt ├── my_devices.py ├── netmiko-grep-examples.md ├── save_output.py ├── show_command.py ├── show_command_1.py ├── show_command_2.py ├── show_command_3.py ├── show_command_4.py ├── show_command_5.py ├── simple_connection.py └── simple_connection_2.py ├── presentations ├── 2017-05-16-net-auto-workshop-intro-slides.pdf ├── Interop17-Hands-On-Net-Automation-JJ_templates-ansible.pdf ├── Interop17-Hands-On-Net-Automation-KB.pdf └── OswaltMatt_Testing.pdf ├── python_basics ├── data_types.py ├── dict_ex.py ├── if_else.py ├── lists_ex.py ├── loops.py ├── print_format.py ├── printing.py ├── read_input.py └── vars.py ├── templates ├── .gitignore ├── arista_eapi.py ├── check_version.yml ├── juniper_push_config.yml ├── push_config.yml ├── render_template.py ├── render_template_file.py └── templates │ ├── arista5.twb-tech.com-adv.j2 │ ├── arista5.twb-tech.com-basic.j2 │ └── juniper-interfaces.j2 └── workshop-outline.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | *.swp 3 | *.pyc 4 | 5 | lab_svr_build/main_interop1.yml 6 | lab_svr_build/main_interop2.yml 7 | lab_svr_build/students_interop.yml 8 | lab_svr_build/students_p*.yml 9 | lab_svr_build/roles/netmiko/files/.netmiko.yml 10 | lab_svr_build/roles/netmiko/files/.netmiko*.yml 11 | lab_svr_build/roles/ansible_general/templates/ansible-hosts.j2 12 | lab_svr_build/roles/ansible_general/templates/ansible-hosts*.j2 13 | lab_svr_build/ansible.out 14 | 15 | lab_net_build/ansible-hosts 16 | lab_net_build/ansible-hosts-pods 17 | lab_net_build/DIFFS/* 18 | lab_net_build/INITIAL_CFGS/nxos1.txt 19 | lab_net_build/INITIAL_CFGS/nxos2.txt 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Scott S. Lowe 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hands-On Practical Network Automation Workshop 2 | 3 | This repository contains working files, samples, and other documents for the "Hands-On Practical Network Automation" workshop being held on Tuesday, May 16, 2017, at Interop ITX in Las Vegas, NV. 4 | 5 | ## License 6 | 7 | These materials are licensed under the MIT License. 8 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p1.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista1 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.21/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p2.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista2 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.22/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p3.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista3 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.23/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p4.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista1 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.24/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p5.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista5 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.11/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/arista-p6.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname arista6 5 | ip domain-name ntc.com 6 | ! 7 | snmp-server community networktocode ro 8 | ! 9 | spanning-tree mode mstp 10 | ! 11 | aaa authorization exec default local 12 | ! 13 | no aaa root 14 | ! 15 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 16 | ! 17 | vrf definition MANAGEMENT 18 | rd 100:100 19 | ! 20 | interface Ethernet1 21 | no switchport 22 | ! 23 | interface Ethernet2 24 | no switchport 25 | ! 26 | interface Ethernet3 27 | no switchport 28 | ! 29 | interface Ethernet4 30 | no switchport 31 | ! 32 | interface Ethernet5 33 | ! 34 | interface Ethernet6 35 | ! 36 | interface Ethernet7 37 | ! 38 | interface Management1 39 | vrf forwarding MANAGEMENT 40 | ip address 10.0.0.12/24 41 | ! 42 | ip route vrf MANAGEMENT 0.0.0.0/0 10.0.0.2 43 | ! 44 | ip routing 45 | ip routing vrf MANAGEMENT 46 | ! 47 | management api http-commands 48 | protocol http 49 | no shutdown 50 | vrf MANAGEMENT 51 | no shutdown 52 | ! 53 | management ssh 54 | vrf MANAGEMENT 55 | no shutdown 56 | ! 57 | ! 58 | end 59 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p1.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco1 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | no ip domain lookup 34 | ip domain name bogus.com 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | subscriber templating 46 | ! 47 | ! 48 | ! 49 | multilink bundle-name authenticated 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | crypto pki trustpoint TP-self-signed-1692872229 56 | enrollment selfsigned 57 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 58 | revocation-check none 59 | rsakeypair TP-self-signed-1692872229 60 | ! 61 | ! 62 | crypto pki certificate chain TP-self-signed-1692872229 63 | certificate self-signed 01 64 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 65 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 66 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 67 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 68 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 69 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 70 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 71 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 72 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 73 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 74 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 75 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 76 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 77 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 78 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 79 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 80 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 81 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 82 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 83 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 84 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 85 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 86 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 87 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 88 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 89 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 90 | quit 91 | 92 | 93 | ! 94 | ! 95 | ! 96 | ! 97 | ! 98 | ! 99 | ! 100 | license udi pid CSR1000V sn 9KXI0D7TVFI 101 | diagnostic bootup level minimal 102 | archive 103 | path flash:archive 104 | ! 105 | spanning-tree extend system-id 106 | netconf-yang cisco-odm on-demand-enable 107 | netconf-yang cisco-odm polling-enable 108 | netconf-yang 109 | restconf 110 | ! 111 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 112 | ! 113 | redundancy 114 | ! 115 | ! 116 | ! 117 | ! 118 | ! 119 | lldp run 120 | cdp run 121 | ! 122 | ! 123 | ! 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | interface GigabitEthernet1 144 | vrf forwarding MANAGEMENT 145 | ip address 10.0.0.51 255.255.255.0 146 | negotiation auto 147 | ! 148 | interface GigabitEthernet2 149 | no ip address 150 | negotiation auto 151 | ! 152 | interface GigabitEthernet3 153 | no ip address 154 | negotiation auto 155 | ! 156 | interface GigabitEthernet4 157 | no ip address 158 | negotiation auto 159 | ! 160 | ! 161 | virtual-service csr_mgmt 162 | ! 163 | ip forward-protocol nd 164 | ip http server 165 | ip http authentication local 166 | ip http secure-server 167 | ! 168 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 169 | ip ssh version 2 170 | ip scp server enable 171 | ! 172 | ! 173 | ! 174 | ! 175 | ! 176 | control-plane 177 | ! 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | line con 0 188 | stopbits 1 189 | line vty 0 4 190 | privilege level 15 191 | login local 192 | transport preferred ssh 193 | line vty 5 30 194 | privilege level 15 195 | login local 196 | transport preferred ssh 197 | ! 198 | ! 199 | ! 200 | ! 201 | ! 202 | ! 203 | end 204 | ! 205 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p2.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco2 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.52 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p3.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco3 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.53 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p4.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco4 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.54 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p5.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco5 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.55 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco-p6.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco6 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.56 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco1.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco1 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | no ip domain lookup 34 | ip domain name bogus.com 35 | ! 36 | ! 37 | ! 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | subscriber templating 46 | ! 47 | ! 48 | ! 49 | multilink bundle-name authenticated 50 | ! 51 | ! 52 | ! 53 | ! 54 | ! 55 | crypto pki trustpoint TP-self-signed-1692872229 56 | enrollment selfsigned 57 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 58 | revocation-check none 59 | rsakeypair TP-self-signed-1692872229 60 | ! 61 | ! 62 | crypto pki certificate chain TP-self-signed-1692872229 63 | certificate self-signed 01 64 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 65 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 66 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 67 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 68 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 69 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 70 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 71 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 72 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 73 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 74 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 75 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 76 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 77 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 78 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 79 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 80 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 81 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 82 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 83 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 84 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 85 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 86 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 87 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 88 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 89 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 90 | quit 91 | 92 | 93 | ! 94 | ! 95 | ! 96 | ! 97 | ! 98 | ! 99 | ! 100 | license udi pid CSR1000V sn 9KXI0D7TVFI 101 | diagnostic bootup level minimal 102 | archive 103 | path flash:archive 104 | ! 105 | spanning-tree extend system-id 106 | netconf-yang cisco-odm on-demand-enable 107 | netconf-yang cisco-odm polling-enable 108 | netconf-yang 109 | restconf 110 | ! 111 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 112 | ! 113 | redundancy 114 | ! 115 | ! 116 | ! 117 | ! 118 | ! 119 | lldp run 120 | cdp run 121 | ! 122 | ! 123 | ! 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | interface GigabitEthernet1 144 | vrf forwarding MANAGEMENT 145 | ip address 10.0.0.51 255.255.255.0 146 | negotiation auto 147 | ! 148 | interface GigabitEthernet2 149 | no ip address 150 | negotiation auto 151 | ! 152 | interface GigabitEthernet3 153 | no ip address 154 | negotiation auto 155 | ! 156 | interface GigabitEthernet4 157 | no ip address 158 | negotiation auto 159 | ! 160 | ! 161 | virtual-service csr_mgmt 162 | ! 163 | ip forward-protocol nd 164 | ip http server 165 | ip http authentication local 166 | ip http secure-server 167 | ! 168 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 169 | ip ssh version 2 170 | ip scp server enable 171 | ! 172 | ! 173 | ! 174 | ! 175 | ! 176 | control-plane 177 | ! 178 | ! 179 | ! 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | line con 0 188 | stopbits 1 189 | line vty 0 4 190 | privilege level 15 191 | login local 192 | transport preferred ssh 193 | line vty 5 30 194 | privilege level 15 195 | login local 196 | transport preferred ssh 197 | ! 198 | ! 199 | ! 200 | ! 201 | ! 202 | ! 203 | end 204 | ! 205 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/cisco2.txt: -------------------------------------------------------------------------------- 1 | ! 2 | version 16.3 3 | service timestamps debug datetime msec 4 | service timestamps log datetime msec 5 | no platform punt-keepalive disable-kernel-core 6 | platform console auto 7 | ! 8 | hostname cisco2 9 | ! 10 | boot-start-marker 11 | boot-end-marker 12 | ! 13 | ! 14 | vrf definition MANAGEMENT 15 | ! 16 | address-family ipv4 17 | exit-address-family 18 | ! 19 | address-family ipv6 20 | exit-address-family 21 | ! 22 | ! 23 | no aaa new-model 24 | ! 25 | ! 26 | ! 27 | ! 28 | ! 29 | ! 30 | ! 31 | ! 32 | ! 33 | 34 | 35 | 36 | no ip domain lookup 37 | ip domain name bogus.com 38 | ! 39 | ! 40 | ! 41 | ! 42 | ! 43 | ! 44 | ! 45 | ! 46 | ! 47 | ! 48 | subscriber templating 49 | ! 50 | ! 51 | ! 52 | multilink bundle-name authenticated 53 | ! 54 | ! 55 | ! 56 | ! 57 | ! 58 | crypto pki trustpoint TP-self-signed-1692872229 59 | enrollment selfsigned 60 | subject-name cn=IOS-Self-Signed-Certificate-1692872229 61 | revocation-check none 62 | rsakeypair TP-self-signed-1692872229 63 | ! 64 | ! 65 | crypto pki certificate chain TP-self-signed-1692872229 66 | certificate self-signed 01 67 | 30820330 30820218 A0030201 02020101 300D0609 2A864886 F70D0101 05050030 68 | 31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274 69 | 69666963 6174652D 31363932 38373232 3239301E 170D3136 30393137 31343532 70 | 31355A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649 71 | 4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D31 36393238 72 | 37323232 39308201 22300D06 092A8648 86F70D01 01010500 0382010F 00308201 73 | 0A028201 01008C3F 8CC4110A 46D229F4 6CC98F4B B91EC0E7 14653DF4 929EFAE2 74 | 735FBFB9 944BBB69 76183782 C7580776 A63E0B59 1FC59096 46083864 3BCBA45B 75 | DBBE4446 19E096CD 218C27B6 053F9ADA 3A9A442C 43028EA0 65751E97 E9AEA5AA 76 | 79421470 4515CB08 B09A1546 0F2A547E 1BD79437 82000464 8675A977 0C46721B 77 | 96EB64DD E69C1F5A BE21D8AE 9283BE65 F0D36816 360C71CB 266DDAF4 8E862D2F 78 | 7665A0A9 1955CD7A 95B31F67 D24C4BB8 CF30E3CB 0ACA3698 0BEE3323 A2C3AF16 79 | B322FB52 BEDA9AB6 DE7B4D1A 6C89E060 0F971CC9 2192A88A E01D6B00 A7A4CBEC 80 | 4EA3E233 AC213B27 6CFE403C 4ED6AF88 C48F0106 9DCB9B34 CE775B88 E22ED282 81 | 98112FF5 A07B0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 82 | 301F0603 551D2304 18301680 142A6961 60B9636B 6AB03227 74EF7A25 CCEC0FCE 83 | 81301D06 03551D0E 04160414 2A696160 B9636B6A B0322774 EF7A25CC EC0FCE81 84 | 300D0609 2A864886 F70D0101 05050003 82010100 17DC579F D400261B 6E725759 85 | A99EE2D9 BE51F87C 00205EF4 7C647E18 C736108A E86E4C1C 5494FFA8 358D1D89 86 | B0919DBA 0C5F72DB 831C67E7 0EE7C2EB 961E0355 5FAAECC7 A946D7A0 1C401D0D 87 | FD4D1F63 C0BBCF43 DEAB63B5 11051773 172AA75D 389813A8 6080DFB6 C704A199 88 | EC8546B7 BA3C53C8 8B69DF64 5305FDEB 3A7ACA2A 1992AF6C C9D74A91 2601666D 89 | FE0AD3F3 81015D87 9721ED5B 7CAC12EC 3AB40C1C 8C51A871 C8EEB611 29B16D10 90 | A7AE1C00 4B71940E AD42D20C FD9B958D 7D353DDC 195CC910 1DDC2BE7 E971B2EA 91 | 209F3F96 FBE167D6 E0E4E11F E58834D8 7FE78CB5 039297CD 113CB419 6C5F9733 92 | AF749425 129B78B2 D6BBEFA0 34F4CB8E FF9B43A7 93 | quit 94 | 95 | 96 | ! 97 | ! 98 | ! 99 | ! 100 | ! 101 | ! 102 | ! 103 | license udi pid CSR1000V sn 9KXI0D7TVFI 104 | diagnostic bootup level minimal 105 | archive 106 | path flash:archive 107 | ! 108 | spanning-tree extend system-id 109 | netconf-yang cisco-odm on-demand-enable 110 | netconf-yang cisco-odm polling-enable 111 | netconf-yang 112 | restconf 113 | ! 114 | username interop privilege 15 secret 5 $1$a/my$a0CIRF3vlwsnRfa1KOX4r0 115 | ! 116 | redundancy 117 | ! 118 | ! 119 | ! 120 | ! 121 | ! 122 | lldp run 123 | cdp run 124 | ! 125 | ! 126 | ! 127 | ! 128 | ! 129 | ! 130 | ! 131 | ! 132 | ! 133 | ! 134 | ! 135 | ! 136 | ! 137 | ! 138 | ! 139 | ! 140 | ! 141 | ! 142 | ! 143 | ! 144 | ! 145 | ! 146 | interface GigabitEthernet1 147 | vrf forwarding MANAGEMENT 148 | ip address 10.0.0.52 255.255.255.0 149 | negotiation auto 150 | ! 151 | interface GigabitEthernet2 152 | no ip address 153 | negotiation auto 154 | ! 155 | interface GigabitEthernet3 156 | no ip address 157 | negotiation auto 158 | ! 159 | interface GigabitEthernet4 160 | no ip address 161 | negotiation auto 162 | ! 163 | ! 164 | virtual-service csr_mgmt 165 | ! 166 | ip forward-protocol nd 167 | ip http server 168 | ip http authentication local 169 | ip http secure-server 170 | ! 171 | ip route vrf MANAGEMENT 0.0.0.0 0.0.0.0 10.0.0.2 172 | ip ssh version 2 173 | ip scp server enable 174 | ! 175 | ! 176 | ! 177 | ! 178 | ! 179 | control-plane 180 | ! 181 | ! 182 | ! 183 | ! 184 | ! 185 | ! 186 | ! 187 | ! 188 | ! 189 | ! 190 | line con 0 191 | stopbits 1 192 | line vty 0 4 193 | privilege level 15 194 | login local 195 | transport preferred ssh 196 | line vty 5 30 197 | privilege level 15 198 | login local 199 | transport preferred ssh 200 | ! 201 | ! 202 | ! 203 | ! 204 | ! 205 | ! 206 | end 207 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p1.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper1; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.31/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p2.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper2; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.32/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p3.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper3; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.33/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p4.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper4; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.34/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p5.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper5; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.35/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper-p6.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper6; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.36/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper1.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper1; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.31/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/juniper2.txt: -------------------------------------------------------------------------------- 1 | version 15.1F4.15; 2 | groups { 3 | global { 4 | system { 5 | login { 6 | user interop { 7 | uid 2000; 8 | class super-user; 9 | authentication { 10 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 11 | } 12 | } 13 | } 14 | } 15 | } 16 | } 17 | apply-groups global; 18 | system { 19 | host-name juniper2; 20 | domain-name bogus.com; 21 | root-authentication { 22 | encrypted-password "$5$1FR588oW$dWnmaj9S4t/GHEYL/gn8tOz3.yXoIMYHrCDyn.4hIo0"; ## SECRET-DATA 23 | } 24 | login { 25 | user pyclass { 26 | uid 2001; 27 | class super-user; 28 | authentication { 29 | encrypted-password "$5$81JRmtRW$eEZ2w0EyKMTUzeZEdnEh8h9c3g/1wCVM4SiQuvHo.UA"; ## SECRET-DATA 30 | } 31 | } 32 | } 33 | services { 34 | ssh; 35 | netconf { 36 | ssh; 37 | } 38 | } 39 | syslog { 40 | user * { 41 | any emergency; 42 | } 43 | file messages { 44 | any notice; 45 | authorization info; 46 | } 47 | file interactive-commands { 48 | interactive-commands any; 49 | } 50 | } 51 | } 52 | interfaces { 53 | ge-0/0/0 { 54 | unit 0 { 55 | family inet; 56 | } 57 | } 58 | ge-0/0/1 { 59 | unit 0 { 60 | family inet; 61 | } 62 | } 63 | ge-0/0/2 { 64 | unit 0 { 65 | family inet; 66 | } 67 | } 68 | ge-0/0/3 { 69 | unit 0 { 70 | family inet; 71 | } 72 | } 73 | fxp0 { 74 | unit 0 { 75 | family inet { 76 | address 10.0.0.32/24; 77 | } 78 | } 79 | } 80 | } 81 | snmp { 82 | community invalid42 { 83 | authorization read-only; 84 | } 85 | } 86 | routing-options { 87 | static { 88 | route 0.0.0.0/0 next-hop 10.0.0.2; 89 | } 90 | } 91 | protocols { 92 | lldp { 93 | port-id-subtype interface-name; 94 | interface all; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/pynet-sw6.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname pynet-sw6 5 | ! 6 | ntp server 130.126.24.24 7 | ! 8 | spanning-tree mode mstp 9 | ! 10 | aaa authorization exec default local 11 | ! 12 | no aaa root 13 | ! 14 | username admin privilege 15 role network-admin secret 5 $1$aM6w809x$tgkc6ZGhcScvELVKVHq3n0 15 | username admin1 privilege 15 secret 5 $1$7kD0oS/t$wXhtTFwnWwnlPFKWwXoJ70 16 | username eapi secret 5 $1$ezGsMTgk$g5ROc4mDuF/4CnMJo0aPV0 17 | username pyclass privilege 15 secret 5 $1$C3VfUfcO$86t4iqCX60yW.NIR8d2Lh0 18 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 19 | ! 20 | clock timezone America/Los_Angeles 21 | ! 22 | interface Ethernet1 23 | spanning-tree portfast 24 | ! 25 | interface Ethernet2 26 | ! 27 | interface Ethernet3 28 | ! 29 | interface Ethernet4 30 | ! 31 | interface Ethernet5 32 | ! 33 | interface Ethernet6 34 | ! 35 | interface Ethernet7 36 | ! 37 | interface Management1 38 | shutdown 39 | ! 40 | interface Vlan1 41 | ip address 10.220.88.33/24 42 | ! 43 | ip route 0.0.0.0/0 10.220.88.1 44 | ! 45 | ip routing 46 | ! 47 | management api http-commands 48 | no shutdown 49 | ! 50 | ! 51 | end 52 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/pynet-sw7.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname pynet-sw7 5 | ! 6 | ntp server 130.126.24.24 7 | ! 8 | spanning-tree mode mstp 9 | ! 10 | aaa authorization exec default local 11 | ! 12 | no aaa root 13 | ! 14 | username admin privilege 15 role network-admin secret 5 $1$aM6w809x$tgkc6ZGhcScvELVKVHq3n0 15 | username admin1 privilege 15 secret 5 $1$7kD0oS/t$wXhtTFwnWwnlPFKWwXoJ70 16 | username eapi secret 5 $1$jMZJZ7Ig$w6ajfFPHU1w5T9e3Rsc84. 17 | username pyclass privilege 15 secret 5 $1$C3VfUfcO$86t4iqCX60yW.NIR8d2Lh0 18 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 19 | ! 20 | clock timezone America/Los_Angeles 21 | ! 22 | interface Ethernet1 23 | spanning-tree portfast 24 | ! 25 | interface Ethernet2 26 | ! 27 | interface Ethernet3 28 | ! 29 | interface Ethernet4 30 | ! 31 | interface Ethernet5 32 | ! 33 | interface Ethernet6 34 | ! 35 | interface Ethernet7 36 | ! 37 | interface Management1 38 | shutdown 39 | ! 40 | interface Vlan1 41 | ip address 10.220.88.34/24 42 | ! 43 | ip route 0.0.0.0/0 10.220.88.1 44 | ! 45 | ip routing 46 | ! 47 | management api http-commands 48 | no shutdown 49 | ! 50 | ! 51 | end 52 | -------------------------------------------------------------------------------- /lab_net_build/INITIAL_CFGS/pynet-sw8.txt: -------------------------------------------------------------------------------- 1 | ! 2 | transceiver qsfp default-mode 4x10G 3 | ! 4 | hostname pynet-sw8 5 | ! 6 | ntp server 130.126.24.24 7 | ! 8 | spanning-tree mode mstp 9 | ! 10 | aaa authorization exec default local 11 | ! 12 | no aaa root 13 | ! 14 | username admin privilege 15 role network-admin secret 5 $1$aM6w809x$tgkc6ZGhcScvELVKVHq3n0 15 | username admin1 privilege 15 secret 5 $1$7kD0oS/t$wXhtTFwnWwnlPFKWwXoJ70 16 | username eapi secret 5 $1$zBpvd4C5$LDS6j8PPt6rHikh79Hi46/ 17 | username pyclass privilege 15 secret 5 $1$C3VfUfcO$86t4iqCX60yW.NIR8d2Lh0 18 | username interop privilege 15 secret 5 $1$T85j403F$MrAxCBOEmlTkwO3.RShE71 19 | ! 20 | clock timezone America/Los_Angeles 21 | ! 22 | interface Ethernet1 23 | spanning-tree portfast 24 | ! 25 | interface Ethernet2 26 | ! 27 | interface Ethernet3 28 | ! 29 | interface Ethernet4 30 | ! 31 | interface Ethernet5 32 | ! 33 | interface Ethernet6 34 | ! 35 | interface Ethernet7 36 | ! 37 | interface Management1 38 | shutdown 39 | ! 40 | interface Vlan1 41 | ip address 10.220.88.35/24 42 | ! 43 | ip route 0.0.0.0/0 10.220.88.1 44 | ! 45 | ip routing 46 | ! 47 | management api http-commands 48 | no shutdown 49 | ! 50 | ! 51 | end 52 | -------------------------------------------------------------------------------- /lab_net_build/group_vars/cisco.yml: -------------------------------------------------------------------------------- 1 | --- 2 | napalm_optional: 3 | inline_transfer: True 4 | global_delay_factor: 6 5 | -------------------------------------------------------------------------------- /lab_net_build/load_initial_cfgs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Load Network Device Initial Config 3 | hosts: cisco 4 | gather_facts: False 5 | tasks: 6 | - napalm_install_config: 7 | hostname: "{{ ansible_host }}" 8 | username: "{{ username }}" 9 | password: "{{ password }}" 10 | dev_os: "{{ dev_os }}" 11 | config_file: "INITIAL_CFGS/{{ inventory_hostname }}.txt" 12 | commit_changes: True 13 | replace_config: True 14 | get_diffs: True 15 | diff_file: "DIFFS/{{ inventory_hostname }}.diff" 16 | optional_args: "{{ napalm_optional | default({}) }}" 17 | -------------------------------------------------------------------------------- /lab_net_build/merge.conf: -------------------------------------------------------------------------------- 1 | logging buffered 40000 2 | -------------------------------------------------------------------------------- /lab_net_build/napalm_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from getpass import getpass 3 | from napalm_base import get_network_driver 4 | 5 | import logging 6 | logging.basicConfig(filename='test.log', level=logging.DEBUG) 7 | logger = logging.getLogger("netmiko") 8 | 9 | ip_addr = raw_input("Enter IP: ") 10 | password = getpass() 11 | username = 'interop' 12 | optional_args = {} 13 | optional_args['port'] = 22 14 | optional_args['inline_transfer'] = True 15 | 16 | driver = get_network_driver('ios') 17 | device = driver(ip_addr, username, password, optional_args=optional_args) 18 | 19 | print 20 | print ">>>Test device open" 21 | device.open() 22 | print device.device.timeout 23 | 24 | print 25 | print ">>>Test get facts" 26 | device_facts = device.get_facts() 27 | print device_facts 28 | 29 | #print 30 | #print ">>>Load config change" 31 | #device.load_merge_candidate(filename='merge.conf') 32 | #print device.compare_config() 33 | #device.discard_config() 34 | #device.commit_config() 35 | 36 | print 37 | print ">>>Load full config" 38 | device.load_replace_candidate(filename='./INITIAL_CFGS/cisco2.txt') 39 | print device.compare_config() 40 | #device.commit() 41 | -------------------------------------------------------------------------------- /lab_svr_build/roles/ansible_extras/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # Only works on PY27 (which is fine since probably only for Ansible) 4 | - name: Install pyntc (PY27) 5 | pip: 6 | name: pyntc 7 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 8 | virtualenv_python: python27 9 | become: True 10 | become_user: "{{ item.user }}" 11 | with_items: "{{ applied_users }}" 12 | 13 | - name: Clone ntc-ansible repo 14 | become: True 15 | become_user: "{{ item.user }}" 16 | git: 17 | repo: https://github.com/networktocode/ntc-ansible 18 | dest: "/home/{{ item.user }}/ansible-extras/ntc-ansible" 19 | with_items: "{{ applied_users }}" 20 | -------------------------------------------------------------------------------- /lab_svr_build/roles/ansible_general/files/.ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | hostfile = ~/ansible-hosts 3 | library = ~/napalm-ansible/library:~/ansible-extras/ntc-ansible/library 4 | 5 | -------------------------------------------------------------------------------- /lab_svr_build/roles/ansible_general/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Push ansible-hosts 4 | template: 5 | # src: ansible-hosts.j2 6 | src: "{{ pod_template }}" 7 | dest: "/home/{{item.user}}/ansible-hosts" 8 | owner: "{{ item.user }}" 9 | group: "{{ item.user }}" 10 | mode: 0644 11 | with_items: "{{ applied_users }}" 12 | tags: ansible_hosts 13 | 14 | - name: Copying .ansible.cfg 15 | copy: 16 | src: .ansible.cfg 17 | dest: "/home/{{ item.user }}/.ansible.cfg" 18 | owner: "{{ item.user }}" 19 | group: "{{ item.user }}" 20 | mode: 0644 21 | with_items: "{{ applied_users }}" 22 | tags: ansible_cfg 23 | 24 | # Ansible control machine is PY2 only 25 | - name: Install Ansible (PY27) 26 | pip: 27 | name: ansible 28 | version: 2.3.0.0 29 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 30 | virtualenv_python: python27 31 | become: True 32 | become_user: "{{ item.user }}" 33 | with_items: "{{ applied_users }}" 34 | tags: ansible_pkg 35 | -------------------------------------------------------------------------------- /lab_svr_build/roles/arista/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #### 4 | #### ARISTA-ANSIBLE SECTION 5 | #### 6 | 7 | # Latest release as of 2017-04-27 8 | - name: Install pyeapi (PY27) 9 | pip: 10 | name: pyeapi 11 | version: 0.8.0 12 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 13 | virtualenv_python: python27 14 | become: True 15 | become_user: "{{ item.user }}" 16 | with_items: "{{ applied_users }}" 17 | 18 | - name: Install pyeapi (PY35) 19 | pip: 20 | name: pyeapi 21 | version: 0.8.0 22 | virtualenv: "/home/{{ item.user }}/VENV/py35_interop" 23 | virtualenv_python: python35 24 | become: True 25 | become_user: "{{ item.user }}" 26 | with_items: "{{ applied_users }}" 27 | 28 | -------------------------------------------------------------------------------- /lab_svr_build/roles/juniper/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # Latest as of 2017-04-27 4 | - name: Install Juniper PyEZ (PY27) 5 | pip: 6 | name: junos-eznc 7 | version: 2.1.1 8 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 9 | virtualenv_python: python27 10 | become: True 11 | become_user: "{{ item.user }}" 12 | with_items: "{{ applied_users }}" 13 | 14 | - name: Install Juniper PyEZ (PY35) 15 | pip: 16 | name: junos-eznc 17 | version: 2.1.1 18 | virtualenv: "/home/{{ item.user }}/VENV/py35_interop" 19 | virtualenv_python: python35 20 | become: True 21 | become_user: "{{ item.user }}" 22 | with_items: "{{ applied_users }}" 23 | -------------------------------------------------------------------------------- /lab_svr_build/roles/napalm/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install napalm packages (PY27) 4 | pip: 5 | name: "{{ item[1].pkg }}" 6 | version: "{{ item[1].version | default(omit) }}" 7 | virtualenv: "/home/{{ item[0].user }}/VENV/py27_interop" 8 | virtualenv_python: python27 9 | become: True 10 | become_user: "{{ item[0].user }}" 11 | with_nested: 12 | - "{{ applied_users }}" 13 | - 14 | - { pkg: napalm-base, version: 0.23.3 } 15 | - { pkg: napalm-ios, version: 0.6.2 } 16 | - { pkg: napalm-junos } 17 | - { pkg: napalm-nxos } 18 | - { pkg: napalm-eos } 19 | 20 | - name: Install napalm packages (PY35) 21 | pip: 22 | name: "{{ item[1].pkg }}" 23 | version: "{{ item[1].version | default(omit) }}" 24 | virtualenv: "/home/{{ item[0].user }}/VENV/py35_interop" 25 | virtualenv_python: python35 26 | become: True 27 | become_user: "{{ item[0].user }}" 28 | with_nested: 29 | - "{{ applied_users }}" 30 | - 31 | - { pkg: napalm-base, version: 0.23.3 } 32 | - { pkg: napalm-ios, version: 0.6.2 } 33 | - { pkg: napalm-junos } 34 | - { pkg: napalm-nxos } 35 | - { pkg: napalm-eos } 36 | 37 | - name: Clone napalm-ansible repo 38 | git: 39 | repo: https://github.com/napalm-automation/napalm-ansible 40 | dest: "/home/{{ item.user }}/napalm-ansible" 41 | become: True 42 | become_user: "{{ item.user }}" 43 | with_items: "{{ applied_users }}" 44 | 45 | -------------------------------------------------------------------------------- /lab_svr_build/roles/netmiko/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install Netmiko (PY27) 4 | pip: 5 | name: netmiko 6 | version: 1.4.0 7 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 8 | virtualenv_python: python27 9 | become: True 10 | become_user: "{{ item.user }}" 11 | with_items: "{{ applied_users }}" 12 | tags: netmiko_version 13 | 14 | - name: Install Netmiko (PY35) 15 | pip: 16 | name: netmiko 17 | version: 1.4.0 18 | virtualenv: "/home/{{ item.user }}/VENV/py35_interop" 19 | virtualenv_python: python35 20 | become: True 21 | become_user: "{{ item.user }}" 22 | with_items: "{{ applied_users }}" 23 | tags: netmiko_version 24 | 25 | - name: Clone netmiko-tools repo 26 | become: True 27 | become_user: "{{ item.user }}" 28 | git: repo=https://github.com/ktbyers/netmiko_tools dest=/home/{{ item.user }}/netmiko_tools 29 | with_items: "{{ applied_users }}" 30 | 31 | - name: Copy .netmiko.yml file 32 | become: True 33 | become_user: "{{ item.user }}" 34 | copy: 35 | src: "{{ pod_netmiko }}" 36 | dest: "/home/{{ item.user }}/.netmiko.yml" 37 | owner: "{{ item.user }}" 38 | group: "{{ item.user }}" 39 | mode: 0600 40 | with_items: "{{ applied_users }}" 41 | tags: netmiko_yml 42 | 43 | -------------------------------------------------------------------------------- /lab_svr_build/roles/nexus/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Install pynxos (PY27) 4 | pip: 5 | name: pynxos 6 | version: 0.0.3 7 | virtualenv: "/home/{{ item.user }}/VENV/py27_interop" 8 | virtualenv_python: python27 9 | become: True 10 | become_user: "{{ item.user }}" 11 | with_items: "{{ applied_users }}" 12 | 13 | - name: Install pynxos (PY35) 14 | pip: 15 | name: pynxos 16 | version: 0.0.3 17 | virtualenv: "/home/{{ item.user }}/VENV/py35_interop" 18 | virtualenv_python: python35 19 | become: True 20 | become_user: "{{ item.user }}" 21 | with_items: "{{ applied_users }}" 22 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/files/.ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | hostfile = ~/ansible-hosts 3 | library = ~/ANSIBLE/library/:~/napalm-ansible/library/:~/JUNIPER/library/ 4 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/files/.vimrc: -------------------------------------------------------------------------------- 1 | set tabstop=4 2 | set expandtab 3 | color industry 4 | set number 5 | set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:. 6 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/files/email_helper.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Usage: 3 | 4 | recipient = 'someone@domain.com' 5 | subject = 'Test message' 6 | message = 'This is a test message' 7 | sender = 'someone@gmail.com' 8 | 9 | # send the message 10 | send_mail(recipient, subject, message, sender) 11 | 12 | ''' 13 | 14 | def send_mail(recipient, subject, message, sender): 15 | ''' 16 | Simple function to help simplify sending SMTP email 17 | 18 | Assumes a mailserver is available on localhost 19 | ''' 20 | 21 | import smtplib 22 | from email.mime.text import MIMEText 23 | 24 | message = MIMEText(message) 25 | message['Subject'] = subject 26 | message['From'] = sender 27 | message['To'] = recipient 28 | 29 | # Create SMTP connection object to localhost 30 | smtp_conn = smtplib.SMTP('localhost') 31 | 32 | # Send the email 33 | smtp_conn.sendmail(sender, recipient, message.as_string()) 34 | 35 | # Close SMTP connection 36 | smtp_conn.quit() 37 | 38 | return True 39 | 40 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/files/snmp_helper.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Requires the pysnmp4 library 3 | 4 | Example usage (SNMPv1/SNMPv2c): 5 | 6 | >>> from snmp_helper import snmp_get_oid,snmp_extract 7 | >>> 8 | >>> COMMUNITY_STRING = '' 9 | >>> SNMP_PORT = 161 10 | >>> a_device = ('1.1.1.1', COMMUNITY_STRING, SNMP_PORT) 11 | 12 | Use the MIB-2 sysDescr as a test 13 | >>> snmp_data = snmp_get_oid(a_device, oid='.1.3.6.1.2.1.1.1.0', display_errors=True) 14 | >>> snmp_data 15 | 16 | [(MibVariable(ObjectName(1.3.6.1.2.1.1.1.0)), DisplayString(hexValue='436973636f 17 | 20494f5320536f6674776172652c204338383020536f667477617265202843383830444154412d55 18 | 4e4956455253414c4b392d4d292c2056657273696f6e2031352e302831294d342c2052454c454153 19 | 4520534f4654574152452028666331290d0a546563686e6963616c20537570706f72743a20687474 20 | 703a2f2f7777772e636973636f2e636f6d2f74656368737570706f72740d0a436f70797269676874 21 | 2028632920313938362d3230313020627920436973636f2053797374656d732c20496e632e0d0a43 22 | 6f6d70696c6564204672692032392d4f63742d31302030303a30322062792070726f645f72656c5f 23 | 7465616d'))] 24 | 25 | >>> output = snmp_extract(snmp_data) 26 | >>> print output 27 | Cisco IOS Software, C880 Software (C880DATA-UNIVERSALK9-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1) 28 | Technical Support: http://www.cisco.com/techsupport 29 | Copyright (c) 1986-2010 by Cisco Systems, Inc. 30 | Compiled Fri 29-Oct-10 00:02 by prod_rel_team 31 | 32 | 33 | Example usage (SNMPv3): 34 | 35 | >>> from snmp_helper import snmp_get_oid_v3,snmp_extract 36 | >>> 37 | >>> snmp_device = ('10.10.10.10', 161) 38 | 39 | >>> a_user = 40 | >>> auth_key = 41 | >>> encrypt_key = 42 | >>> snmp_user = (a_user, auth_key, encrypt_key) 43 | 44 | OID to query 45 | >>> sys_descr = '1.3.6.1.2.1.1.1.0' 46 | 47 | Defaults to using AES128 and SHA1 48 | >>> snmp_data = snmp_get_oid_v3(snmp_device, snmp_user, oid=sys_descr) 49 | >>> output = snmp_extract(snmp_data) 50 | 51 | >>> print output 52 | Cisco IOS Software, C880 Software (C880DATA-UNIVERSALK9-M), Version 15.4(2)T1, RELEASE SOFTWARE (fc3) 53 | Technical Support: http://www.cisco.com/techsupport 54 | Copyright (c) 1986-2014 by Cisco Systems, Inc. 55 | Compiled Thu 26-Jun-14 14:15 by prod_rel_team 56 | 57 | ''' 58 | 59 | from __future__ import print_function 60 | from pysnmp.entity.rfc3413.oneliner import cmdgen 61 | 62 | 63 | def snmp_get_oid_v3(snmp_device, snmp_user, oid='.1.3.6.1.2.1.1.1.0', auth_proto='sha', 64 | encrypt_proto='aes128', display_errors=True): 65 | ''' 66 | Retrieve the given OID 67 | 68 | Default OID is MIB2, sysDescr 69 | 70 | snmp_device is a tuple = (hostname_or_IP, snmp_port) 71 | snmp_user is a tuple = (user_name, auth_key, encrypt_key) 72 | 73 | Defaults to SHA1-AES128 for authentication + encryption 74 | 75 | auth_proto can be 'sha' or 'md5' or 'none' 76 | encrypt_proto can be 'aes128', 'aes192', 'aes256', '3des', 'des', or 'none' 77 | 78 | 79 | From PySNMP manuals: http://pysnmp.sourceforge.net/docs/current/security-configuration.html 80 | 81 | Optional authProtocol parameter may be used to specify non-default hash function algorithm. 82 | Possible values include: 83 | usmHMACMD5AuthProtocol -- MD5-based authentication protocol 84 | usmHMACSHAAuthProtocol -- SHA-based authentication protocol 85 | usmNoAuthProtocol -- no authentication to use (default) 86 | 87 | Optional privProtocol parameter may be used to specify non-default ciphering algorithm. 88 | Possible values include: 89 | usmDESPrivProtocol -- DES-based encryption protocol 90 | usmAesCfb128Protocol -- AES128-based encryption protocol (RFC3826) 91 | usm3DESEDEPrivProtocol -- triple DES-based encryption protocol (Extended Security Options) 92 | usmAesCfb192Protocol -- AES192-based encryption protocol (Extended Security Options) 93 | usmAesCfb256Protocol -- AES256-based encryption protocol (Extended Security Options) 94 | usmNoPrivProtocol -- no encryption to use (default) 95 | 96 | ''' 97 | 98 | # unpack snmp_user 99 | a_user, auth_key, encrypt_key = snmp_user 100 | 101 | auth_proto_map = { 102 | 'sha': cmdgen.usmHMACSHAAuthProtocol, 103 | 'md5': cmdgen.usmHMACMD5AuthProtocol, 104 | 'none': cmdgen.usmNoAuthProtocol 105 | } 106 | 107 | if auth_proto in auth_proto_map.keys(): 108 | auth_protocol = auth_proto_map[auth_proto] 109 | else: 110 | raise ValueError("Invalid authentication protocol specified: %s" % auth_proto) 111 | 112 | encrypt_proto_map = { 113 | 'des': cmdgen.usmDESPrivProtocol, 114 | '3des': cmdgen.usm3DESEDEPrivProtocol, 115 | 'aes128': cmdgen.usmAesCfb128Protocol, 116 | 'aes192': cmdgen.usmAesCfb192Protocol, 117 | 'aes256': cmdgen.usmAesCfb256Protocol, 118 | 'none': cmdgen.usmNoPrivProtocol, 119 | } 120 | 121 | if encrypt_proto in encrypt_proto_map.keys(): 122 | encrypt_protocol = encrypt_proto_map[encrypt_proto] 123 | else: 124 | raise ValueError("Invalid encryption protocol specified: %s" % encrypt_proto) 125 | 126 | 127 | # Create a PYSNMP cmdgen object 128 | cmd_gen = cmdgen.CommandGenerator() 129 | 130 | (error_detected, error_status, error_index, snmp_data) = cmd_gen.getCmd( 131 | 132 | cmdgen.UsmUserData(a_user, auth_key, encrypt_key, 133 | authProtocol=auth_protocol, 134 | privProtocol=encrypt_protocol, ), 135 | cmdgen.UdpTransportTarget(snmp_device), 136 | oid, 137 | lookupNames=True, lookupValues=True 138 | ) 139 | 140 | if not error_detected: 141 | return snmp_data 142 | else: 143 | if display_errors: 144 | print('ERROR DETECTED: ') 145 | print(' %-16s %-60s' % ('error_message', error_detected)) 146 | print(' %-16s %-60s' % ('error_status', error_status)) 147 | print(' %-16s %-60s' % ('error_index', error_index)) 148 | return None 149 | 150 | 151 | def snmp_get_oid(a_device, oid='.1.3.6.1.2.1.1.1.0', display_errors=False): 152 | ''' 153 | Retrieve the given OID 154 | 155 | Default OID is MIB2, sysDescr 156 | 157 | a_device is a tuple = (a_host, community_string, snmp_port) 158 | ''' 159 | 160 | a_host, community_string, snmp_port = a_device 161 | snmp_target = (a_host, snmp_port) 162 | 163 | # Create a PYSNMP cmdgen object 164 | cmd_gen = cmdgen.CommandGenerator() 165 | 166 | (error_detected, error_status, error_index, snmp_data) = cmd_gen.getCmd( 167 | cmdgen.CommunityData(community_string), 168 | cmdgen.UdpTransportTarget(snmp_target), 169 | oid, 170 | lookupNames=True, lookupValues=True 171 | ) 172 | 173 | if not error_detected: 174 | return snmp_data 175 | else: 176 | if display_errors: 177 | print('ERROR DETECTED: ') 178 | print(' %-16s %-60s' % ('error_message', error_detected)) 179 | print(' %-16s %-60s' % ('error_status', error_status)) 180 | print(' %-16s %-60s' % ('error_index', error_index)) 181 | return None 182 | 183 | 184 | def snmp_extract(snmp_data): 185 | ''' 186 | Unwrap the SNMP response data and return in a readable format 187 | 188 | Assumes only a single list element is returned 189 | ''' 190 | 191 | if len(snmp_data) > 1: 192 | raise ValueError("snmp_extract only allows a single element") 193 | 194 | if len(snmp_data) == 0: 195 | return None 196 | else: 197 | # Unwrap the data which is returned as a tuple wrapped in a list 198 | return snmp_data[0][1].prettyPrint() 199 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/tasks/main.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Create users 3 | user: name={{ item.user }} comment="Applied Python user" home=/home/{{ item.user }} password={{ item.password }} shell=/bin/bash 4 | with_items: "{{ applied_users }}" 5 | when: False 6 | 7 | - name: Update Password 8 | user: 9 | name: "{{ item.user }}" 10 | password: "$6$scEswQi.$86mLjO7jXlcwoRwlW4PlQWMT/zINXZroKXqYtAA16/nzuznfZBIPDeKy8ypCN5TatnKzRu1E6tqX0RfSLyu7T." 11 | update_password: always 12 | with_items: "{{ applied_users }}" 13 | tags: update_password 14 | when: False 15 | 16 | - name: Copying .vimrc files for applied python users 17 | copy: src=.vimrc dest=/home/{{ item.user }}/.vimrc owner={{ item.user }} group={{ item.user }} mode=0600 18 | become: True 19 | become_user: "{{ item.user }}" 20 | with_items: "{{ applied_users }}" 21 | 22 | - name: Create .bashrc for each user 23 | template: 24 | src: bashrc.j2 25 | dest: "/home/{{ item.user }}/.bashrc" 26 | become: True 27 | become_user: "{{ item.user }}" 28 | with_items: "{{ applied_users }}" 29 | 30 | - name: Add pip packages into virtualenv (PY27) 31 | pip: 32 | name: "{{ item[1] }}" 33 | virtualenv: "/home/{{ item[0].user }}/VENV/py27_interop" 34 | virtualenv_python: python27 35 | become: True 36 | become_user: "{{ item[0].user }}" 37 | with_nested: 38 | - "{{ applied_users }}" 39 | - "{{ python_pkgs }}" 40 | 41 | - name: Add pip packages into virtualenv (PY35) 42 | pip: 43 | name: "{{ item[1] }}" 44 | virtualenv: "/home/{{ item[0].user }}/VENV/py35_interop" 45 | virtualenv_python: python35 46 | become: True 47 | become_user: "{{ item[0].user }}" 48 | with_nested: 49 | - "{{ applied_users }}" 50 | - "{{ python_pkgs }}" 51 | 52 | - name: Create python-libs dir 53 | file: 54 | dest: "/home/{{ item.user }}/python-libs" 55 | owner: "{{ item.user }}" 56 | group: "{{ item.user }}" 57 | mode: 0755 58 | state: directory 59 | with_items: "{{ applied_users }}" 60 | tags: python_libs 61 | 62 | - name: Copying snmp_helper.py 63 | copy: 64 | src: snmp_helper.py 65 | dest: "/home/{{ item.user }}/python-libs/snmp_helper.py" 66 | owner: "{{ item.user }}" 67 | group: "{{ item.user }}" 68 | mode: 0644 69 | with_items: "{{ applied_users }}" 70 | tags: python_libs 71 | 72 | - name: Copying email_helper.py 73 | copy: 74 | src: email_helper.py 75 | dest: "/home/{{ item.user }}/python-libs/email_helper.py" 76 | owner: "{{ item.user }}" 77 | group: "{{ item.user }}" 78 | mode: 0644 79 | with_items: "{{ applied_users }}" 80 | tags: python_libs 81 | 82 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/templates/bashrc.j2: -------------------------------------------------------------------------------- 1 | # .bashrc 2 | 3 | # Source global definitions 4 | if [ -f /etc/bashrc ]; then 5 | . /etc/bashrc 6 | fi 7 | 8 | # Set PATH to include netmiko-tools 9 | export PATH=$PATH:/home/{{ item.user }}/netmiko_tools/netmiko_tools 10 | 11 | # Modify PYTHONPATH to get extra libraries 12 | export PYTHONPATH=~/python-libs 13 | 14 | # Login to the Interop virtualenv 15 | source /home/{{ item.user }}/VENV/py27_interop/bin/activate 16 | #source /home/{{ item.user }}/VENV/py35_interop/bin/activate 17 | -------------------------------------------------------------------------------- /lab_svr_build/roles/python_pkgs/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | python_pkgs: 3 | - pysnmp 4 | - paramiko 5 | - jsonrpclib 6 | - pygal 7 | - pylint 8 | - pep8 9 | - flake8 10 | - pylama 11 | - ciscoconfparse 12 | - pexpect 13 | 14 | -------------------------------------------------------------------------------- /lab_svr_build/roles/server_pkgs/files/.bashrc: -------------------------------------------------------------------------------- 1 | # .bashrc 2 | 3 | # Source global definitions 4 | if [ -f /etc/bashrc ]; then 5 | . /etc/bashrc 6 | fi 7 | 8 | # User specific aliases and functions 9 | alias sbb='sudo /bin/bash' 10 | 11 | -------------------------------------------------------------------------------- /lab_svr_build/roles/server_pkgs/files/.vimrc: -------------------------------------------------------------------------------- 1 | set tabstop=4 2 | set expandtab 3 | color industry 4 | set number 5 | -------------------------------------------------------------------------------- /lab_svr_build/roles/server_pkgs/files/hosts: -------------------------------------------------------------------------------- 1 | 127.0.0.1 localhost localhost.localdomain 2 | 3 | 34.202.2.202 juniper1.twb-tech.com 4 | 34.198.79.135 juniper2.twb-tech.com 5 | 6 | 52.55.17.81 cisco1.twb-tech.com 7 | 34.195.49.69 cisco2.twb-tech.com 8 | 9 | 184.105.247.83 arista5.twb-tech.com 10 | 184.105.247.84 arista6.twb-tech.com 11 | 184.105.247.85 arista7.twb-tech.com 12 | 184.105.247.86 arista8.twb-tech.com 13 | 14 | 15 | # POD1 (student1 - 12) 16 | 52.54.3.175 cisco-p1.twb-tech.com 17 | 54.80.31.117 juniper-p1.twb-tech.com 18 | 34.224.151.176 arista-p1.twb-tech.com 19 | 20 | # POD2 (student13 - 24) 21 | 34.202.211.156 cisco-p2.twb-tech.com 22 | 52.200.223.110 juniper-p2.twb-tech.com 23 | 34.197.96.208 arista-p2.twb-tech.com 24 | 25 | # POD3 (student25 - 36) 26 | 34.202.133.42 cisco-p3.twb-tech.com 27 | 34.239.231.50 juniper-p3.twb-tech.com 28 | 34.199.104.47 arista-p3.twb-tech.com 29 | 30 | # POD4 (student37 - 48) 31 | 34.224.238.136 cisco-p4.twb-tech.com 32 | 34.203.23.77 juniper-p4.twb-tech.com 33 | 34.204.102.54 arista-p4.twb-tech.com 34 | 35 | # POD5 (student49 - 65) 36 | 34.200.122.61 cisco-p5.twb-tech.com 37 | 34.196.184.79 juniper-p5.twb-tech.com 38 | 52.20.142.11 arista-p5.twb-tech.com 39 | 40 | # POD6 (student65 - 79) 41 | 34.224.141.169 cisco-p6.twb-tech.com 42 | 52.45.108.75 juniper-p6.twb-tech.com 43 | 34.202.48.108 arista-p6.twb-tech.com 44 | -------------------------------------------------------------------------------- /lab_svr_build/roles/server_pkgs/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: install required packages 4 | yum: name={{item}} state=present 5 | with_items: 6 | - gcc 7 | - bzip2 8 | - net-snmp 9 | - net-snmp-utils 10 | - python-devel 11 | - python-setuptools 12 | - python34 13 | - python34-devel 14 | - python34-setuptools 15 | - python35 16 | - python35-devel 17 | - python35-setuptools 18 | - telnet 19 | - wget 20 | - emacs 21 | - nano 22 | - git 23 | - vim-enhanced 24 | - libyaml 25 | - libyaml-devel 26 | - libxslt-devel 27 | - libxml2-devel 28 | - libffi-devel 29 | - openssl-devel 30 | - tree 31 | 32 | - name: Ensure virtualenv is installed 33 | pip: name={{ item.name }} state=present use_mirrors=no 34 | with_items: 35 | - { name: 'virtualenv' } 36 | 37 | - name: Copying .bashrc and .vimrc files for gituser 38 | copy: 39 | src: "{{ item.name }}" 40 | dest: "/home/gituser/{{ item.name }}" 41 | owner: gituser 42 | group: gituser 43 | mode: "{{ item.mode }}" 44 | with_items: 45 | - { name: '.bashrc', mode: '0600' } 46 | - { name: '.vimrc', mode: '0600' } 47 | 48 | - name: Copying .bashrc and .vimrc files for ec2-user 49 | copy: 50 | src: "{{ item.name }}" 51 | dest: "/home/ec2-user/{{ item.name }}" 52 | owner: ec2-user 53 | group: ec2-user 54 | mode: "{{ item.mode }}" 55 | with_items: 56 | - { name: '.bashrc', mode: '0600' } 57 | - { name: '.vimrc', mode: '0600' } 58 | 59 | - name: Copying .vimrc file for root 60 | copy: 61 | src: "{{ item.name }}" 62 | dest: "/root/{{ item.name }}" 63 | owner: root 64 | group: root 65 | mode: "{{ item.mode }}" 66 | with_items: 67 | - { name: '.vimrc', mode: '0600' } 68 | 69 | - name: Install /etc/hosts file 70 | copy: 71 | src: hosts 72 | dest: /etc/hosts 73 | owner: root 74 | group: root 75 | mode: '0644' 76 | tags: etc_hosts 77 | -------------------------------------------------------------------------------- /lab_svr_build/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Add Server Packages (yum) 4 | hosts: interop1:interop2 5 | become: True 6 | become_method: sudo 7 | tags: server 8 | roles: 9 | - server_pkgs 10 | 11 | - name: Per-user Tasks 12 | hosts: interop1:interop2 13 | become: True 14 | become_method: sudo 15 | vars_files: 16 | # - main_interop1.yml 17 | # - students_interop.yml 18 | # - students_p1.yml 19 | # - students_p2.yml 20 | # - students_p3.yml 21 | # - students_p4.yml 22 | - students_p5.yml 23 | # - students_p6.yml 24 | tags: interop 25 | roles: 26 | - python_pkgs 27 | - ansible_general 28 | - netmiko 29 | - arista 30 | - juniper 31 | - nexus 32 | - { role: napalm, tags: napalm } 33 | - ansible_extras 34 | -------------------------------------------------------------------------------- /napalm/eos/ntp_config.txt: -------------------------------------------------------------------------------- 1 | ntp server 10.1.1.200 prefer 2 | ntp server 10.1.1.201 3 | -------------------------------------------------------------------------------- /napalm/ios/ntp_config.txt: -------------------------------------------------------------------------------- 1 | ntp server 10.1.1.200 prefer 2 | ntp server 10.1.1.201 3 | -------------------------------------------------------------------------------- /napalm/junos/ntp_config.txt: -------------------------------------------------------------------------------- 1 | system { 2 | ntp { 3 | server 10.1.1.1; 4 | server 10.1.1.2; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /napalm/my_devices.py: -------------------------------------------------------------------------------- 1 | from getpass import getpass 2 | 3 | password=getpass() 4 | 5 | cisco1 = dict( 6 | device_type='cisco_ios', 7 | host='cisco-p1.twb-tech.com', 8 | username='interop', 9 | password=password 10 | ) 11 | 12 | cisco2 = dict( 13 | device_type='cisco_ios', 14 | host='cisco-p2.twb-tech.com', 15 | username='interop', 16 | password=password 17 | ) 18 | 19 | arista1 = dict( 20 | device_type='arista_eos', 21 | host='arista-p1.twb-tech.com', 22 | username='interop', 23 | password=password 24 | ) 25 | 26 | arista2 = dict( 27 | device_type='arista_eos', 28 | host='arista-p2.twb-tech.com', 29 | username='interop', 30 | password=password 31 | ) 32 | 33 | arista3 = dict( 34 | device_type='arista_eos', 35 | host='arista-p3.twb-tech.com', 36 | username='interop', 37 | password=password 38 | ) 39 | 40 | arista4 = dict( 41 | device_type='arista_eos', 42 | host='arista-p4.twb-tech.com', 43 | username='interop', 44 | password=password 45 | ) 46 | 47 | juniper1 = dict( 48 | device_type='juniper_junos', 49 | host='juniper-p1.twb-tech.com', 50 | username='interop', 51 | password=password 52 | ) 53 | 54 | juniper2 = dict( 55 | device_type='juniper_junos', 56 | host='juniper-p2.twb-tech.com', 57 | username='interop', 58 | password=password 59 | ) 60 | 61 | device_list = [ 62 | cisco1, 63 | cisco2, 64 | arista1, 65 | arista2, 66 | arista3, 67 | arista4, 68 | juniper1, 69 | ] 70 | 71 | device_list_mv = [ 72 | cisco1, 73 | arista1, 74 | juniper1, 75 | ] 76 | -------------------------------------------------------------------------------- /napalm/napalm_connect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from getpass import getpass 5 | from pprint import pprint 6 | 7 | driver = get_network_driver('eos') 8 | device = driver('arista-p1.twb-tech.com', 9 | username='interop', 10 | password=getpass()) 11 | 12 | print() 13 | print(">>>Test device open") 14 | device.open() 15 | -------------------------------------------------------------------------------- /napalm/napalm_connect_simple.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from napalm_base import get_network_driver 3 | from getpass import getpass 4 | 5 | driver = get_network_driver('eos') 6 | device = driver('arista-p2.twb-tech.com', username='interop', password=getpass()) 7 | device.open() 8 | -------------------------------------------------------------------------------- /napalm/napalm_facts_1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from getpass import getpass 5 | from pprint import pprint 6 | 7 | device1 = { 8 | 'hostname': 'arista-p3.twb-tech.com', 9 | 'username': 'interop', 10 | 'password': getpass(), 11 | 'optional_args': {}, 12 | } 13 | 14 | driver = get_network_driver('eos') 15 | napalm_conn = driver(**device1) 16 | 17 | print() 18 | print(">>>Test device open") 19 | napalm_conn.open() 20 | 21 | pprint(napalm_conn.get_facts()) 22 | -------------------------------------------------------------------------------- /napalm/napalm_facts_2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from getpass import getpass 5 | from pprint import pprint 6 | 7 | 8 | pwd = getpass() 9 | 10 | arista1 = { 11 | 'device_type': 'eos', 12 | 'hostname': 'arista-p5.twb-tech.com', 13 | 'username': 'interop', 14 | 'password': pwd, 15 | 'optional_args': {}, 16 | } 17 | 18 | cisco1 = { 19 | 'device_type': 'ios', 20 | 'hostname': 'cisco-p5.twb-tech.com', 21 | 'username': 'interop', 22 | 'password': pwd, 23 | 'optional_args': {}, 24 | } 25 | 26 | for device in [arista1, cisco1]: 27 | device_type = device.pop('device_type') 28 | driver = get_network_driver(device_type) 29 | napalm_conn = driver(**device) 30 | 31 | print() 32 | print(">>>Test device open") 33 | napalm_conn.open() 34 | 35 | pprint(napalm_conn.get_facts()) 36 | -------------------------------------------------------------------------------- /napalm/napalm_facts_3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from my_devices import device_list_mv 5 | from pprint import pprint 6 | 7 | 8 | def convert_dict(my_dict): 9 | """Convert dictionaries from Netmiko format to NAPALM format.""" 10 | new_dict = {} 11 | for k, v in my_dict.items(): 12 | new_dict[k] = v 13 | 14 | hostname = new_dict.pop('host') 15 | new_dict['hostname'] = hostname 16 | 17 | device_type = new_dict.pop('device_type') 18 | new_device_type = device_type.split('_')[1] 19 | new_dict['device_type'] = new_device_type 20 | 21 | return new_dict 22 | 23 | 24 | for device in device_list_mv: 25 | 26 | # Modify dictionary format 27 | device = convert_dict(device) 28 | 29 | # Retrieve device_type and driver 30 | device_type = device.pop('device_type') 31 | driver = get_network_driver(device_type) 32 | 33 | napalm_conn = driver(**device) 34 | 35 | print() 36 | print(">>>Test device open") 37 | napalm_conn.open() 38 | 39 | print() 40 | pprint(napalm_conn.get_facts()) 41 | print() 42 | 43 | print() 44 | pprint(napalm_conn.get_interfaces_ip()) 45 | print() 46 | -------------------------------------------------------------------------------- /napalm/napalm_merge.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from getpass import getpass 5 | from pprint import pprint 6 | 7 | device1 = { 8 | 'device_type': 'eos', 9 | 'hostname': 'arista-p1.twb-tech.com', 10 | 'username': 'interop', 11 | 'password': getpass(), 12 | 'optional_args': {}, 13 | } 14 | 15 | 16 | for device in [device1,]: 17 | 18 | # Retrieve device_type and driver 19 | device_type = device.pop('device_type') 20 | driver = get_network_driver(device_type) 21 | 22 | napalm_conn = driver(**device) 23 | 24 | print() 25 | print(">>>Test device open") 26 | napalm_conn.open() 27 | 28 | print(">>>Load merge from file: {}".format(device['hostname'])) 29 | filename = "{}/ntp_config.txt".format(device_type) 30 | napalm_conn.load_merge_candidate(filename=filename) 31 | 32 | print(">>>Diff") 33 | print(napalm_conn.compare_config()) 34 | 35 | if False: 36 | print("\n>>>Discard changes") 37 | print(napalm_conn.discard_config()) 38 | print(napalm_conn.compare_config()) 39 | 40 | if True: 41 | print(">>>Commit change") 42 | napalm_conn.commit_config() 43 | -------------------------------------------------------------------------------- /napalm/napalm_merge_1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from napalm_base import get_network_driver 4 | from my_devices import device_list_mv 5 | from pprint import pprint 6 | 7 | 8 | def convert_dict(my_dict): 9 | """Convert dictionaries from Netmiko format to NAPALM format.""" 10 | new_dict = {} 11 | for k, v in my_dict.items(): 12 | new_dict[k] = v 13 | 14 | hostname = new_dict.pop('host') 15 | new_dict['hostname'] = hostname 16 | 17 | device_type = new_dict.pop('device_type') 18 | new_device_type = device_type.split('_')[1] 19 | new_dict['device_type'] = new_device_type 20 | 21 | return new_dict 22 | 23 | 24 | for device in device_list_mv: 25 | 26 | # Modify dictionary format 27 | device = convert_dict(device) 28 | 29 | # Retrieve device_type and driver 30 | device_type = device.pop('device_type') 31 | driver = get_network_driver(device_type) 32 | 33 | napalm_conn = driver(**device) 34 | 35 | print() 36 | print(">>>Test device open") 37 | napalm_conn.open() 38 | 39 | print(">>>Load merge from file: {}".format(device['hostname'])) 40 | filename = "{}/ntp_config.txt".format(device_type) 41 | napalm_conn.load_merge_candidate(filename=filename) 42 | print(">>>Diff") 43 | print(napalm_conn.compare_config()) 44 | print(">>>Commit change") 45 | napalm_conn.commit_config() 46 | -------------------------------------------------------------------------------- /napalm/remove_ntp.txt: -------------------------------------------------------------------------------- 1 | no ntp server 10.1.1.200 prefer 2 | no ntp server 10.1.1.201 3 | -------------------------------------------------------------------------------- /netmiko/logging_change.txt: -------------------------------------------------------------------------------- 1 | no logging console 2 | logging buffered 25000 3 | -------------------------------------------------------------------------------- /netmiko/my_devices.py: -------------------------------------------------------------------------------- 1 | from getpass import getpass 2 | 3 | password=getpass() 4 | 5 | cisco1 = dict( 6 | device_type='cisco_ios', 7 | host='cisco-p1.twb-tech.com', 8 | username='interop', 9 | password=password 10 | ) 11 | 12 | cisco2 = dict( 13 | device_type='cisco_ios', 14 | host='cisco-p2.twb-tech.com', 15 | username='interop', 16 | password=password 17 | ) 18 | 19 | arista5 = dict( 20 | device_type='arista_eos', 21 | host='arista-p1.twb-tech.com', 22 | username='interop', 23 | password=password 24 | ) 25 | 26 | arista6 = dict( 27 | device_type='arista_eos', 28 | host='arista-p2.twb-tech.com', 29 | username='interop', 30 | password=password 31 | ) 32 | 33 | arista7 = dict( 34 | device_type='arista_eos', 35 | host='arista-p3.twb-tech.com', 36 | username='interop', 37 | password=password 38 | ) 39 | 40 | arista8 = dict( 41 | device_type='arista_eos', 42 | host='arista-p4.twb-tech.com', 43 | username='interop', 44 | password=password 45 | ) 46 | 47 | 48 | device_list = [ 49 | cisco1, 50 | cisco2, 51 | arista5, 52 | arista6, 53 | arista7, 54 | arista8, 55 | ] 56 | -------------------------------------------------------------------------------- /netmiko/netmiko-grep-examples.md: -------------------------------------------------------------------------------- 1 | 2 | #### Look at netmiko-tools inventory 3 | $ cat ~/.netmiko.yml 4 | 5 | #### List devices in inventory 6 | $ netmiko-grep --list-devices 7 | 8 | #### Search for 'interface' line 'cisco' group 9 | $ netmiko-grep 'interface' cisco 10 | 11 | #### Retrieve 'show arp' output from the juniper1 device 12 | $ netmiko-show --cmd 'show arp' juniper1 13 | 14 | #### Configure logging buffer on arista-sw5 15 | $ netmiko-cfg --cmd 'logging buffered 20000' arista1 16 | 17 | #### Make configuration changes specified in 'logging_change.txt' file 18 | $ netmiko-cfg --infile logging_change.txt arista 19 | -------------------------------------------------------------------------------- /netmiko/save_output.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from my_devices import device_list 5 | 6 | 7 | command = "show run" 8 | base_dir = "/home/kbyers/configs" 9 | 10 | for device in device_list: 11 | net_connect = ConnectHandler(**device) 12 | 13 | # Determine name of device 14 | hostname = net_connect.base_prompt 15 | filename = "{}/{}.txt".format(base_dir, hostname) 16 | 17 | # Send show command down channel 18 | print("Retrieving output: {}".format(hostname)) 19 | output = net_connect.send_command(command) 20 | 21 | with open(filename, "wt") as f: 22 | f.write(output) 23 | -------------------------------------------------------------------------------- /netmiko/show_command.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from netmiko import ConnectHandler 3 | from getpass import getpass 4 | 5 | net_connect = ConnectHandler(device_type='cisco_ios', host='cisco-p6.twb-tech.com', username='interop', password=getpass()) 6 | show_arp = net_connect.send_command("show ip int brief") 7 | print(show_arp) 8 | -------------------------------------------------------------------------------- /netmiko/show_command_1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from getpass import getpass 5 | 6 | net_connect = ConnectHandler( 7 | device_type='cisco_ios', 8 | host='cisco-p3.twb-tech.com', 9 | username='interop', 10 | password=getpass() 11 | ) 12 | 13 | print(net_connect.find_prompt()) 14 | 15 | # Send show command down channel 16 | show_ip = net_connect.send_command("show ip int brief") 17 | 18 | # Display output 19 | print("\n") 20 | print("-" * 80) 21 | print(show_ip) 22 | print("-" * 80) 23 | print("\n") 24 | -------------------------------------------------------------------------------- /netmiko/show_command_2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from getpass import getpass 5 | 6 | device1 = dict( 7 | device_type='cisco_ios', 8 | host='cisco-p4.twb-tech.com', 9 | username='interop', 10 | password=getpass() 11 | ) 12 | 13 | for device in [device1,]: 14 | 15 | net_connect = ConnectHandler(**device) 16 | 17 | print(net_connect.find_prompt()) 18 | 19 | # Send show command down channel 20 | show_ip = net_connect.send_command("show ip int brief") 21 | 22 | # Display output 23 | print("\n") 24 | print("-" * 80) 25 | print(show_ip) 26 | print("-" * 80) 27 | print("\n") 28 | -------------------------------------------------------------------------------- /netmiko/show_command_3.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from getpass import getpass 5 | 6 | 7 | pwd = getpass() 8 | 9 | device1 = dict( 10 | device_type='cisco_ios', 11 | host='cisco-p5.twb-tech.com', 12 | username='interop', 13 | password=pwd 14 | ) 15 | 16 | device2 = dict( 17 | device_type='arista_eos', 18 | host='arista-p5.twb-tech.com', 19 | username='interop', 20 | password=pwd 21 | ) 22 | 23 | 24 | for device in [device1, device2]: 25 | 26 | net_connect = ConnectHandler(**device) 27 | 28 | print(net_connect.find_prompt()) 29 | 30 | # Send show command down channel 31 | show_ip = net_connect.send_command("show ip int brief") 32 | 33 | # Display output 34 | print("\n") 35 | print("-" * 80) 36 | print(show_ip) 37 | print("-" * 80) 38 | print("\n") 39 | -------------------------------------------------------------------------------- /netmiko/show_command_4.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from my_devices import device_list 5 | 6 | 7 | for device in device_list: 8 | 9 | net_connect = ConnectHandler(**device) 10 | command = 'show ip int brief' 11 | 12 | # Send show command down channel 13 | show_ip = net_connect.send_command(command) 14 | 15 | # Display output 16 | print("\n") 17 | print(net_connect.find_prompt()) 18 | print("-" * 80) 19 | print(show_ip) 20 | print("-" * 80) 21 | print("\n") 22 | -------------------------------------------------------------------------------- /netmiko/show_command_5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from my_devices import device_list 5 | 6 | 7 | try: 8 | command = raw_input("Enter command: ") 9 | except NameError: 10 | command = input("Enter command: ") 11 | 12 | for device in device_list: 13 | net_connect = ConnectHandler(**device) 14 | 15 | # Send show command down channel 16 | output = net_connect.send_command(command) 17 | 18 | # Display output 19 | print("\n") 20 | print(net_connect.find_prompt()) 21 | print("-" * 80) 22 | print(output) 23 | print("-" * 80) 24 | print("\n") 25 | -------------------------------------------------------------------------------- /netmiko/simple_connection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from netmiko import ConnectHandler 3 | from getpass import getpass 4 | 5 | net_connect = ConnectHandler(device_type='cisco_ios', host='cisco-p1.twb-tech.com', username='interop', password=getpass()) 6 | print(net_connect.find_prompt()) 7 | -------------------------------------------------------------------------------- /netmiko/simple_connection_2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from netmiko import ConnectHandler 4 | from getpass import getpass 5 | 6 | net_connect = ConnectHandler( 7 | device_type='cisco_ios', 8 | host='cisco-p2.twb-tech.com', 9 | username='interop', 10 | password=getpass(), 11 | ) 12 | 13 | print(net_connect.find_prompt()) 14 | 15 | -------------------------------------------------------------------------------- /presentations/2017-05-16-net-auto-workshop-intro-slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottslowe/itx2017-net-auto-workshop/a72e001caa86ad75fb798f4fd1d2425600953852/presentations/2017-05-16-net-auto-workshop-intro-slides.pdf -------------------------------------------------------------------------------- /presentations/Interop17-Hands-On-Net-Automation-JJ_templates-ansible.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottslowe/itx2017-net-auto-workshop/a72e001caa86ad75fb798f4fd1d2425600953852/presentations/Interop17-Hands-On-Net-Automation-JJ_templates-ansible.pdf -------------------------------------------------------------------------------- /presentations/Interop17-Hands-On-Net-Automation-KB.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottslowe/itx2017-net-auto-workshop/a72e001caa86ad75fb798f4fd1d2425600953852/presentations/Interop17-Hands-On-Net-Automation-KB.pdf -------------------------------------------------------------------------------- /presentations/OswaltMatt_Testing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottslowe/itx2017-net-auto-workshop/a72e001caa86ad75fb798f4fd1d2425600953852/presentations/OswaltMatt_Testing.pdf -------------------------------------------------------------------------------- /python_basics/data_types.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | # Numbers 4 | number1 = 7 5 | number2 = 2 6 | number3 = 2.0 7 | 8 | print("\nNumbers") 9 | print('-' * 80) 10 | print(type(number1)) 11 | print(type(number3)) 12 | 13 | print("Add: {}".format(number1 + number2)) 14 | print("Subtract: {}".format(number1 - number2)) 15 | print("Multiply: {}".format(number1 * number2)) 16 | print("Division (what?): {}".format(number1 / number2)) 17 | print("Division Float: {}".format(number1 / number3)) 18 | print('-' * 80) 19 | print("\n\n") 20 | 21 | 22 | 23 | # Strings 24 | str1 = 'hello' 25 | str2 = 'whatever' 26 | str3 = '10.100.17.8' 27 | str4 = 'hello world\n\n\n' 28 | 29 | print("\nStrings") 30 | print('-' * 80) 31 | print(type(str1)) 32 | # String concatenation 33 | print(str1 + " " + str2) 34 | # Split a string (returns a list) 35 | octets = str3.split(".") 36 | print(octets) 37 | # Strip leading and trailing whitespace 38 | print(str4.strip()) 39 | print('-' * 80) 40 | print("\n\n") 41 | 42 | 43 | 44 | # Some other data types 45 | print("\nSome other data types") 46 | print('-' * 80) 47 | 48 | my_var = None 49 | print(type(my_var)) 50 | 51 | bool1 = True 52 | bool2 = False 53 | print(type(my_var)) 54 | print(bool1 and bool2) 55 | print(bool1 or bool2) 56 | print('-' * 80) 57 | print("\n\n") 58 | -------------------------------------------------------------------------------- /python_basics/dict_ex.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | my_dict = { 4 | 'device_name': 'router1', 5 | 'device_type': 'arista_eos', 6 | 'ip_addr': '1.1.1.1', 7 | 'username': 'admin', 8 | 'password': 'hello', 9 | } 10 | 11 | print(my_dict) 12 | 13 | # Access a given key: 14 | print(my_dict['ip_addr']) 15 | 16 | # Change a key: 17 | my_dict['ip_addr'] = '200.1.17.2' 18 | print(my_dict['ip_addr']) 19 | 20 | # Add a new element: 21 | my_dict['port'] = 22 22 | 23 | # Keys (iterable) 24 | print(my_dict.keys()) 25 | 26 | # Key-Value (iterable) 27 | print(my_dict.items()) 28 | -------------------------------------------------------------------------------- /python_basics/if_else.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | my_ip = '22.17.7.9' 4 | 5 | if '8' in my_ip: 6 | print("I found 8") 7 | elif my_ip == '22.17.': 8 | print("I found 22.17") 9 | elif my_ip == '22.17.7.9': 10 | print("I found 22.17.7.9") 11 | else: 12 | print("I never found it.") 13 | -------------------------------------------------------------------------------- /python_basics/lists_ex.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | # Create a list (zero-indexed) 4 | my_list = [ 5 | 1, 6 | 2, 7 | 'whatever', 8 | 'something', 9 | 2.0, 10 | True, 11 | None, 12 | 17, 13 | ] 14 | 15 | print(my_list) 16 | 17 | # Access a list element 18 | print(my_list[3]) 19 | 20 | # Change a list element 21 | my_list[3] = 'new value' 22 | print(my_list) 23 | 24 | # Access last element of list 25 | print(my_list[-1]) 26 | 27 | # List slices 28 | print(my_list[2:5]) 29 | -------------------------------------------------------------------------------- /python_basics/loops.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | my_dict = { 4 | 'device_name': 'router1', 5 | 'device_type': 'arista_eos', 6 | 'ip_addr': '1.1.1.1', 7 | 'username': 'admin', 8 | 'password': 'hello', 9 | } 10 | 11 | my_list = [ 12 | 1, 13 | 2, 14 | 'whatever', 15 | 'something', 16 | 2.0, 17 | True, 18 | None, 19 | 17, 20 | ] 21 | 22 | 23 | # Loop over the elements in my_list 24 | for element in my_list: 25 | print(element) 26 | print(">>>>Done1\n\n") 27 | 28 | # Loop and break 29 | for element in my_list: 30 | if element == 'something': 31 | break 32 | print(element) 33 | print(">>>>Done2\n\n") 34 | 35 | # Loop and continue 36 | for element in my_list: 37 | if element == 'something': 38 | continue 39 | print(element) 40 | print(">>>>Done3\n\n") 41 | 42 | # Loop over a dict (will loop over keys automatically) 43 | for key in my_dict: 44 | print(key) 45 | print(">>>>Done4\n\n") 46 | 47 | # Loop over a dict (keys and values) 48 | for k, v in my_dict.items(): 49 | print("{} ----> {}".format(k, v)) 50 | print(">>>>Done5\n\n") 51 | -------------------------------------------------------------------------------- /python_basics/print_format.py: -------------------------------------------------------------------------------- 1 | """ format() method is helpful. """ 2 | from __future__ import print_function 3 | 4 | router1 = '10.1.1.1' 5 | router2 = '10.1.17.1' 6 | router3 = '10.1.207.1' 7 | 8 | print("\nPrint out three variables in a string") 9 | print("{} {} {}".format(router1, router2, router3)) 10 | 11 | print("\nPrint out three variables in columns 20 chars wide") 12 | print("{:20}{:20}{:20}".format(router1, router2, router3)) 13 | 14 | print("\nPrint out three variables in columns 20 chars wide (right justify)") 15 | print("{:>20}{:>20}{:>20}".format(router1, router2, router3)) 16 | 17 | # Print header/trailer lines 18 | print() 19 | print("-" * 80) 20 | print("{:>20}{:>20}{:>20}".format(router1, router2, router3)) 21 | print("-" * 80) 22 | 23 | print() 24 | -------------------------------------------------------------------------------- /python_basics/printing.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | router1 = '10.1.1.1' 4 | router2 = '10.1.17.1' 5 | router3 = '10.1.207.1' 6 | 7 | # Print some variables 8 | print(router1) 9 | print(router2) 10 | print(router3) 11 | 12 | # Print a string 13 | print("This is just some string") 14 | 15 | # Print a string with newlines 16 | print('This is a string\n\n\nwith newlines') 17 | 18 | # Create a multiline string 19 | some_var = """ 20 | This is also a string 21 | 22 | with 23 | 24 | newllines 25 | """ 26 | print(some_var) 27 | -------------------------------------------------------------------------------- /python_basics/read_input.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | # Python2/3 why do you need to be this way: 4 | try: 5 | ip_addr = raw_input("Enter an IP address: ") 6 | except NameError: 7 | ip_addr = input("Enter an IP address: ") 8 | 9 | print("You entered: {}".format(ip_addr)) 10 | -------------------------------------------------------------------------------- /python_basics/vars.py: -------------------------------------------------------------------------------- 1 | 2 | # Convention all lower case with underscore for word separator 3 | my_var = 22 4 | my_string = 'hello' 5 | 6 | # Can have numbers 7 | my_var9 = 17 8 | 9 | # A number can't start a variable however 10 | # 9var = 8 11 | 12 | # Can use Caps, but ALL_CAPS by convention is a constant 13 | MY_ROUTER = '10.1.1.1' 14 | 15 | # Can mix upper and lower if you want (but follow conventions) 16 | myRouter = '10.1.1.2' 17 | -------------------------------------------------------------------------------- /templates/.gitignore: -------------------------------------------------------------------------------- 1 | render_output.cfg 2 | *.diff 3 | configs/ 4 | -------------------------------------------------------------------------------- /templates/arista_eapi.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from jsonrpclib import Server 4 | from jsonrpclib import ProtocolError 5 | from pprint import pprint 6 | import ssl 7 | 8 | # Disable SSL Certificate validation for self-signed certs 9 | try: 10 | _create_unverified_https_context = ssl._create_unverified_context 11 | except AttributeError: 12 | # Legacy Python that doesn't verify HTTPS certificates by default 13 | pass 14 | else: 15 | # Handle target environment that doesn't support HTTPS verification 16 | ssl._create_default_https_context = _create_unverified_https_context 17 | 18 | user = 'interop' 19 | passwd = 'netauto42' 20 | host = 'arista5.twb-tech.com' 21 | 22 | switch = Server('https://{}:{}@{}/command-api'.format( user, passwd, host)) 23 | 24 | print "\n### Human format:" 25 | response = switch.runCmds(1, ['show version'], 'text') 26 | pprint(response) 27 | 28 | print "\n### Machine format:" 29 | response = switch.runCmds(1, ['show version']) 30 | pprint(response) 31 | 32 | print "\n### Use the structured data:" 33 | model = response[0]['modelName'] 34 | version = response[0]['version'] 35 | print "Device {} is {} running EOS version {}\n".format(host, model, version) 36 | -------------------------------------------------------------------------------- /templates/check_version.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # ansible-playbook -i ~/ansible-hosts check_version.yml -v 3 | - name: Gather data from devices 4 | hosts: arista 5 | vars: 6 | eapi_conn: 7 | host: '{{ ansible_host }}' 8 | username: interop 9 | password: netauto42 10 | transport: eapi 11 | use_ssl: true 12 | validate_certs: false 13 | 14 | tasks: 15 | - name: Ensure config dir exists 16 | file: 17 | path: configs 18 | state: directory 19 | - name: Get EOS version 20 | eos_command: 21 | commands='show version' 22 | provider={{ eapi_conn }} 23 | -------------------------------------------------------------------------------- /templates/juniper_push_config.yml: -------------------------------------------------------------------------------- 1 | # ansible-playbook -i ~/ansible-hosts juniper_push_config.yml -v 2 | --- 3 | - name: Configure nodes from templates 4 | hosts: juniper1 5 | vars: 6 | ports: 7 | - { name: 'ge-0/0/0', descr: Configured by ansible } 8 | 9 | 10 | tasks: 11 | - name: Ensure config dir exists 12 | file: 13 | path: configs 14 | state: directory 15 | 16 | - name: Ensure backups dir exists 17 | file: 18 | path: backups 19 | state: directory 20 | 21 | - name: Render config sections from templates 22 | template: 23 | src: templates/juniper-interfaces.j2 24 | dest: configs/{{ ansible_host }}-new.cfg 25 | 26 | # - name: Push config commands to nodes with built-in 27 | # eos_config: 28 | # provider: "{{ eapi_conn }}" 29 | # src: configs/{{ ansible_host }}-new.cfg 30 | 31 | - name: Push config commands to nodes with napalm 32 | napalm_install_config: 33 | hostname: "{{ ansible_host }}" 34 | username: "{{ username }}" 35 | password: "{{ password }}" 36 | dev_os: junos 37 | config_file: "configs/{{ ansible_host }}-new.cfg" 38 | archive_file: "backups/{{ ansible_host }}-old.cfg" 39 | commit_changes: True 40 | replace_config: False 41 | diff_file: "{{ ansible_host }}.diff" 42 | 43 | # - name: Push config commands to nodes with networktocode 44 | # ntc_config_command: 45 | # platform: "{{ ntc_platform }}" 46 | # host: "{{ ansible_host }}" 47 | # username: "{{ username }}" 48 | # password: "{{ password }}" 49 | # commands_file: configs/{{ ansible_host }}-new.cfg 50 | -------------------------------------------------------------------------------- /templates/push_config.yml: -------------------------------------------------------------------------------- 1 | # ansible-playbook -i ~/ansible-hosts push_config.yml -v 2 | --- 3 | - name: Configure nodes from templates 4 | hosts: arista5 5 | vars: 6 | eapi_conn: 7 | host: '{{ ansible_host }}' 8 | username: "{{ username }}" 9 | password: "{{ password }}" 10 | #transport: ssh 11 | use_ssl: true 12 | validate_certs: false 13 | ports: 14 | - { name: Ethernet2, descr: Configured by ansible, vlan: 100 } 15 | - { name: Ethernet3, descr: host32-eth0 } 16 | 17 | 18 | tasks: 19 | - name: Ensure backups dir exists 20 | file: 21 | path: backups 22 | state: directory 23 | 24 | - name: Ensure config dir exists 25 | file: 26 | path: configs 27 | state: directory 28 | 29 | - name: Render config sections from templates 30 | template: 31 | src: templates/{{ ansible_host }}-adv.j2 32 | dest: configs/{{ ansible_host }}-new.cfg 33 | 34 | # - name: Push config commands to nodes with built-in 35 | # eos_config: 36 | # provider: "{{ eapi_conn }}" 37 | # src: configs/{{ ansible_host }}-new.cfg 38 | 39 | - name: Push config commands to nodes with napalm 40 | napalm_install_config: 41 | hostname: "{{ ansible_host }}" 42 | username: "{{ username }}" 43 | password: "{{ password }}" 44 | dev_os: eos 45 | config_file: "configs/{{ ansible_host }}-new.cfg" 46 | archive_file: "backups/{{ ansible_host }}-old.cfg" 47 | commit_changes: True 48 | replace_config: False 49 | diff_file: "{{ ansible_host }}.diff" 50 | 51 | # - name: Push config commands to nodes with networktocode 52 | # ntc_config_command: 53 | # platform: "{{ ntc_platform }}" 54 | # host: "{{ ansible_host }}" 55 | # username: "{{ username }}" 56 | # password: "{{ password }}" 57 | # commands_file: configs/{{ ansible_host }}-new.cfg 58 | -------------------------------------------------------------------------------- /templates/render_template.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ''' Render a template ''' 3 | 4 | from jinja2 import Template 5 | 6 | template = Template("interface {{ intf }}\n description Testing\n!") 7 | 8 | for x in [1, 2]: 9 | print template.render(intf="Ethernet{}".format(x)) 10 | -------------------------------------------------------------------------------- /templates/render_template_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ''' Render a template ''' 3 | 4 | import jinja2 5 | 6 | templateLoader = jinja2.FileSystemLoader( searchpath="./templates") 7 | templateEnv = jinja2.Environment( loader=templateLoader ) 8 | TEMPLATE_FILE = "arista5.twb-tech.com-basic.j2" 9 | template = templateEnv.get_template( TEMPLATE_FILE ) 10 | 11 | 12 | with open('render_output.cfg', 'w') as f: 13 | for x in [1, 2]: 14 | config = template.render(port_name="Ethernet{}".format(x), 15 | description="Configured by Python") 16 | print config 17 | 18 | f.write(config + "\n") 19 | -------------------------------------------------------------------------------- /templates/templates/arista5.twb-tech.com-adv.j2: -------------------------------------------------------------------------------- 1 | {% for port in ports %} 2 | interface {{ port.name }} 3 | description {{ port.descr }} 4 | {# 5 | {% if port.enable %}no {% endif %}shutdown 6 | #} 7 | {% endfor %} 8 | -------------------------------------------------------------------------------- /templates/templates/arista5.twb-tech.com-basic.j2: -------------------------------------------------------------------------------- 1 | interface {{ port_name }} 2 | description {{ description }} 3 | shutdown 4 | ! 5 | -------------------------------------------------------------------------------- /templates/templates/juniper-interfaces.j2: -------------------------------------------------------------------------------- 1 | {% for port in ports %} 2 | interfaces { 3 | {{ port.name }} { 4 | description "{{ port.descr }}" 5 | } 6 | } 7 | {% endfor %} 8 | -------------------------------------------------------------------------------- /workshop-outline.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Outline for Hands-on Network Automation Workshop 3 | project: Interop ITX 2017 4 | author: Scott Lowe 5 | affiliation: blog.scottlowe.org 6 | date: 2017-04-07 7 | keywords: 8 | - Python 9 | - Ansible 10 | - Jinja2 11 | - Automation 12 | - Networking 13 | --- 14 | 15 | # [% title ] 16 | 17 | ## Part 1: Overview of the Environment (Scott) 18 | 19 | * General flow of the workshop 20 | * Tools that will be covered 21 | * Use of cloud-based instances 22 | * Takeaways (preconfigured Linux VM, etc.) 23 | 24 | ## Part 2: Retrieving Configurations (Kirk) 25 | 26 | * Quick Python intro 27 | * Connecting to a device using Python 28 | * Retrieving device configurations 29 | * Committing device configurations to Git repository 30 | 31 | ## Part 3: Changing and Verifying Configurations (Matt) 32 | 33 | * Making configuration changes using Python 34 | * Verifying changes with diffs 35 | * Writing unit tests to verify configuration changes 36 | 37 | ## Part 4: Using Templates for Configurations (Jere) 38 | 39 | * Intro to Jinja2 templates 40 | * Creating a Jinja2 template 41 | - Using Python 42 | - Using Ansible 43 | * Sending templated configs to a device 44 | --------------------------------------------------------------------------------