openwrt怎么访问文件目录 - 爱问答

(爱问答)

openwrt怎么访问文件目录

看到某论坛说

讲xx文件 解压到 libmodules3.10.49 下。不知道怎么操作


1、用putty连接路由器,用putty下载安装所需的软件包:(直接复制下面内容到提示符)
opkg update
opkg install kmod-usb-core
opkg install kmod-usb2                #安装usb2.0
opkg install kmod-usb-ohci            #安装usb ohci控制器驱动
opkg install kmod-usb-storage         #安装usb存储设备驱动
opkg install kmod-fs-ext3             #安装ext3分区格式支持组件
opkg install kmod-fs-vfat             #挂载FAT
opkg install ntfs-3g                  #挂载NTFS
opkg install mount-utils              #挂载卸载工具
opkg install block-mount
opkg install luci-app-samba           #SAMBA网络共享服务
/etc/init.d/samba enable              #启用并开始SAMBA共享
/etc/init.d/samba restart
注意在线安装软件包需保证路由器Wan口可以连接Internet
2、重启路由器 登陆路由器设置界面 可以看到多了挂载点和网络共享两个选项(也可全部做完再重启)
3、用WinSCP连接路由器,打开/etc/hotplug.d/block/10-mount文件(如果不存在请新建)
修改为如下内容
#!/bin/sh
# Copyright (C) 2009 OpenWrt.org  (C) 2010 OpenWrt.org.cn
blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` !="block" ]; then
  device=`basename $DEVPATH`
  case "$ACTION" in
      add)
               mkdir -p /mnt/$device
               # vfat & ntfs-3g check
               if  [ `which fdisk` ]; then
                       isntfs=`fdisk -l | grep$device | grep NTFS`
                       isvfat=`fdisk -l | grep$device | grep FAT`
                       isfuse=`lsmod | grepfuse`
                       isntfs3g=`whichntfs-3g`
               else
                       isntfs=""
                       isvfat=""
               fi
               # mount with ntfs-3g ifpossible, else with default mount
               if [ "$isntfs" -a"$isfuse" -a "$isntfs3g" ]; then
                       ntfs-3g -o nls=utf8/dev/$device /mnt/$device
               elif [ "$isvfat" ];then
                       mount -t vfat -oiocharset=utf8,rw,sync,umask=0000,dmask=0000,fmask=0000 /dev/$device/mnt/$device
               else
                       mount /dev/$device/mnt/$device
               fi
 if[ -f /dev/${device}/swapfile ]; then
 mkswap /dev/${device}/swapfile
 swapon /dev/${device}/swapfile
 fi
               ;;
      remove)
 if[ -f /dev/${device}/swapfile ]; then
 swapoff /dev/${device}/swapfile
 fi
               umount /dev/$device
               ;;
  esac
fi
这段脚本可实现自动挂载,如不想编辑脚本,也可在挂载点中自己设置(PS.没试过)
插入U盘或移动硬盘再次重启路由器 在挂载点中就可以看到已经挂载的设备
3、如果用Hub接入多个U盘,第二个设备就是/mnt/sdb,以此类推
4、进入网络共享中,添加共享目录例如/mnt/sda1,权限为777(即完全访问)。
至此就可以在网上邻居中看到路由器的这个共享文件夹了。
5、注意XP系统 必须保证
Computer Browser
Server
Application Layer Gatway Service
Windows Firewall/Internet ConnectionSharing
这几个服务开启并且在本地连接属性中
Microsoft 网络的文件和打印机共享
启用时网上邻居文件才可以访问

下一篇:在c#中如何验证密码是否正确,正确则跳转到下一个页面

上一篇:面试官问的mysql的优化和数据库的优化有什么区别

热门标签:
excel 网盘 破解 word dll
最新更新:
微软重新评估新的Outlook的使用时机 联想推出搭载联发科Helio G80芯片组的Tab M9平板 英特尔创新大赛时间确定! 微软Edge浏览器在稳定渠道中推出Workspaces功能 英伟达RTX4060TiGPU推出MaxSun动漫主题! 谷歌地图为用户提供了街景服务! GameSir 在T4 Kaleid中推出了一款出色的控制器! 微软开始在Windows 11 中测试其画图应用程序的新深色模式! LG电子推出全球首款无线OLED电视 英伟达人工智能芯片崭露头角! Steam Deck可以玩什么游戏-Steam Deck价格限时优惠 雷蛇推出CobraPro鼠标 Kindle电子阅读器可以访问谷歌商店吗 Windows10如何加入组策略 window10图片查看器怎么没有了?