From 8b9b35d33aea372dd637438e6882bde617d3a902 Mon Sep 17 00:00:00 2001 From: Spartan-Onslaught Date: Fri, 22 Aug 2025 13:17:25 +0700 Subject: [PATCH 1/2] added more routers --- routers.yaml | 10 ++++++++++ update-script.txt | 0 2 files changed, 10 insertions(+) create mode 100644 update-script.txt diff --git a/routers.yaml b/routers.yaml index 8ed287d..3c0021f 100644 --- a/routers.yaml +++ b/routers.yaml @@ -8,4 +8,14 @@ routers: ip: 192.168.1.2 username: admin password: cisco123 + enable_password: enable123 + - hostname: router3 + ip: 192.168.1.3 + username: admin + password: cisco123 + enable_password: enable123 + - hostname: router4 + ip: 192.168.1.4 + username: admin + password: cisco123 enable_password: enable123 \ No newline at end of file diff --git a/update-script.txt b/update-script.txt new file mode 100644 index 0000000..e69de29 From 0b2b11faecb4fcef3619392b06f14a7aca2dde4b Mon Sep 17 00:00:00 2001 From: Spartan-Onslaught Date: Fri, 22 Aug 2025 13:18:56 +0700 Subject: [PATCH 2/2] added to script --- connect_routers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connect_routers.py b/connect_routers.py index f73be10..7af7459 100644 --- a/connect_routers.py +++ b/connect_routers.py @@ -5,14 +5,16 @@ def load_router_details(yaml_file): with open(yaml_file, 'r') as file: return yaml.safe_load(file) + def connect_to_router(router): """Simulate connecting to a router and print its details.""" print(f"Connecting to {router['hostname']} at {router['ip']}...") print(f"Using username: {router['username']}") print(f"Enable password: {router['enable_password']}") + print(f"Example command: 'show ip interface brief'") print(f"Connection to {router['hostname']} successful!") print("-" * 40) routers = load_router_details('routers.yaml')['routers'] for router in routers: - connect_to_router(router) + connect_to_router(router) \ No newline at end of file