centos 服务器拷文件,CentOS7服务器连接nas拷贝文件

1. 给nas配置固定ip并用网线直接连接到nas上

先把nas连接到局域网里,在局域网里用windows下的nas厂商提供的工具查找到了nas的ip,进去web页面将ip设置为固定ip 192.168.3.3。 CentOS服务器有两个网卡,em1正在使用(dhcp分配的ip)不可变动,em2没在使用。

用网线将em2和nas的网口直连。配置em2网卡的IP为192.168.3.5。配置centos路由,先查看route。

[root@localhost ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 172.31.0.1 0.0.0.0 UG 100 0 0 em1 172.31.0.0 0.0.0.0 255.255.255.0 U 100 0 0 em1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

如果发现有em2的route,先route del -net x.x.x.x netmask x.x.x.x dev em2 删掉。

添加到192.168.3.3的route。

route add -host 192.168.3.3 dev em2 [root@localhost ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 172.31.0.1 0.0.0.0 UG 100 0 0 em1 172.31.0.0 0.0.0.0 255.255.255.0 U 100 0 0 em1 192.168.3.3 0.0.0.0 255.255.255.255 UH 0 0 0 em2 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

这样再ping 192.168.3.3就可以ping通了。

2. 安装SmbClient,把nas的文件夹mount到/mnt/smb下。

yum install samba samba-client samba-swat mkdir /mnt/smb smbclient -L 198.168.3.3 -U username%password #列出该IP地址所提供的共享文件夹 mount -o username=username,password=123456 //192.168.3.3/tmp /mnt/smb/ #mount

这样就可以到/mnt/smb访问nas了。

原文出处:简书 -> http://www.jianshu.com/p/224720f6f3c1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值