ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

将路由配置备份在freebsd tftp服务器上的方法

2014-11-25 07:26| 发布者: admin| 查看: 857| 评论: 0

摘要: 先在freebsd8.0上建立tftp服务器 #!/bin/sh #code by scpman #http://www.luyouqiwang.com/dz/ echo 'inetd_enable=YES' /etc/rc.conf mkdir /tftp_bak #echo 'tftp dgram udp wait root /usr/libexec/tftpd tftpd ...

先在freebsd8.0上建立tftp服务器
#!/bin/sh
#code by scpman
#http://www.luyouqiwang.com/dz/
echo 'inetd_enable="YES"' >> /etc/rc.conf
mkdir /tftp_bak
#echo 'tftp    dgram   udp     wait    root    /usr/libexec/tftpd      tftpd -l -s /tftpd_bak ' >> /etc/inetd.conf
#用这句,-w参数允许客户端直接传不用在服务端先创建文件
echo 'tftp    dgram   udp     wait    root    /usr/libexec/tftpd      tftpd   -s /usr/backup_app/company_inside/router -w'>>/etc/inetd.conf
/etc/rc.d/inetd reload
lsof -i:69
if [ $? = 0 ]
then
 echo TFTP server is ok
fi
然后登录路由:
telnet 192.168.1.1
Password:
Router>en  
Router>
Router#copy running-config tftp:
Address or name of remote host []? 172.17.14.200
Destination filename [router-confg]?
TFTP: error code 0 received - 20079
%Error opening tftp://192.168.1.200/router-config (Undefined error)##默认tftp不可以写,在tftp上建立出对应文件名
在192.168.1.200#touch /tftp_bak/router-config
#chmod 666 /tftp_bak/router-config  #要是666权限
再来一次:
Router#copy running-config tftp:
Address or name of remote host []? 192.168.1.200
Destination filename [router-confg]? router-config
!!!!!
16318 bytes copied in 1.416 secs (11524 bytes/sec)
#搞定!
垃圾的很啊,每次都要先建立出来??
当然不是了,加-w参数,允许客户端直接写文件tftp服务器。已经修改在脚本中了。

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-7-2 08:59 , Processed in 0.068293 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部