华为交换机配置的导出和导入

本文是记录如何导入导出华为交换机的配置文件的技术文章。

导出配置文件

设备作为FTP服务器,用户PC作为FTP客户端

配置设备的FTP功能及FTP用户信息。

<HUAWEI> system-view
[HUAWEI] ftp server enable
[HUAWEI] sysname Paul //设置主机名成为Paul
[HUAWEI] paul
[HUAWEI-paul] local-user wenglei password irreversible-cipher wl@163
[HUAWEI-paul] local-user wenglei privilege level 15
[HUAWEI-paul] local-user wenglei service-type ftp
[HUAWEI-paul] local-user wenglei ftp-directory cfcard:/  //这里注意是你交换机当前目录dir
[HUAWEI-paul] quit
[HUAWEI] quit
//保存设备当前配置。
<HUAWEI> save

PC端通过FTP连接设备

从终端PC通过FTP连接设备,输入用户名wenglei和密码wl@163,并采用binary模式进行文件传输。
终端以Window10操作系统为例说明。

C:\Documents and Settings\Administrator> ftp 10.136.23.5
Connected to 10.136.23.5.
220 FTP service ready.
User (10.136.23.5:(none)): wenglei
331 Password required for wenglei.
Password: wl@163
230 User logged in.
ftp> binary
200 Type set to I.
ftp>

导出配置文件。

ftp> get vrpcfg.zip
200 Port command okay.
150 Opening BINARY mode data connection for vrpcfg.zip.
226 Transfer complete.
ftp: 收到 1257 字节,用时 0.0340.55千字节/秒。

设置恢复的配置文件为下次启动配置文件并重启设备
C:\Users\Administrator>这是备份的配置文件的默认路径
至此备份成功

导入配置文件

设备作为FTP服务器,本地PC作为FTP客户端,将备份的配置文件上传到设备中

配置设备的FTP服务器功能及FTP用户信息。

<HUAWEI> system-view
[HUAWEI] ftp server enable
[HUAWEI] paul
[HUAWEI-paul] local-user wenglei password irreversible-cipher wl@163
[HUAWEI-paul] local-user wenglei privilege level 15
[HUAWEI-paul] local-user wenglei service-type ftp
[HUAWEI-paul] local-user wenglei ftp-directory cfcard:/
[HUAWEI-paul] quit
[HUAWEI] quit

PC端通过FTP连接设备

从终端PC通过FTP连接设备,输入用户名wenglei和密码wl@163,并采用binary模式进行文件传输。
终端以Window10操作系统为例说明。

C:\> ftp 10.136.23.5
Connected to 10.136.23.5.
220 FTP service ready.
User (10.136.23.5:(none)): wenglei
331 Password required for wenglei.
Password: wl@163
230 User logged in.
ftp> binary
200 Type set to I.
ftp>

上传配置文件到设备中。

ftp> put vrpcfg.zip
200 Port command okay.
150 Opening BINARY mode data connection for vrpcfg.zip.
226 Transfer complete.
ftp: 发送 1257 字节,用时 0.0340.55千字节/秒。

至此上传配置文件成功了
dir命令查看是否上传成功了

设置恢复的配置文件为下次启动配置文件并重启设备

<HUAWEI> startup saved-configuration config.cfg
<HUAWEI> display startup
MainBoard:
  Configured startup system software:        cfcard:/device_software.cc
  Startup system software:                   cfcard:/device_software.cc
  Next startup system software:              cfcard:/device_software.cc
  Startup saved-configuration file:          cfcard:/config_old.cfg   //设备当前的配置文件名。
  Next startup saved-configuration file:     cfcard:/config.cfg   //下次启动的配置文件名。
  Startup paf file:                          default
  Next startup paf file:                     default
  Startup license file:                      default
  Next startup license file:                 default
  Startup patch package:                     NULL
  Next startup patch package:                NULL
<HUAWEI> reboot   //重启设备。
Info: The system is now comparing the configuration, please wait.
Warning: The configuration has been modified, and it will be saved to the next startup saved-configuration file cfcard:/config.cfg. Continue? [Y/N]:N
//输入N防止设备当前的配置保存到备份的配置文件中。
Now saving the current configuration to the slot 13.
Save the configuration successfully.
Info: If want to reboot with saving diagnostic information, input 'N' and then execute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:Y   //输入Y重启设备。
  • 17
    点赞
  • 176
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

彖爻之辞

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值