So-net無料ブログ作成
検索選択
OpenWRT/DD-WRT ブログトップ
前の3件 | -

IODATA WN-G300DGR OpenWrt #6 WANポートが有効に [OpenWRT/DD-WRT]

フォーラムに解決方法があったので,WN-G300DGR の OpenWrt を再設定した。
https://forum.openwrt.org/viewtopic.php?pid=192105#p192105

起動して luci で確認すると,WAN/LAN ポートが正しくアサインされており,問題はほぼ解決した。 (WAN/LAN,APのある無線LANルータの基本形になった)
OpenWrt - Interfaces - LuCI

WN-G300DGR は,rt305x 組み込みのスイッチと,RTL8366RB スイッチの 2 つのスイッチを持っている。
OpenWrt - Switch - LuCI-2
rt305xスイッチ の#6がCPUとリンクしている内部ポートで,rt305xスイッチの#5がRTL8366RB の#5とリンクしている。 RTL8366RBのポートが実際の接続用ポートだ。
vlan1 がLAN,vlan2 がWANで,#5,#6はトランクポートになっている。
実際のポートは #0,#1,#2 がLAN,#3がWANになる。(WN-G300DGR は0123の4ポート)
(RTL8366RB の カーネルモジュールを組み込んでおく。)
image
以上を設定に反映するため,/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 '192.168.1.1'
option netmask '255.255.255.0'
option macaddr '00:a0:b0:b4:ca:74'

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
option macaddr '00:a0:b0:b4:ca:75'

config switch
option name 'switch1'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch1'
option vlan '1'
option ports '0 1 2 5t'

config switch_vlan
option device 'switch1'
option vlan '2'
option ports '3 5t'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '5t 6t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5t 6t'




これで動いたので,ソースも書き換えた。 

~/trunk/target/linux/ramips/base-files/etc/uci-defaults/02_network


wl-351)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch1" "1" "1"
ucidef_add_switch_vlan "switch1" "1" "0 1 2 5t"
ucidef_add_switch_vlan "switch1" "2" "3 5t"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "5t 6t"
ucidef_add_switch_vlan "switch0" "2" "5t 6t"
;;

 





5t,6t などtが付く数字は tagged ポートの番号だ。 


sitecom WL-351 用のOpenWrtファームウェアを使っているので,ボード名に WL-351 が表示される。 
ボード名が WN-G300DGR になるよう OpenWrt のソースを変更追加している。 



IODATA WN-G300DGR OpenWrt #5 一旦終了 [OpenWRT/DD-WRT]

WN-G300DGR の OpenWrt ファームウェアは Sitecom WL-351 のプロファイルでビルドされたものを使ったが,やはり難しかった。
#1 でシリアル接続方法が分かり,#2で tftpブートでOpenWrtの起動ができた。
さらに#3で,ファームウェア更新ができ,#4でLANを有効にする操作が分かった。
結局,問題は残ったが,ビルドは一旦終わりにした。
無線LANやLANは使用できるが,スイッチの全4ポートがLANとなる。WANポートはアサインできなかった。

wng300dgr

スイッチのポートVLANで,WAN/LANポートを分けるみたいだが,どうやって設定しているのか分からなかった。

ソースは以下を少し変更した。意味は分かっていない。
~/trunk/target/linux/ramips/base-files/etc/uci-defaults/02_network

rt-n15 | \
wl-351)
        # ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
        # ucidef_add_switch "switch0" "1" "1"
        # ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
        # ucidef_add_switch_vlan "switch0" "2" "4 6t"
        ucidef_add_switch "switch0" "1" "0"
        ucidef_set_interface_lan "eth0"

        ;;

swconfig コマンドの結果
WN-G300DGRは4ポートしかないのに7ポート分ある。これも意味が分からない。
なお,WN-G300DGRは RTL8366RB というギガビットスイッチモジュールを使っている。

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
enable_vlan: 1
alternate_vlan_disable: 0
Port 0:
disable: 0
doubletag: 0
untag: 0
led: 5
lan: 1
recv_bad: 0
recv_good: 0
pvid: 0
link: port:0 link:down
Port 1:
disable: 0
doubletag: 0
untag: 0
led: 5
lan: 1
recv_bad: 0
recv_good: 0
pvid: 0
link: port:1 link:down
Port 2:
disable: 0
doubletag: 0
untag: 0
led: 5
lan: 1
recv_bad: 0
recv_good: 0
pvid: 0
link: port:2 link:down
Port 3:
disable: 0
doubletag: 0
untag: 0
led: 5
lan: 1
recv_bad: 0
recv_good: 0
pvid: 0
link: port:3 link:down
Port 4:
disable: 0
doubletag: 0
untag: 0
led: 5
lan: 1
recv_bad: 0
recv_good: 0
pvid: 0
link: port:4 link:down
Port 5:
disable: 0
doubletag: 0
untag: 0
led: ???
lan: 1
recv_bad: 0
recv_good: 18
pvid: 0
link: port:5 link:up speed:1000baseT full-duplex
Port 6:
disable: 0
doubletag: 0
untag: 0
led: ???
lan: ???
recv_bad: ???
recv_good: ???
pvid: 0
link: port:6 link:up speed:1000baseT full-duplex





OpenWrt でのスイッチ設定やポートVLANについて,ご存知の方,お教えください。

WANポートをアサインできないので,LANルータとしては使えないが,無線もLANも有効だ。

WN-G300DGRには,USBポートがあるので,カメラやUSBストレージなどを試してみたい。



IODATA WN-G300DGR OpenWrt #3 イーサネットNG [OpenWRT/DD-WRT]

WN-G300DGR での OpenWrt ファームウェアのフラッシュ書き込みは,シリアル接続で 2 を入力して,
2: System Load Linux Kernel then write to Flash via TFTP.
で行うことができた。
以下のとおり 1 の選択しか表示されないが,2 の入力も可能だった。また,入力 4 でコマンドプロンプトも可能だった。
Please choose the operation:
   1: Load system code to SDRAM via TFTP.

OpenWrt ファームウェアは,DGRと構成がそっくりな Sitecom WL-351 用を利用した。
openwrt-ramips-rt305x-wl-351-squashfs-sysupgrade.bin

U-boot Ver:1.0.5.17 2010/06/10


Board: Ralink APSoC DRAM: 32 MB 2*16 MB
============================================
ASIC 3052_MP2 (Port5<->GigaSW)
Product Name: WN-G300DGR
SDRAM CAS = 3(d1835272)
============================================

Please choose the operation:
1: Load system code to SDRAM via TFTP.
UbootDate[2010/06/10]UbootDate
UbootVer[1.0.5]UbootVer

2: System Load Linux Kernel then write to Flash via TFTP.
Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N)
Please Input new ones /or Ctrl-C to discard
Input device IP (192.168.99.9) ==:

Input server IP (192.168.99.8) ==:

Input Linux Kernel filename (uImageWN-G300DGR) ==:firmware.bin
Using Eth0 device
TFTP from server 192.168.99.8; our IP address is 192.168.99.9
Filename 'firmware.bin'.
Loading: *
ArpTimeoutCheck
TftpTimeoutCount=0,max_retry:10
T
ArpTimeoutCheck
TftpTimeoutCount=1,max_retry:10
T
ArpTimeoutCheck
TftpTimeoutCount=2,max_retry:10
T
ArpTimeoutCheck
TftpTimeoutCount=3,max_retry:10
T Got ARP REPLY, set server/gtwy eth addr (b8:88:e3:54:7c:a6)
Got it
TftpTimeoutCount=4,max_retry:10
T #
first block received
################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##################Got ARP REQUEST, return our IP
###############################################
#################################################################
####
done
Bytes transferred = 3014660 (2e0004 hex)
Erase linux kernel block !!
From 0xBF050000 To 0xBF33FFFF










エラーもなく起動するが,イーサネットが使えず,シリアルからの操作しかできない。  

起動シーケンスは以下のとおり。 


Boot from KERNEL 1  !!
[ 0.000000] Linux version 3.7.5 (atc500@bt) (gcc version 4.6.4 20121210 (prerele3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[ 0.000000] Ralink RT3052 id:1 rev:3 running at 384.00 MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages:8
[ 0.000000] Kernel command line: board=WL-351 console=ttyS1,57600 mtdparts=phys2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] __ex_table already sorted, skipping sort
[ 0.000000] Writing ErrCtl register=0003a250
[ 0.000000] Readback ErrCtl register=0003a250
[ 0.000000] Memory: 29632k/32768k available (1969k kernel code, 3136k reserved, )
[ 0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes1
[ 0.000000] NR_IRQS:48
[ 0.000000] console [ttyS1] enabled, bootconsole disabled
[ 0.000000] console [ttyS1] enabled, bootconsole disabled
[ 0.010000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[ 0.090000] pid_max: default: 32768 minimum: 301
[ 0.100000] Mount-cache hash table entries: 512
[ 0.110000] NET: Registered protocol family 16
[ 0.120000] MIPS: machine is Sitecom WL-351 v1 002
[ 0.140000] bio: create slab <bio-0> at 0
[ 0.150000] Switching to clocksource MIPS
[ 0.160000] NET: Registered protocol family 2
[ 0.170000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.180000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.200000] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.210000] TCP: reno registered
[ 0.220000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.230000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.240000] NET: Registered protocol family 1
[ 0.280000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.290000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) .
[ 0.310000] msgmni has been set to 57
[ 0.320000] io scheduler noop registered
[ 0.330000] io scheduler deadline registered (default)
[ 0.340000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 0.350000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[ 0.370000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[ 0.380000] physmap platform flash device: 00800000 at bf000000
[ 0.390000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufact7
[ 0.420000] Amd/Fujitsu Extended Query Table at 0x0040
[ 0.430000] Amd/Fujitsu Extended Query version 1.1.
[ 0.440000] physmap-flash.0: Swapping erase regions for top-boot CFI table.
[ 0.450000] number of CFI chips: 1
[ 0.460000] 6 cmdlinepart partitions found on MTD device physmap-flash.0
[ 0.470000] Creating 6 MTD partitions on "physmap-flash.0":
[ 0.480000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.490000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.510000] 0x000000040000-0x000000050000 : "factory"
[ 0.520000] 0x000000050000-0x000000130000 : "kernel"
[ 0.530000] 0x000000130000-0x000000400000 : "rootfs"
[ 0.550000] mtd: partition "rootfs" set to be root filesystem
[ 0.560000] mtd: partition "rootfs_data" created automatically, ofs=310000, len=
[ 0.570000] 0x000000310000-0x000000400000 : "rootfs_data"
[ 0.590000] 0x000000050000-0x000000400000 : "firmware"
[ 0.610000] ramips-wdt ramips-wdt: timeout value must be 0 < timeout <= 33, usin3
[ 0.630000] TCP: cubic registered
[ 0.630000] NET: Registered protocol family 17
[ 0.640000] 8021q: 802.1Q VLAN Support v1.8
[ 0.660000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[ 0.670000] Freeing unused kernel memory: 180k freed
[ 2.580000] input: gpio-keys-polled as /devices/platform/gpio-keys-polled/input/0
[ 2.690000] Button Hotplug driver version 0.4.1
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
jffs2 not ready yet; using ramdisk
- init -

Please press Enter to activate this console. [ 7.600000] Compat-drivers backport3
[ 7.610000] Backport based on wireless-testing.git master-2013-01-07
[ 7.620000] compat.git: wireless-testing.git
[ 7.660000] cfg80211: Calling CRDA to update world regulatory domain
[ 7.680000] cfg80211: World regulatory domain updated:
[ 7.690000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, )
[ 7.700000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 )
[ 7.720000] cfg80211: (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 )
[ 7.740000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 )
[ 7.750000] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 )
[ 7.770000] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 )
[ 8.260000] usbcore: registered new interface driver usbfs
[ 8.280000] usbcore: registered new interface driver hub
[ 8.290000] usbcore: registered new device driver usb
[ 8.870000] PPP generic driver version 2.4.2
[ 9.040000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 9.280000] NET: Registered protocol family 24
[ 9.310000] nf_conntrack version 0.5.0 (465 buckets, 1860 max)
[ 9.620000] Realtek RTL8366RB ethernet switch driver version 0.2.3
[ 9.640000] rtl8366rb rtl8366rb: using GPIO pins 1 (SDA) and 2 (SCK)
[ 9.650000] rtl8366rb rtl8366rb: RTL5937 ver. 3 chip found
[ 9.730000] libphy: rtl8366rb: probed
[ 9.820000] dwc_otg: version 2.72a 24-JUN-2008
[ 9.830000] dwc_otg: Core Release: 2.66a
[ 10.040000] dwc_otg: Periodic Transfer Interrupt Enhancement - disabled
[ 10.050000] dwc_otg: Multiprocessor Interrupt Enhancement - disabled
[ 10.060000] dwc_otg: Using DMA mode
[ 10.070000] dwc_otg: Device using Buffer DMA mode
[ 10.080000] dwc_otg dwc_otg.0: DWC OTG Controller
[ 10.090000] dwc_otg dwc_otg.0: new USB bus registered, assigned bus number 1
[ 10.100000] dwc_otg dwc_otg.0: irq 26, io mem 0x101c0000
[ 10.120000] dwc_otg: Init: Port Power? op_state=1
[ 10.120000] dwc_otg: Init: Power Port (0)
[ 10.130000] hub 1-0:1.0: USB hub found
[ 10.140000] hub 1-0:1.0: 1 port detected
[ 14.910000] device eth0.1 entered promiscuous mode
[ 14.920000] device eth0 entered promiscuous mode
[ 14.940000] br-lan: port 1(eth0.1) entered forwarding state
[ 14.950000] br-lan: port 1(eth0.1) entered forwarding state
[ 15.850000] ramips-wdt: timeout value 60 must be 0 < timeout <= 33, using 33
[ 16.950000] br-lan: port 1(eth0.1) entered forwarding state
[ 31.480000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 31.510000] jffs2_build_filesystem(): unlocking the mtd device... done.
[ 31.520000] jffs2_build_filesystem(): erasing all blocks after the end marker....
[ 43.210000] jffs2: notice: (1025) jffs2_build_xattr_subsystem: complete building.



BusyBox v1.19.4 (2013-02-02 15:43:46 JST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
BARRIER BREAKER (Bleeding Edge, r35420)
-----------------------------------------------------
* 1/2 oz Galliano Pour all ingredients into
* 4 oz cold Coffee an irish coffee mug filled
* 1 1/2 oz Dark Rum with crushed ice. Stir.
* 2 tsp. Creme de Cacao
-----------------------------------------------------
root@OpenWrt:/#




ifconfig コマンドで確認するとパケットの受信ができていないようだ。  

br-lan    Link encap:Ethernet  HWaddr 00:A0:B0:B4:CA:74  
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:402 (402.0 B)

eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7155 (6.9 KiB)
Interrupt:5

eth0.1 Link encap:Ethernet HWaddr 00:11:22:33:44:55
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:402 (402.0 B)

eth0.2 Link encap:Ethernet HWaddr 00:A0:B0:B4:CA:75
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:6681 (6.5 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:192 errors:0 dropped:0 overruns:0 frame:0
TX packets:192 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13056 (12.7 KiB) TX bytes:13056 (12.7 KiB)




PCから DGR への ping は以下のとおりだった。 


root@bt:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.3 icmp_seq=1 Destination Host Unreachable
From 192.168.1.3 icmp_seq=2 Destination Host Unreachable
From 192.168.1.3 icmp_seq=3 Destination Host Unreachable
From 192.168.1.3 icmp_seq=4 Destination Host Unreachable
From 192.168.1.3 icmp_seq=5 Destination Host Unreachable










同じような問題をフォーラムで見かけたが,イーサネットが使えないとなにもできない。継続調査中である。  
https://forum.openwrt.org/viewtopic.php?id=28986 

https://forum.openwrt.org/viewtopic.php?id=40280  


前の3件 | - OpenWRT/DD-WRT ブログトップ