Created
January 11, 2020 18:08
-
-
Save NeKJ/204f2c4edb8a66705cdbeda599458bd7 to your computer and use it in GitHub Desktop.
Speedport W 724V static arp update script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
set timeout 5 | |
proc timedout { } { | |
puts "\n**** timed out\n" | |
abort | |
} | |
proc abort { } { | |
puts failed\n | |
exit 1 | |
} | |
proc success { } { | |
puts success\n | |
} | |
spawn telnet 192.168.1.1 23 | |
expect { | |
"Speedport Login:" {} | |
failed abort | |
"invalid password" abort | |
timeout timedout | |
} | |
send "admin\r" | |
expect { | |
"Password:" {} | |
failed abort | |
timeout timedout | |
} | |
send "PASSWORD_GOES_HERE\r" | |
# Wait for a prompt. Adjust as needed to match the expected prompt. | |
expect { | |
"Speedport>" {} | |
"login incorrect" abort | |
failed abort | |
timeout timedout | |
} | |
send "arp\r" | |
expect { | |
"Speedport>" {} | |
failed abort | |
"invalid password" abort | |
timeout timedout | |
} | |
send "arp -s 192.168.1.2 ΧΧ:ΧΧ:ΧΧ:ΧΧ:ΧΧ:ΧΧ\r" | |
expect { | |
"Speedport>" {} | |
failed abort | |
"invalid password" abort | |
timeout timedout | |
} | |
send "arp\r" | |
expect { | |
"Speedport>" {} | |
failed abort | |
"invalid password" abort | |
timeout timedout | |
} | |
send "exit\r" | |
# Wait 5 seconds before exiting script and closing all processes. | |
sleep 1 |
How did you activate telnet on Speedport W724V? I am looking to do exactly, what your script does.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script updates the static ARP table of Speedport W 724V by adding a static record with the IP and MAC address of a computer. This way the correlation is maintained even after the the ARP tables gets cleared. This is helpful for using Wake On Lan (WOL), which this router does not currently support.
This script requires expect and telnet to be installed
To use just replace: