找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 38501|回复: 35

wr703n刷openwrt单网口wan、lan自动识别切换达成

 火.. [复制链接]
发表于 2012-3-18 22:13 | 显示全部楼层 |阅读模式
本帖最后由 weereew 于 2012-3-22 18:22 编辑

固件版本:trunk r30919(经测试,只适用于r30919,在r30857上测试不成功
所需软件:kmod-macvlan,ip
均来自openwrt官网源
在我仅有的环境下,lan和wan自适应:插到上层路由器上可自动获得ip地址,插到电脑上以后电脑也可以自动获得ip地址,有兴趣的可以测试一下
配置文件如下:
/etc/rc.local
  1. # Put your custom commands here that should be executed once
  2. # the system init finished. By default this file does nothing.

  3. ip link add link eth0 eth2 type macvlan
  4. ifconfig eth2 hw ether 00:11:22:33:44:5b
  5. ifconfig eth2 up


  6. exit 0
复制代码
/etc/config/network
  1. config 'interface' 'loopback'
  2.         option 'ifname' 'lo'
  3.         option 'proto' 'static'
  4.         option 'ipaddr' '127.0.0.1'
  5.         option 'netmask' '255.0.0.0'

  6. config 'interface' 'lan'
  7.         option ifname 'eth2'
  8.         option 'type' 'bridge'
  9.         option 'proto' 'static'
  10.         option 'ipaddr' '192.168.18.1'
  11.         option 'netmask' '255.255.255.0'

  12. config 'interface' 'wan'
  13.         option 'proto' 'dhcp'
  14.         option 'ifname' 'eth0'
  15.         option 'hostname' 'openwrt'
复制代码

wireless文件不需要配置



我的恩山、我的无线 The best wifi forum is right here.
发表于 2012-3-18 23:35 | 显示全部楼层
试试看
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-18 23:47 | 显示全部楼层
越来越强了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-19 00:40 | 显示全部楼层
那么给力?看来必须得试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-3-19 01:43 | 显示全部楼层
小标 发表于 2012-3-19 00:40
那么给力?看来必须得试试

烦劳彪哥做个稳定性以及广泛使用性测试以便于以后集成到新固件里咯,我现在的情况是即便不能正常发送或者接收DHCP,那么保持现在的插入姿势,然后拔插电源重启就好了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-19 19:28 | 显示全部楼层
牛   谢谢楼主分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-19 21:33 | 显示全部楼层
实用.
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-20 02:22 | 显示全部楼层
下面这一句话报错

  1. # ip link add link eth0 eth2 type macvlan
  2. RTNETLINK answers: Device or resource busy
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-3-20 21:26 | 显示全部楼层
yoyicue 发表于 2012-3-20 02:22
下面这一句话报错

是最新版的r30919吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-23 23:14 | 显示全部楼层
weereew 发表于 2012-3-20 21:26
是最新版的r30919吗?

多谢回复 刚刚才闲下来 我才是 30733
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-24 01:58 | 显示全部楼层
weereew 发表于 2012-3-20 21:26
是最新版的r30919吗?

是最新的 r30919 依然不行
  1. Linux version 3.2.9 (openwrt@OpenWRTBuild) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Tue Mar 13 20:33:19 MST 2012
复制代码
即便我先把 eth0 停掉都不行
  1. Sep  8 15:44:12 OpenWrt user.info sysinit: RTNETLINK answers: Device or resource busy
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-3-24 13:56 | 显示全部楼层
yoyicue 发表于 2012-3-24 01:58
是最新的 r30919 依然不行即便我先把 eth0 停掉都不行

这个事情很奇怪,那我贴上我所安装的包你参考一下,另外我的703硬件是1.5版本的,难道和这个有关?
  1. root@OpenWrt:~# opkg list-installed
  2. base-files - 104-r30919
  3. base-files-network - 4
  4. blkid - 1.42-1
  5. block-mount - 0.2.0-7
  6. busybox - 1.19.3-10
  7. chat - 2.4.5-4
  8. comgt - 0.32-9
  9. crda - 1.1.1-1
  10. dnsmasq - 2.59-2
  11. dropbear - 2011.54-2
  12. e2fsprogs - 1.42-1
  13. fdisk - 2.13.0.1-4
  14. firewall - 2-47
  15. hotplug2 - 1.0-beta-4
  16. ip - 2.6.39-1
  17. iptables - 1.4.10-4
  18. iw - 3.3-1
  19. kernel - 3.2.9-1-7ca3c65ac3709dabad42d460596851da
  20. kmod-ath - 3.2.9+2012-02-27-1
  21. kmod-ath9k - 3.2.9+2012-02-27-1
  22. kmod-ath9k-common - 3.2.9+2012-02-27-1
  23. kmod-cfg80211 - 3.2.9+2012-02-27-1
  24. kmod-crypto-aes - 3.2.9-1
  25. kmod-crypto-arc4 - 3.2.9-1
  26. kmod-crypto-core - 3.2.9-1
  27. kmod-fs-ext4 - 3.2.9-1
  28. kmod-gpio-button-hotplug - 3.2.9-1
  29. kmod-ipt-conntrack - 3.2.9-1
  30. kmod-ipt-core - 3.2.9-1
  31. kmod-ipt-nat - 3.2.9-1
  32. kmod-ipt-nathelper - 3.2.9-1
  33. kmod-leds-gpio - 3.2.9-1
  34. kmod-ledtrig-usbdev - 3.2.9-1
  35. kmod-lib-crc-ccitt - 3.2.9-1
  36. kmod-lib-crc16 - 3.2.9-1
  37. kmod-mac80211 - 3.2.9+2012-02-27-1
  38. kmod-macvlan - 3.2.9-1
  39. kmod-nls-base - 3.2.9-1
  40. kmod-ppp - 3.2.9-1
  41. kmod-pppoe - 3.2.9-1
  42. kmod-scsi-core - 3.2.9-1
  43. kmod-usb-core - 3.2.9-1
  44. kmod-usb-ohci - 3.2.9-1
  45. kmod-usb-serial - 3.2.9-1
  46. kmod-usb-serial-option - 3.2.9-1
  47. kmod-usb-serial-wwan - 3.2.9-1
  48. kmod-usb-storage - 3.2.9-1
  49. kmod-usb2 - 3.2.9-1
  50. kmod-wdt-ath79 - 3.2.9-1
  51. libblkid - 1.42-1
  52. libc - 0.9.33-104
  53. libcom_err - 1.42-1
  54. libext2fs - 1.42-1
  55. libgcc - 4.6-linaro-104
  56. libip4tc - 1.4.10-4
  57. libnl-tiny - 0.1-2
  58. libpthread - 0.9.33-104
  59. libuci - 2012-02-24.1-1
  60. libusb - 0.1.12-2
  61. libuuid - 1.42-1
  62. libxtables - 1.4.10-4
  63. mtd - 17
  64. opkg - 618-2
  65. ppp - 2.4.5-4
  66. ppp-mod-pppoe - 2.4.5-4
  67. swap-utils - 2.13.0.1-4
  68. swconfig - 10
  69. uboot-envtools - 2011.06-4
  70. uci - 2012-02-24.1-1
  71. usb-modeswitch - 1.2.3-1
  72. usb-modeswitch-data - 20120120-1
  73. wireless-tools - 29-4
  74. wpad-mini - 20111103-3
  75. root@OpenWrt:~#
复制代码



我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-24 22:52 | 显示全部楼层
weereew 发表于 2012-3-24 13:56
这个事情很奇怪,那我贴上我所安装的包你参考一下,另外我的703硬件是1.5版本的,难道和这个有关?

我也是 ver 1.5 难道有依赖 要不麻烦您提供下固件? 我试试?
  1. root@OpenWrt:/# opkg list-installed
  2. base-files - 104-r30919
  3. base-files-network - 4
  4. busybox - 1.19.3-10
  5. crda - 1.1.1-1
  6. dnsmasq - 2.59-2
  7. dropbear - 2011.54-2
  8. firewall - 2-47
  9. hotplug2 - 1.0-beta-4
  10. ip - 2.6.39-1
  11. iptables - 1.4.10-4
  12. iw - 3.3-1
  13. kernel - 3.2.9-1-7ca3c65ac3709dabad42d460596851da
  14. kmod-ath - 3.2.9+2012-02-27-1
  15. kmod-ath9k - 3.2.9+2012-02-27-1
  16. kmod-ath9k-common - 3.2.9+2012-02-27-1
  17. kmod-cfg80211 - 3.2.9+2012-02-27-1
  18. kmod-crypto-aes - 3.2.9-1
  19. kmod-crypto-arc4 - 3.2.9-1
  20. kmod-crypto-core - 3.2.9-1
  21. kmod-gpio-button-hotplug - 3.2.9-1
  22. kmod-ipt-conntrack - 3.2.9-1
  23. kmod-ipt-core - 3.2.9-1
  24. kmod-ipt-nat - 3.2.9-1
  25. kmod-ipt-nathelper - 3.2.9-1
  26. kmod-leds-gpio - 3.2.9-1
  27. kmod-ledtrig-usbdev - 3.2.9-1
  28. kmod-lib-crc-ccitt - 3.2.9-1
  29. kmod-mac80211 - 3.2.9+2012-02-27-1
  30. kmod-macvlan - 3.2.9-1
  31. kmod-nls-base - 3.2.9-1
  32. kmod-ppp - 3.2.9-1
  33. kmod-pppoe - 3.2.9-1
  34. kmod-usb-core - 3.2.9-1
  35. kmod-usb-ohci - 3.2.9-1
  36. kmod-usb2 - 3.2.9-1
  37. kmod-wdt-ath79 - 3.2.9-1
  38. libc - 0.9.33-104
  39. libgcc - 4.6-linaro-104
  40. libip4tc - 1.4.10-4
  41. libnl-tiny - 0.1-2
  42. libuci - 2012-02-24.1-1
  43. libxtables - 1.4.10-4
  44. mtd - 17
  45. opkg - 618-2
  46. ppp - 2.4.5-4
  47. ppp-mod-pppoe - 2.4.5-4
  48. swconfig - 10
  49. uboot-envtools - 2011.06-4
  50. uci - 2012-02-24.1-1
  51. wireless-tools - 29-4
  52. wpad-mini - 20111103-3
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2012-3-24 23:08 | 显示全部楼层
yoyicue 发表于 2012-3-24 22:52
我也是 ver 1.5 难道有依赖 要不麻烦您提供下固件? 我试试?

不用我提供,我就在官网下的
http://downloads.openwrt.org/snapshots/trunk/ar71xx/
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2012-3-25 14:21 | 显示全部楼层
weereew 发表于 2012-3-24 23:08
不用我提供,我就在官网下的
http://downloads.openwrt.org/snapshots/trunk/ar71xx/

我也是用的官网的 trunk 呀
下载后唯一做的就是安装 ip 和 macvlan
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-20 04:37

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表