Created
March 19, 2025 18:22
-
-
Save hiqua/6a53130645c91f3847993ba51a22882a to your computer and use it in GitHub Desktop.
Remove all static DHCP leases on a Zyxel router
This file contains hidden or 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 | |
# Remove all static DHCP leases on a Zyxel router. | |
set timeout 10 | |
set password "MY_PASSWORD" | |
spawn ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa [email protected] | |
expect "password:" | |
send "$password\r" | |
expect "ZySH>" | |
for {set i 1} {$i <= 254} {incr i} { | |
send "cfg static_dhcp delete --Index $i\r" | |
expect "ZySH>" | |
} | |
send "exit\r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment