将openwrt移植到belkin F5D8235V2

来源:互联网 发布:java wait join区别 编辑:程序博客网 时间:2024/05/27 20:51

说明:早些时候写的笔记了,自己存在硬盘里也没用。转载请注明出处,网页排版不好懒得整理了,图片都不见了上传了无加密pdf,大家到资源里下载就行了。


将Uboot将Uboot和和openwrt移植到belkin F5D8235V2

目             录

目录

将openwrt移植到belkin F5D8235V2.1

实验环境...1

移植Uboot到F5D8235V2.1

特别注意...1

配置编译Uboot2

烧录uboot到F5D8235V2.2

配置openwrt编译环境...4

安装软件包...4

解决non-root问题...4

准备代码和packet5

Make menuconfig编译配置...8

路由器配置...9

GE网络配置...9

启动WIFI10

Samba配置完整方法...11

FTP的设置...13

挂接usb.13

Transmission的配置方法...13

修改dns.14

配置LED.14

其他资源...15

各种ipk包...15

移植的摸索过程...16

官方源码编译错误...16

调试启动GE.16

调试switch的命令:...19

iwinfo错误...20

 

 

 

实验环境

u  Vmware 8.0

u  Fedora14,4核,已安装vmtools,  FC6

u  belkin F5D8235V2

u  openwrt版本r29935,svn://svn.openwrt.org/openwrt/trunk

u  http://en-us-support.belkin.com/app/product/detail/p/336

 

 

目前(2012年1月30日)正式release出的版本没有能够支持ralinkrt3052f芯片的。该款芯片为soc,集成了mips cpu,11n wifi,100M FE switch,usb2.0。F5D8235V2在板子上外接了一个rtl8366rb千兆以太网交换芯片,以支持GE LAN.

 

本实验使用的F5D8235V2已经做了增强改动。Flash为8M nor flash,ram增加到64M。其他和标准F5D8235V2一致。

 

F5D8235V2的串口问题(特别注意):

这个设备比较奇怪,串口线接错了,能有正确的输出。但是不能正确的输入。输入有显示,实际上没有成功。从指示灯这边起,地-发-收-vcc,网口那边第一针,也就是vcc没有焊接。

 

移植Uboot到F5D8235V2

         针对F5D8235V2最好的uboot版本就是官方下载的。另外也有wive项目的wive-rtnl-ralink-rt305x-routers-firmware-wive-rtnl-ralink-rt305x-routers-firmware-master.tar.gz。这个版本更针对于一般的ralink芯片,选项也更多。

特别注意

         必须使用FC6,否则编译不过。

配置编译Uboot

         在官方网站http://en-us-support.belkin.com/app/product/detail/p/336,

下载的F5D8235v2-2.01.07-GPL.tar.gz。可以在windows下解压下,最后把解压出来的文件再次放到linux解压下做也可以。不然就会报错。

 

下面有uboot

Belkin_F5D8235-4_v2000_v2.01.07/Uboot_SDK_3200。

 

用root登录之后,进入之后输入makemenuconfig就可以了。编译非常简单。如下的配置就能正确启动设备

 

         保存配置,执行

make clean

make

就可以在/Uboot_SDK_3200目录下得到uboot.bin。

烧录uboot到F5D8235V2

 

         接上ttl串口线和网线,在看到打印时按9,设置好服务器地址和单板地址,就可以烧写uboot。注意下载使用了tftp协议,所以服务器上必须启动tftp服务,并且把编译好的uboot.bin放到tftp的根目录。

原始启动全信息:

 

U-Boot 1.1.3 (Nov  7 2008 - 00:24:27)

 

Board: Ralink APSoC DRAM:  32 MB

relocate_code Pointer at: 81fa0000

=====config_usbotg =====

flash_protect ON: from 0xBF000000 to0xBF02F0F7

protect on 0

protect on 1

protect on 2

protect on 3

protect on 4

protect on 5

protect on 6

protect on 7

protect on 8

protect on 9

flash_protect ON: from 0xBF030000 to0xBF03FFFF

protect on 10

============================================

Ralink UBoot Version: 3.2

--------------------------------------------

ASIC 3052_MP2 (Port5<->GigaSW)

DRAM COMPONENT: 128Mbits

DRAM BUS: 32BIT

Total memory: 32 MBytes

Date:Nov 7 2008  Time:00:24:27

============================================

icache: sets:256, ways:4, linesz:32,total:32768

dcache: sets:128, ways:4, linesz:32,total:16384

 

 ##### The CPU freq = 384 MHZ ####

 

 SDRAM bus set to 32 bit

 SDRAM size =32 Mbytes

 

Please choose the operation:

   1:Load system code to SDRAM via TFTP.

   2:Load system code then write to Flash via TFTP.

   3:Boot system code via Flash (default).

   4:Entr boot command line interface.

   9:Load Boot Loader code then write to Flash via TFTP.

 

You choosed 9

 

配置openwrt编译环境

         成功稳定实验的版本是r29935,信息如下:

 

 

 

BusyBox v1.19.3 (2012-01-2822:12:18 CST) built-in shell (ash)

Enter 'help' for a list ofbuilt-in commands.

 

  _______                     ________        __

 |      |.-----.-----.-----.|  |  | |.----.|  |_

 |  -   ||  _ |  -__|     || |  |  ||  _||   _|

 |_______||  __|_____|__|__||________||__| |____|

          |__| W I R E L E S S   F R E E D O M

 ATTITUDE ADJUSTMENT (bleeding edge, r29935)----------

  * 1/4 oz Vodka      Pour all ingredients into mixing

  * 1/4 oz Gin        tin with ice, strain into glass.

  * 1/4 oz Amaretto

  * 1/4 oz Triple sec

  * 1/4 oz Peach schnapps

  * 1/4 oz Sour mix

  * 1 splash Cranberry juice

 -----------------------------------------------------

 

该版本能够支持完整支持wifi,所以选定这个版本。配置值需要选择基本的配置,ntfs-3g之类基本上不要选择,容易导致崩溃。

安装软件包

http://wiki.openwrt.org/doc/howto/buildroot.exigence

 

对于fedora14:

yum install binutils bzip2 gawk gcc gcc-c++ gettextmake ncurses-devel patch unzip wget zlib-devel flex git-core

 

 

解决non-root问题

如果是root用户,需要加上FORCE=1,否则编译不过。但是编译之前最好不加,可以看看除了root,到底哪些特性无法满足。

make defconfig FORCE=1

 

但是make prereq FORCE=1还是无法执行,错误如下:

 

Checking 'non-root'... fail.

Build dependency: Please do notcompile as root.

Prerequisite check failed. UseFORCE=1 to override.

 

查找到底是那个检查需要non-root。使用命令grep non-root  ./ -r

得到如下信息

./include/prereq-build.mk:defineRequire/non-root

./include/prereq-build.mk:$(eval$(call Require,non-root, \

 

在trunk/include/prereq-build.mk找到如下语句:

 

 

define Require/non-root

         [ "$$(shell whoami)" != "root" ]

endef

#$(eval$(call Require,non-root, \

#       Please do not compile as root. \

#))

 

直接把红色的3行注释就可以解决问题了。

 

准备代码和packet

升级代码

svn update

 

如果以前改过代码,又不想重新下载,应该使用

svn revert –R ./

这样就会升级并且把修改过的取消。

利用svn diff可以检查有什么不同。如果升级成功,应该执行svn diff后看不到信息。

 

升级packet

./scripts/feeds update –a

./scripts/feeds install –a

 

或者'install <PACKAGENAME>'

 

以太网问题

 

https://forum.openwrt.org/viewtopic.php?id=21998&p=2

https://dev.openwrt.org/ticket/9071

 

发现需要一个特别的补丁.

target/linux/ramips/files/drivers/net/ramips_esw.c

对其他设备有问题,但是对于这个设备刚好,打上再说.另外特别注意,新版本的openwrt有

find . -name ramips_esw.c

./build_dir/linux-ramips_rt305x/linux-3.2.9/drivers/net/ramips_esw.c

./build_dir/linux-ramips_rt305x/linux-3.2.9/drivers/net/ethernet/ramips/ramips_esw.c

./target/linux/ramips/files/drivers/net/ramips_esw.c

./target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c

 

修改如下,以下为diff

---target/linux/ramips/files/drivers/net/ramips_esw.c       (revision 29935)

+++target/linux/ramips/files/drivers/net/ramips_esw.c    (working copy)

@@ -264,7 +264,19 @@

        rt305x_mii_write(esw,0, 14, 0x65);

        /*select local register */

        rt305x_mii_write(esw,0, 31, 0x8000);

+//#ifdefCONFIG_RT305X_MACH_F5D8235_V2

+#if 1

+/* enable external switch,1Gbps, full duplex, vlan support */

+rt305x_esw_wr(esw,rt305x_esw_rr(esw, 0xc8) & ~(1 << 29), 0xc8);

+rt305x_esw_wr(esw,rt305x_esw_rr(esw, 0xc8) | 0x3fff, 0xc8);

+rt305x_esw_wr(esw,rt305x_esw_rr(esw, 0xc8) & ~(0xf << 20), 0xc8);

+rt305x_esw_wr(esw, 0x00605555,0x14);

+rt305x_esw_wr(esw, 0x00007f7f,0x98);

+rt305x_esw_wr(esw, 0x00000060,0xe4);

+return;

+       #endif

 

+

        for(i = 0; i < RT305X_ESW_NUM_VLANS; i++) {

                rt305x_esw_set_vlan_id(esw,i, 0);

                rt305x_esw_set_vmsc(esw,i, 0);

 

只生成需要的firmware,防止因为firmware过大出错

 

 

---target/linux/ramips/image/Makefile       (revision29935)

+++ target/linux/ramips/image/Makefile     (working copy)

@@ -307,27 +307,9 @@

 

 ifeq ($(CONFIG_RALINK_RT305X),y)

 define Image/Build/Profile/Default

-       $(call Image/Build/Profile/ARGUS_ATP52B,$(1))

-       $(call Image/Build/Profile/BC2,$(1))

-       $(call Image/Build/Profile/ALL0256N,$(1))

-       $(call Image/Build/Profile/DIR300B1,$(1))

-       $(call Image/Build/Profile/ESR9753,$(1))

-       $(call Image/Build/Profile/RTG32B1,$(1))

-       $(call Image/Build/Profile/FONERA20N,$(1))

-       $(call Image/Build/Profile/V22RW2X2,$(1))

-       $(call Image/Build/Profile/NBG419N,$(1))

-       $(call Image/Build/Profile/NW718,$(1))

-       $(call Image/Build/Profile/OMNIEMB,$(1))

-       $(call Image/Build/Profile/PWH2004,$(1))

-       $(call Image/Build/Profile/WHRG300N,$(1))

-       $(call Image/Build/Profile/WCR150GN,$(1))

+

        $(callImage/Build/Profile/F5D8235V2,$(1))

-       $(call Image/Build/Profile/HW5503G,$(1))

-       $(call Image/Build/Profile/MOFI35003GN,$(1))

-       $(call Image/Build/Profile/W502U,$(1))

-       $(call Image/Build/Profile/WR5123GN,$(1))

-       $(call Image/Build/Profile/WL341V3,$(1))

-       $(call Image/Build/Profile/WL351,$(1))

+

 endef

 endif

Make menuconfig编译配置

配置的目标

1.     中文web界面

2.     Usb支持

3.     Bt支持

4.     Qos支持

5.     Samba支持

6.     vsftpd

 

 

基本配置的步骤

执行

make defconfig

make menuconfig

 

在配置界面里:

u  选择cpu为TargetSystem (Ralink RT288x/RT305x),单板类型为Subtarget (RT305x based boards)

u  选择samba3的支持,qos,luci,transmission,transmissionweb,ntfs,fdisk, swconfig

u  各种语言的支持,主要是中文的各种编码,英语的编码

 

USB支持

使用makekernel_menuconfig加入ext2,3,vfat,NTFS的支持。在make menucofig里找不到ext2,ext3的选项, 只有编译了ext2,3的选项,才能正确mount脱机下载盘。

 

根据以下信息加入相应的配置

 

kmod-usb-core

kmod-usb-ohci          #安装usb ohci控制器驱动

kmod-usb-uhci      #UHCI USB控制器

kmod-usb2                #安装usb2.0

kmod-usb-storage     #安装usb存储设备驱动

kmod-fs-ext3              #安装ext3分区格式支持组件

mount-utils                #挂载卸载工具

kmod-fs-vfat              #挂载FAT

block-mount

fdisk   

mountd..........................................OpenWrt automount daemon有了这个可以制动挂载

usbutils #安装了这个后可以用 lsusb

 

 

 

路由器配置

         首先配置以太网,然后启动samba,对后续的操作要提高不少效率。

 

GE网络配置

 

用串口线连上路由器,输入vi /etc/config/network

 

config 'interface' 'loopback'

       option 'ifname' 'lo'

       option 'proto' 'static'

       option 'ipaddr' '127.0.0.1'

       option 'netmask' '255.0.0.0'

 

config 'interface' 'lan'

       option 'ifname' 'eth0.1'

       option 'type' 'bridge'

       option 'proto' 'static'

       option 'ipaddr' '10.0.0.6'

       option 'netmask' '255.255.255.0'

option 'macaddr' '00:AA:BB:CC:00:66'

 

 

config 'interface' 'wan'

       option 'ifname' 'eth0.2'

       option 'proto' 'static'

       option 'ipaddr' '192.168.1.2'

       option 'netmask' '255.255.255.0'

       option 'gateway' '192.168.1.1'

       option 'dns' '202.106.46.151'

option 'macaddr' '00:AA:BB:CC:DD:23'

 

config 'switch'

       option 'name' 'rtl8366rb'

       option 'reset' '1'

        option 'enable_vlan' '1'

 

config 'switch_vlan'

       option 'device' 'rtl8366rb'

       option 'vlan' '1'

       option 'ports' '1 2 3 4 5t'

 

config 'switch_vlan'

       option 'device' 'rtl8366rb'

       option 'vlan' '2'

       option 'ports' '0 5t'

 

使网络配置生效,以太和wifi都可以。

/etc/init.d/network restart

 

启动WIFI

Openwrt默认是不启动wifi的,如果想要启动可以通过网页,也可以通过修改/etc/config/wireless. 将option disabled 1注释掉,重启就可以发现wifi了。

 

config wifi-device  radio0

       option type     mac80211

       option channel  11

       option macaddr  00:22:75:9e:fc:a0

       option hwmode   11ng

       option htmode   HT20

       list ht_capab   GF

       list ht_capab   SHORT-GI-20

       list ht_capab   SHORT-GI-40

       list ht_capab   TX-STBC

       list ht_capab   RX-STBC12

        # REMOVE THIS LINE TO ENABLE WIFI:

        #option disabled 1

 

config wifi-iface

       option device   radio0

       option network  lan

       option mode     ap

       option ssid     OpenWrt

       option encryption none

 

功率调整:

发射功率必须调整到20dbm,否则隔壁的房间没有信号。

 

Hostapd的启动:

利用网页启动wifi,就会发现可以扫描到AP,但是连接不上。用ps查看hostapd线程。之所以查看hostapd,因为在openwrt上,AP的功能是通过hostapd实现的。结果如下:

hostapd -P /var/run/wifi-phy0.pid -B/var/run/hostap

 

查看/var/run下的文件:

 

ls

collectd                 firewall-interface.lock  syslogd.pid

collectd.pid             hostapd-phy0             sysntpd.pid

dhcp-eth0.2.pid          hostapd-phy0.conf        uhttpd_main.pid

dnsmasq.pid              luci-reload              vsftpd

dropbear.1.pid           smbd.pid                 wifi-phy0.pid

 

 

 

手工输入一下命令,加入-dd容易定位问题

killall hostapd

hostapd -P /var/run/wifi-phy0.pid -B/var/run/hostapd-phy0.conf -dd

 

 

在手工杀掉hostpad,然后再输入hostapd -P /var/run/wifi-phy0.pid -B /var/run/hostapd-phy0.conf -dd重新启动hostapd,运行就正常了。

 

其他的配置都是默认的

 

加密选wps-psk,cipher选择auto

 

Samba配置完整方法

1.     启动openwrt之后,进入luci界面

在服务->网络共享->编辑模板页面可以看到samba的配置。

先编辑模板,正确的模板如下:

[global]

         netbios name = |NAME|

         workgroup = |WORKGROUP|

         server string = |DESCRIPTION|

         syslog = 10

         encrypt passwords = yes

         passdb backend = smbpasswd

         obey pam restrictions = yes

         socket options = TCP_NODELAY

         unix charset = |CHARSET|

         preferred master = yes

         os level = 20

         security = user

         guest account = nobody

         #invalid users = root

         smb passwd file = /etc/samba/smbpasswd

         interfaces = |INTERFACES|

 

         修改了红色的三行:

         encrypt passwords = yes

         security = user

         #invalid users = root

 

2.     配置samba基本配置。

在服务->网络共享->基本设置页面可以填写如下:

主机名随意,工作组和PC一样即可。共享主目录默认为1.

点击下面的添加按钮可以加入不同的目录共享,设置允许用户和权限。点击“保存&应用”可以及时生效。通常硬盘挂在/mnt目录,通过这个方法可以访问挂接的硬盘。而配置通常在/etc目录。有了这个就可以方面的保存配置文件到本地。

 

3.     用户名设置

在openwrt上输入smbpasswd root linuxroot。这样在登录的时候,用户名为root,linuxroot为密码。

FTP的设置

 

将vsftpd编译进去,在命令行执行vsftpd就可以了。

 

利用系统root账户登录,进入的是/root,点击上级目录,就可以访问其他的目录了。

 

挂接usb

可以查看usb的连接信息

fdisk -l

Disk /dev/sda: 8019 MB, 8019509248 bytes

93 heads, 16 sectors/track, 10526 cylinders

Units = cylinders of 1488 * 512 = 761856bytes

Disk identifier: 0xc3072e18

 

  Device Boot      Start         End      Blocks  Id  System

/dev/sda1               1         689      512608  83  Linux

/dev/sda2             690       10526    7318728   83  Linux

 

如果编译包含了mountd,就会被自动加载到/tmp/run/mountd/sda1和 /tmp/run/mountd/sda2。并且能够根据需求动态的加载卸载。

 

Transmission的配置方法

输入:transmission-daemon,启动一下transmission-daemon;输入:killall transmission-daemon,关闭transmission-daemon.只有启动一次transmission-daemon之后才能正常的生成。/root/.config/transmission-daemon/下的文件。

另外注意,可以通过samba,用ultraedit修改settings.json文件。不要转换为dos格式。但是一定要先关闭transmission-daemon,否则无效。修改的方法如下:

改"rpc-whitelist":"127.0.0.1", 为 "0.0.0.0"。重新启动transmission-daemon,测试9091端口。如果还是出现下面的提示:

 

403: Forbidden
Unauthorized IP Address.

Either disable the IP address whitelist or add your address to it.

If you're editing settings.json, see the 'rpc-whitelist' and'rpc-whitelist-enabled' entries.

If you're still using ACLs, use a whitelist instead. See thetransmission-daemon manpage for details.

 

那么先killall transmission-daemon,然后改"rpc-whitelist-enabled":ture为false, 再启动transmission-daemon就可以使用了。

 

 

下载目录设置。

如果编译了mountd,硬盘自动加载,修改下载目录

   "download-dir": "/tmp/run/mountd/sda2",

   "incomplete-dir": "/tmp/run/mountd/sda2",

 

 

 

修改dns

root@OpenWrt:~# vi /tmp/resolv.conf

resolv.conf       resolv.conf.auto

root@OpenWrt:~# vi /tmp/resolv.conf.auto

 

将dns改为202.106.46.151

 

 

配置LED

 

默认LED是没有全部打开的,需要在一下页面进行配置。

比如上面配置了usb和WAN。点击“保存并应用”之后,就可以看到LED点亮。

 

具体的定义可以参照官方的代码.

 

 

其他资源

各种ipk包

http://downloads.openwrt.org/snapshots/trunk/ramips/packages/

 

 

移植的摸索过程

 

官方源码编译错误

 

make时出现mixed implicit andnormal rules.stop (2011-08-05 17:42). 出现这个错误的原因是你的linux的make软件的版本过高,而你的环境里需要make版本低

调试启动GE

# swconfig dev switch0 help

switch0: rtl8366rb(RTL8366RB), ports: 6(cpu @ 5), vlans: 4096

    --switch

       Attribute 1 (int): enable_learning (Enable learning, enable aging)

       Attribute 2 (int): enable_vlan (Enable VLAN mode)

       Attribute 3 (int): enable_vlan4k (Enable VLAN 4K mode)

       Attribute 4 (none): reset_mibs (Reset all MIB counters)

       Attribute 5 (int): blinkrate (Get/Set LED blinking rate (0 = 43ms, 1 =84ms, 2 = 120ms, 3 = 170ms, 4 = 340ms, 5 = 670ms))

       Attribute 6 (int): enable_qos (Enable QOS)

       Attribute 7 (none): apply (Activate changes in the hardware)

       Attribute 8 (none): reset (Reset the switch)

    --vlan

       Attribute 1 (string): info (Get vlan information)

       Attribute 2 (int): fid (Get/Set vlan FID)

       Attribute 3 (ports): ports (VLAN port mapping)

    --port

       Attribute 1 (string): link (Get port link information)

       Attribute 2 (none): reset_mib (Reset single port MIB counters)

       Attribute 3 (string): mib (Get MIB counters for port)

       Attribute 4 (int): led (Get/Set port group (0 - 3) led mode (0 - 15))

       Attribute 5 (int): disable (Get/Set port state (enabled or disabled))

       Attribute 6 (int): rate_in (Get/Set port ingress (incoming) bandwidthlimit in kbps)

       Attribute 7 (int): rate_out (Get/Set port egress (outgoing) bandwidthlimit in kbps)

       Attribute 8 (int): pvid (Primary VLAN ID)

 

 

# swconfig dev switch0 show

Global attributes:

       enable_learning: 1

       enable_vlan: 1

       enable_vlan4k: 0

       blinkrate: 0

       enable_qos: 1

Port 0:

       link: port:0 link:up speed:10baseT half-duplex tx-pause rx-pause

       mib: Port 0 MIB counters

IfInOctets                          : 4123662

EtherStatsOctets                    : 4123662

EtherStatsUnderSizePkts             : 0

EtherFragments                      : 0

EtherStatsPkts64Octets              : 5818

EtherStatsPkts65to127Octets         : 2554

EtherStatsPkts128to255Octets        : 1507

EtherStatsPkts256to511Octets        : 1609

EtherStatsPkts512to1023Octets       : 104

EtherStatsPkts1024to1518Octets      : 1864

EtherOversizeStats                  : 0

EtherStatsJabbers                   : 0

IfInUcastPkts                       : 11902

EtherStatsMulticastPkts             : 1547

EtherStatsBroadcastPkts             : 7

EtherStatsDropEvents                : 0

Dot3StatsFCSErrors                  : 0

Dot3StatsSymbolErrors               : 0

Dot3InPauseFrames                   : 0

Dot3ControlInUnknownOpcodes         : 0

IfOutOctets                         : 0

Dot3StatsSingleCollisionFrames      : 0

Dot3StatMultipleCollisionFrames     : 0

Dot3sDeferredTransmissions          : 0

Dot3StatsLateCollisions             : 0

EtherStatsCollisions                : 0

Dot3StatsExcessiveCollisions        : 0

Dot3OutPauseFrames                  : 0

Dot1dBasePortDelayExceededDiscards  : 0

Dot1dTpPortInDiscards               : 11900

IfOutUcastPkts                      : 0

IfOutMulticastPkts                  : 0

IfOutBroadcastPkts                  : 0

 

Port 5:

       link: port:5 link:up speed:1000baseT full-duplex tx-pause rx-pause nway

       mib: Port 5 MIB counters

IfInOctets                          : 0

EtherStatsOctets                    : 0

EtherStatsUnderSizePkts             : 0

EtherFragments                      : 0

EtherStatsPkts64Octets              : 0

EtherStatsPkts65to127Octets         : 0

EtherStatsPkts128to255Octets        : 0

EtherStatsPkts256to511Octets        : 0

EtherStatsPkts512to1023Octets       : 0

EtherStatsPkts1024to1518Octets      : 0

EtherOversizeStats                  : 0

EtherStatsJabbers                   : 0

IfInUcastPkts                       : 0

EtherStatsMulticastPkts             : 0

EtherStatsBroadcastPkts             : 0

EtherStatsDropEvents                : 0

Dot3StatsFCSErrors                  : 0

Dot3StatsSymbolErrors               : 0

Dot3InPauseFrames                   : 0

Dot3ControlInUnknownOpcodes         : 0

IfOutOctets                         : 300036

Dot3StatsSingleCollisionFrames      : 0

Dot3StatMultipleCollisionFrames     : 0

Dot3sDeferredTransmissions          : 0

Dot3StatsLateCollisions             : 0

EtherStatsCollisions                : 0

Dot3StatsExcessiveCollisions        : 0

Dot3OutPauseFrames                  : 0

Dot1dBasePortDelayExceededDiscards  : 0

Dot1dTpPortInDiscards               : 0

IfOutUcastPkts                      : 2

IfOutMulticastPkts                  : 1547

IfOutBroadcastPkts                  : 7

 

       led: ???

       disable: 0

       rate_in: 1048512

       rate_out: 1048512

       pvid: 1

VLAN 1:

       info: VLAN 1: Ports: '05', members=0021, untag=0021, fid=0

       fid: 0

       ports: 0 5

VLAN 2:

       info: VLAN 2: Ports: '15', members=0022, untag=0022, fid=0

       fid: 0

       ports: 1 5

VLAN 3:

       info: VLAN 3: Ports: '25', members=0024, untag=0024, fid=0

       fid: 0

       ports: 2 5

VLAN 4:

       info: VLAN 4: Ports: '35', members=0028, untag=0028, fid=0

       fid: 0

       ports: 3 5

VLAN 5:

       info: VLAN 5: Ports: '45', members=0030, untag=0030, fid=0

       fid: 0

       ports: 4 5

VLAN 6:

       info: VLAN 6: Ports: '012345', members=003f, untag=003f, fid=0

       fid: 0

       ports: 0 1 2 3 4 5

 

说明wan和cpu之间的连接已经通了。下一步就是如何判断方向了。

 

调试switch的命令:

root@OpenWrt:/# swconfig dev switch0 port 0get link

port:0 link:up speed:10baseT half-duplex tx-pauserx-pause

root@OpenWrt:/# swconfig dev switch0 port 5get link

port:5 link:up speed:1000baseT full-duplextx-pause rx-pause nway

 

 

swconfig dev switch0 show

swconfig dev switch0 port 0 get mib

swconfig dev switch0 port 5 get mib

 

swconfig dev switch0 port 5 set reset_mib

swconfig dev switch0 port 0 set reset_mib

 

ifconfig eth0.2 down

ifconfig eth0.2 hw ether 00:AA:BB:CC:DD:EE

ifconfig eth0.2 10.0.0.6

 

 

ifconfig br-lan 192.168.1.1

 

arp -s 10.0.0.96 1C:6F:65:4C:96:D6

ping 10.0.0.96 -c 10 -s 1200

 

iwinfo错误

iwinfo_cli.c:(.text+0x10f8): undefinedreference to `IWINFO_OPMODE_NAMES'

iwinfo_cli.o: In function `main':

iwinfo_cli.c:(.text.startup+0x1e8):undefined reference to `IWINFO_OPMODE_NAMES'

 

 

解决方法

make package/iwinfo/clean


原创粉丝点击