diff --git a/lab/lab.yaml b/lab/lab.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fc6071a2c53b479ae5b46102a645ceb2ee665409 --- /dev/null +++ b/lab/lab.yaml @@ -0,0 +1,212 @@ +lab: + description: '' + notes: '' + title: Lab at Thu 10:04 AM + version: 0.2.0 +links: + - id: l0 + n1: n0 + n2: n1 + i1: i0 + i2: i0 + label: ext-conn-0-port<->unmanaged-switch-0-port0 + - id: l1 + n1: n1 + n2: n2 + i1: i1 + i2: i1 + label: unmanaged-switch-0-port1<->iosv-0-GigabitEthernet0/0 + - id: l2 + n1: n1 + n2: n3 + i1: i2 + i2: i1 + label: unmanaged-switch-0-port2<->iosv-1-GigabitEthernet0/0 + - id: l3 + n1: n2 + n2: n3 + i1: i2 + i2: i2 + label: iosv-0-GigabitEthernet0/1<->iosv-1-GigabitEthernet0/1 + - id: l4 + n1: n4 + n2: n1 + i1: i1 + i2: i3 + label: iosv-2-GigabitEthernet0/0<->unmanaged-switch-0-port3 + - id: l5 + n1: n4 + n2: n2 + i1: i2 + i2: i3 + label: iosv-2-GigabitEthernet0/1<->iosv-0-GigabitEthernet0/2 +nodes: + - boot_disk_size: null + configuration: bridge0 + cpu_limit: null + cpus: null + data_volume: null + hide_links: false + id: n0 + image_definition: null + label: ext-conn-0 + node_definition: external_connector + ram: null + tags: [] + x: -200 + y: 160 + interfaces: + - id: i0 + label: port + slot: 0 + type: physical + - boot_disk_size: null + configuration: ums-bb1640ec-7a + cpu_limit: null + cpus: null + data_volume: null + hide_links: false + id: n1 + image_definition: null + label: unmanaged-switch-0 + node_definition: unmanaged_switch + ram: null + tags: [] + x: -40 + y: 40 + interfaces: + - id: i0 + label: port0 + slot: 0 + type: physical + - id: i1 + label: port1 + slot: 1 + type: physical + - id: i2 + label: port2 + slot: 2 + type: physical + - id: i3 + label: port3 + slot: 3 + type: physical + - id: i4 + label: port4 + slot: 4 + type: physical + - id: i5 + label: port5 + slot: 5 + type: physical + - id: i6 + label: port6 + slot: 6 + type: physical + - id: i7 + label: port7 + slot: 7 + type: physical + - boot_disk_size: null + configuration: hostname inserthostname-here + cpu_limit: null + cpus: null + data_volume: null + hide_links: false + id: n2 + image_definition: null + label: iosv-0 + node_definition: iosv + ram: null + tags: [] + x: 200 + y: -40 + interfaces: + - id: i0 + label: Loopback0 + type: loopback + - id: i1 + label: GigabitEthernet0/0 + slot: 0 + type: physical + - id: i2 + label: GigabitEthernet0/1 + slot: 1 + type: physical + - id: i3 + label: GigabitEthernet0/2 + slot: 2 + type: physical + - id: i4 + label: GigabitEthernet0/3 + slot: 3 + type: physical + - boot_disk_size: null + configuration: hostname inserthostname-here + cpu_limit: null + cpus: null + data_volume: null + hide_links: false + id: n3 + image_definition: null + label: iosv-1 + node_definition: iosv + ram: null + tags: [] + x: 0 + y: -120 + interfaces: + - id: i0 + label: Loopback0 + type: loopback + - id: i1 + label: GigabitEthernet0/0 + slot: 0 + type: physical + - id: i2 + label: GigabitEthernet0/1 + slot: 1 + type: physical + - id: i3 + label: GigabitEthernet0/2 + slot: 2 + type: physical + - id: i4 + label: GigabitEthernet0/3 + slot: 3 + type: physical + - boot_disk_size: null + configuration: hostname inserthostname-here + cpu_limit: null + cpus: null + data_volume: null + hide_links: false + id: n4 + image_definition: null + label: iosv-2 + node_definition: iosv + ram: null + tags: [] + x: 440 + y: 40 + interfaces: + - id: i0 + label: Loopback0 + type: loopback + - id: i1 + label: GigabitEthernet0/0 + slot: 0 + type: physical + - id: i2 + label: GigabitEthernet0/1 + slot: 1 + type: physical + - id: i3 + label: GigabitEthernet0/2 + slot: 2 + type: physical + - id: i4 + label: GigabitEthernet0/3 + slot: 3 + type: physical +annotations: [] diff --git a/maskrecover.py b/maskrecover.py new file mode 100755 index 0000000000000000000000000000000000000000..d75c0aa9bc2b6061ef17b71b7bf2a3e751f33aba --- /dev/null +++ b/maskrecover.py @@ -0,0 +1,12 @@ +def read_file(): + ip_path = "router1_ip.txt" + mask_path = "router1_mask.txt" + + with open(ip_path, "r") as file: + lines = file.readlines() + for line in lines: + print(line.strip()) + + +if __name__ == "__main__": + read_file() diff --git a/networks.txt b/networks.txt new file mode 100644 index 0000000000000000000000000000000000000000..f282cf03e21eb4c8e759f02aaa30a66be20547ff --- /dev/null +++ b/networks.txt @@ -0,0 +1,2 @@ +router1 - gi0/1 - 10.10.20.169 -- network: .129-.174 - 255.255.255.248 +router2 - gi0/1 - 10.10.20.177 -- network: .177-.182 diff --git a/plays/test.yaml b/plays/test.yaml index c6faf250519e5791fcbddd768baa0d7353bcf2b8..bc886d70213883d0d8d982f9e6b32a84eaed11c7 100644 --- a/plays/test.yaml +++ b/plays/test.yaml @@ -6,10 +6,10 @@ tasks: - name: Show int info cisco.ios.ios_command: - commands: show ip route vrf Mgmt-intf + commands: show ip static route register: interfaces_info - name: Print output copy: content: "{{interfaces_info.stdout[0]}}" - dest: ~/onlab/{{inventory_hostname}}.txt \ No newline at end of file + dest: ~/onlab/{{inventory_hostname}}.txt diff --git a/router1.txt b/router1.txt new file mode 100644 index 0000000000000000000000000000000000000000..4cf3cb5e24b218f47802794bcc430a93a057577a --- /dev/null +++ b/router1.txt @@ -0,0 +1,16 @@ +Codes: M - Manual static, A - AAA download, N - IP NAT, D - DHCP, + G - GPRS, V - Crypto VPN, C - CASA, P - Channel interface processor, + B - BootP, S - Service selection gateway + DN - Default Network, T - Tracking object + L - TL1, E - OER, I - iEdge + D1 - Dot1x Vlan Network, K - MWAM Route + PP - PPP default route, MR - MRIPv6, SS - SSLVPN + H - IPe Host, ID - IPe Domain Broadcast + U - User GPRS, TE - MPLS Traffic-eng, LI - LIIN + IR - ICMP Redirect +Codes in []: A - active, N - non-active, B - BFD-tracked, D - Not Tracked, P - permanent + +Static local RIB for default + +M 10.10.20.160/29 [1/0] via 10.10.20.177 [N] +M 10.10.20.176/29 [1/0] via 10.10.20.177 [N] \ No newline at end of file diff --git a/router1_ip.txt b/router1_ip.txt new file mode 100644 index 0000000000000000000000000000000000000000..382cf6af2f6eaa843b9ee613f4052b48f42a61c9 --- /dev/null +++ b/router1_ip.txt @@ -0,0 +1,2 @@ +10.10.20.160 +10.10.20.176 diff --git a/router1_mask.txt b/router1_mask.txt new file mode 100644 index 0000000000000000000000000000000000000000..bae7f4f14cf38bd26b5a1a76feb5cd73cc80d3da --- /dev/null +++ b/router1_mask.txt @@ -0,0 +1,2 @@ +29 +29 diff --git a/router_config b/router_config new file mode 100644 index 0000000000000000000000000000000000000000..32adc7d6360295fa5c7790fd5b0ab0ea531d5caf --- /dev/null +++ b/router_config @@ -0,0 +1,25 @@ +enable +configure terminal +hostname R3 +enable secret cisco +! +username bmzsombi secret cisco +ip domain-name onlab +crypto key generate rsa modulus 2048 +ip ssh version 2 +! +line vty 0 4 +transport input ssh +login local +! +exit +vrf definition Mgmt-intf +address-family ipv4 +interface g0/0 +vrf forwarding Mgmt-intf +ip address 10.10.20.102 255.255.255.0 +no shutdown +exit +ip route vrf Mgmt-intf 0.0.0.0 0.0.0.0 10.10.20.254 +end +wr diff --git a/sort.sh b/sort.sh new file mode 100755 index 0000000000000000000000000000000000000000..6ac546206893a606b2c6d9d1553e8cd056e01cda --- /dev/null +++ b/sort.sh @@ -0,0 +1,2 @@ +cat router1.txt | grep "^M" | cut -d' ' -f3 | cut -d'/' -f1 >> router1_ip.txt +cat router1.txt | grep "^M" | cut -d' ' -f3 | cut -d'/' -f2 >> router1_mask.txt