3com
backup config
=4200 : ''tftp 192.168.1.115 put unit1>flash:/3comoscfg.cfg R2_206.cfg''\\ ''tftp 192.168.1.115 put flash:/3comoscfg.cfg R2_206.cfg''
=4500: ''backup startup-configuration to 192.168.1.115''
ntp
ntp-service unicast-server {ip-address | server-name }
clock timezone CET add 01:00:00
clock summer-time CEST repeating 02:00:00 2020 March last Sunday 03:00:00 2020 October last Sunday 01:00:00
trunk
<4200G>system-view
[4200G]interface GigabitEthernet 1/0/27
[4200G]port link-type trunk
[4200G]port trunk permit vlan 2 4 50 to 100
[4200G]port trunk permit vlan all
automatické zálohování na tftp
#!/bin/sh
ARCHIVE="sw-backup.tar.gz"
TFTP="192.168.3.79"
TFTP_DIR="/var/lib/tftpboot"
IP="192.168.1.201
192.168.1.203
192.168.1.205
192.168.1.206
192.168.1.207
192.168.1.211
192.168.1.213
192.168.1.214
192.168.1.215
192.168.1.218
192.168.1.219
192.168.1.230"
for ip in $IP;
do
/usr/bin/expect <<EOD
set timeout 5
spawn telnet $ip
expect "ame:"
send "admin\r"
expect "assword:"
send "heslo\r"
expect ">"
send "\r"
expect ">"
send "di ver\r"
expect {
-re "Switch 4500G|Switch 4510G|HP A5120|HP A5500" {
send "backup startup-configuration to $TFTP sw-$ip.cfg\r"
expect "finished!"
}
-re "Switch 4500|Switch 5500G" {
send "backup fabric current-configuration to $TFTP sw-$ip.cfg\r"
expect "finished!"
}
"Switch 4200G" {
send "tftp $TFTP put unit1>flash:/3comoscfg.cfg sw-$ip.cfg\r"
expect "successfully."
}
}
send "\r"
EOD
done
tar -zcf /tmp/$ARCHIVE $TFTP_DIR/*
uuencode /tmp/$ARCHIVE $ARCHIVE | mail -s "Switches backup" mail@mail.cz
rm -f /tmp/$ARCHIVE