Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sbyrnes committed Mar 18, 2024
1 parent 8ba0aec commit 830aea1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lab-2/4_netmiko_seek_helper_addrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
password = "clab@123"
device_type = "cisco_xr"
hosts = ["172.16.x.2", "172.16.x.3", "172.16.x.4"] # TODO
target_ip_helper = "fill me in!"
target_ip_helper = "fill me in!" # TODO

for host in hosts:
# Create a variable that represents an SSH connection to our router.
Expand Down Expand Up @@ -35,7 +35,7 @@
continue

# Get the last "word" in the line, which is the helper IP address.
ip = helper_address_line[-1]
ip = helper_address_line[-1].text

if ip != target_ip_helper:
print(f"Found old IP helper!:\n{intf}")
Expand All @@ -48,7 +48,7 @@
# Let's observe:
print(f"Running: {commands}")
connection.send_config_set(commands)
new_interface_config = connection.send_command(f"show run int {intf_name}")
print(f"Post-configuration:\n{new_interface_config}")
print(f"Running: show run int {intf_name}")
print(connection.send_command(f"show run int {intf_name}"))

print("Done!")

0 comments on commit 830aea1

Please sign in to comment.