OpenWrt Forum Archive

Topic: can't get eth0 working on WGT634U, Kamikaze r4471

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi!

I'm playing arround a little bit with my WGt an can't get a working build... I seem to be missing something simple... but i cannot figure out what. fetched the actual buildroot-ng. made menuconfig, and built it. fine. flashed the image, flashed ok. rebooted: boots ok. but i cannot reach it through the LAN-Ports. i seem to be missing a util or so... tried arround a little but cannot figure out whats missing...

as i said: boots fine:

CFE version 1.0.34 for BCM95365R (32bit,SP,LE)
Build Date: Tue Feb 24 03:21:41 CST 2004 (root@jackylinux)
Copyright (C) 2000,2001,2002 Broadcom Corporation.


Add MAC client version(DNI).
Initializing Arena.
Initializing Devices.
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller
CPU type 0x29007: 200MHz
Total memory: 0x2000000 bytes (32MB)

Total memory used by CFE:  0x81BB1280 - 0x82000000 (4517248)
Initialized Data:          0x81BB1280 - 0x81BB3E90 (11280)
BSS Area:                  0x81BB3E90 - 0x81BB45D0 (1856)
Local Heap:                0x81BB45D0 - 0x81FB45D0 (4194304)
Stack Area:                0x81FB45D0 - 0x81FB65D0 (8192)
Text (code) segment:       0x81FB65E0 - 0x81FFFFB0 (301520)
Boot area (physical):      0x01B70000 - 0x01BB0000
Relocation Factor:         I:E23B65E0 - D:01BB0280

configure vlans
*****************************************************************
*********************** VLAN Driver initial  ********************
*****************************************************************
Process LAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add LAN port

Process WAN port(2-5) vlan Architecture...
SUCCESS: trying to create VLAN 0 for switch
SUCCESS: trying to add WAN port
SUCCESS: enable ports  success
configure vlans...done
Device eth0:  hwaddr 00-09-5B-F7-5F-C6, ipaddr 192.168.1.1, mask 255.255.255.0
        gateway not set, nameserver not set
Loader:elf Filesys:raw Dev:flash0.os File: Options:(null)
***************************
****  MAC Client V1.0  ****
***************************
et0macaddr value :flag =0 value=00-09-5b-f7-5f-c6
et1macaddr value :flag =0 value=00-09-5b-f7-5f-c7
MAC exist at least one
system ethernet mac exist and not default....
Skip mac client process.....
Loading: 0x80001000/3732 Entry at 0x80001000
Closing network.
et0: link down
Starting program at 0x80001000
Linux version 2.6.17 (axc27@1400er) (gcc version 3.4.6 (OpenWrt-2.0)) #1 Mon Au6
CPU revision is: 00029007
early_nvram_init: WGT634U NVRAM found.
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
Built 1 zonelists
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/pr0
Primary instruction cache 8kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 4kB, 2-way, linesize 16 bytes.
Synthesized TLB refill handler (19 instructions).
Synthesized TLB load handler fastpath (31 instructions).
Synthesized TLB store handler fastpath (31 instructions).
Synthesized TLB modify handler fastpath (30 instructions).
PID hash table entries: 256 (order: 8, 1024 bytes)
Using 100.000 MHz high precision timer.
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 30048k/32768k available (1871k kernel code, 2704k reserved, 260k data, )
Mount-cache hash table entries: 512
Checking for 'wait' instruction...  unavailable.
NET: Registered protocol family 16
PCI: fixing up bridge
PCI: Fixing up device 0000:01:00.0
NET: Registered protocol family 2
IP route cache hash table entries: 256 (order: -2, 1024 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
squashfs: version 3.0 (2006/03/15) Phillip Lougher
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
serial8250: ttyS0 at MMIO 0x0 (irq = 3) is a 16550A
serial8250: ttyS1 at MMIO 0x0 (irq = 3) is a 16550A
b44.c:v1.00 (Apr 7, 2006)
PCI: Enabling device 0000:00:01.0 (0000 -> 0002)
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:09:5b:f7:5f:c6
Physically mapped flash: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Flash device: 0x800000 at 0x1c000000
bootloader size: 655360
Physically mapped flash: Filesystem type: squashfs, size=0x116a86
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x000a0000 : "cfe"
0x000a0000-0x007e0000 : "linux"
0x00146c00-0x00260000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-y
0x007e0000-0x00800000 : "nvram"
0x00260000-0x007e0000 : "OpenWrt"
ip_conntrack version 2.4 (256 buckets, 2048 max) - 236 bytes per conntrack
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP vegas registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 128k freed
Algorithmics/MIPS FPU Emulator v1.5
Unlocking linux ...
switching to jffs2
mount: Mounting /rom/sys on /sys failed: Invalid argument
init started:  BusyBox v1.1.3 (2006.08.06-23:01+0000) multi-call binary

Please press Enter to activate this console. b44: eth0: Link is up at 100 Mbps,.
b44: eth0: Flow control is off for TX and off for RX.
wlan: 0.8.4.2 (0.9.0)
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.16.16 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
ath_rate_sample: 1.2 (0.9.0)
wlan: mac acl policy registered
ath_pci: 0.9.4.5 (0.9.0)
PCI: Enabling device 0000:01:01.0 (0000 -> 0002)
PCI: Fixing up device 0000:01:01.0
ath_pci: switching rfkill capability off
wifi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
wifi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 3s
wifi0: turboG rates: 6Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
wifi0: H/W encryption support: WEP AES AES_CCM TKIP
wifi0: mac 5.9 phy 4.3 radio 4.6
wifi0: Use hw queue 1 for WME_AC_BE traffic
wifi0: Use hw queue 0 for WME_AC_BK traffic
wifi0: Use hw queue 2 for WME_AC_VI traffic
wifi0: Use hw queue 3 for WME_AC_VO traffic
wifi0: Use hw queue 8 for CAB traffic
wifi0: Use hw queue 9 for beacons
wifi0: Atheros 5212: mem=0x40000000, irq=2
Probing device eth0: found!
BFL_ENETADM not set in boardflags. Use force=1 to ignore.
device eth0 entered promiscuous mode




BusyBox v1.1.3 (2006.08.06-23:01+0000) 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
 KAMIKAZE (bleeding edge, r4471) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

eth0 and ath0 are found, everything seems ok...

but the IP for the switch is not set...

root@OpenWrt:/# if
ifconfig   ifdown     ifup
root@OpenWrt:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:100 (100.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:980 (980.0 B)  TX bytes:980 (980.0 B)

root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
route: fscanf
root@OpenWrt:/#

/etc/config/network seem ok...

root@OpenWrt:/#
root@OpenWrt:/#
root@OpenWrt:/# cat /etc/config/network
#### VLAN configuration
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### LAN configuration
config interface lan
        option type     bridge
        option ifnames  "eth0.0 wl0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp
root@OpenWrt:/#

and modules are loaded too...

root@OpenWrt:/# lsmod
Module                  Size  Used by
crc_ccitt                992  0
switch_robo             4016  0
switch_core             5120  1 switch_robo
ath_pci                82896  0
wlan_xauth               448  0
wlan_wep                4608  0
wlan_tkip              10784  0
wlan_ccmp               6304  0
wlan_acl                2784  0
ath_rate_sample         8800  1 ath_pci
ath_hal               207104  3 ath_pci,ath_rate_sample
wlan_scan_sta           9760  0
wlan_scan_ap            3104  0
wlan                  164800  10 ath_pci,wlan_xauth,wlan_wep,wlan_tkip,wlan_ccmp
root@OpenWrt:/#

the vlan* are not created, eventhough they schould...

root@OpenWrt:/# ls -l /proc/switch/eth0/
-r--------    1 root     root            0 Jan  1 00:24 driver
-rw-------    1 root     root            0 Jan  1 00:24 enable
-rw-------    1 root     root            0 Jan  1 00:24 enable_vlan
dr-xr-xr-x    8 root     root            0 Jan  1 00:24 port
--w-------    1 root     root            0 Jan  1 00:24 reset
-r--------    1 root     root            0 Jan  1 00:24 version
dr-xr-xr-x   18 root     root            0 Jan  1 00:24 vlan
root@OpenWrt:/# 
root@OpenWrt:/# cat /proc/switch/eth0/enable
1
root@OpenWrt:/# 
root@OpenWrt:/# cat /proc/switch/eth0/enable_vlan
1
root@OpenWrt:/# 
root@OpenWrt:/# cat /proc/switch/eth0/version
0.01
root@OpenWrt:/# 
root@OpenWrt:/# 
root@OpenWrt:/# cat /proc/switch/eth0/vlan/0/ports
1       2       3       4       5t*
root@OpenWrt:/# 
root@OpenWrt:/#
root@OpenWrt:/# cat /proc/switch/eth0/vlan/1/ports
0       5t
root@OpenWrt:/# 
root@OpenWrt:/# 
root@OpenWrt:/# cat /proc/switch/eth0/vlan/2/ports
root@OpenWrt:/#
root@OpenWrt:/# cat /proc/switch/eth0/driver
bcm53xx
root@OpenWrt:/#
root@OpenWrt:/#

so what am i missing?

could anyone please give me a hint?


THNX

axc27

(Last edited by axc27 on 7 Aug 2006, 23:22)

Your interface names in config/network should specify vlan1 or 0.

sounds simple, but isn't ist...

BusyBox v1.2.1 (2006.08.08-21:11+0000) 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
 KAMIKAZE (bleeding edge, r4544) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/# 
root@OpenWrt:/# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:980 (980.0 B)  TX bytes:980 (980.0 B)

root@OpenWrt:/# cat /etc/config/network 
#### VLAN configuration 
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### LAN configuration
config interface vlan0
        option type     bridge
        option ifnames  "eth0.0 wl0"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0


#### WAN configuration
config interface vlan1
        option ifname   "eth0.1"
        option proto    dhcp
root@OpenWrt:/#

the /etc/config/network was default before... would have been suprising if default config gives unaccessible router...
no, it must be something different... there are many users with a WGT and kamikaze, as i read... what do you include in the build that i didn't? tried the build from http://klasseonline.dyndns.org/ and it works...

axc27

ok, found the problem... realy simple... image was fine... /etc/init.d/S40network isn't setting the devices...

default file:

root@OpenWrt:~# cat /etc/init.d/S40network
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org

setup_switch() { return 0; }

. /etc/functions.sh
include network
setup_switch
/sbin/wifi
root@OpenWrt:~#

hmmm... quite short...

could set the switch up with:

root@OpenWrt:/# iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.

eth0.0    no wireless extensions.

eth0.1    no wireless extensions.

wifi0     no wireless extensions.

ath0      IEEE 802.11b  ESSID:""  
          Mode:Master  Channel:0  Access Point: Not-Associated   
          Bit Rate:0 kb/s   Tx-Power:0 dBm   Sensitivity=0/3  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

root@OpenWrt:/# 
root@OpenWrt:/etc/init.d# ifconfig eth0.0 up
root@OpenWrt:/etc/init.d# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1596 (1.5 KiB)  TX bytes:0 (0.0 B)
          Interrupt:4 

eth0.0    Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1344 (1.3 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/etc/init.d# 
root@OpenWrt:/etc/init.d# udhcpc -i eth0.0
info, udhcpc (v1.2.1) started
debug, Sending discover...
debug, Sending select for 172.244.244.213...
info, Lease of 172.244.244.213 obtained, lease time 43200
deleting routers
adding router 172.244.244.2
adding dns 172.244.244.2
adding dns 10.25.14.1
adding dns 192.168.0.111
adding dns 192.168.0.211
root@OpenWrt:/etc/init.d# ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3752 (3.6 KiB)  TX bytes:2384 (2.3 KiB)
          Interrupt:4 

eth0.0    Link encap:Ethernet  HWaddr 00:09:5B:F7:5F:C6  
          inet addr:172.244.244.213  Bcast:172.244.244.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3248 (3.1 KiB)  TX bytes:1188 (1.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/etc/init.d#

so the devices eth0.0 and eth0.1 exist... and can pe setup... but why aren't there any init-scripts för the switch? are there sample-configs anywhere?

axc27

I am having the same problems here.

The default config files do not work out of the box.

Is there someone out there with a recent working build of kamikaze that could post its /etc/config/network file?

Thanks!

Stanislas

Ok, got it working now.

Here are my files :

/etc/config/network

#### VLAN configuration
config switch eth0
        option vlan0    "1 2 3 4 5*"
        option vlan1    "0 5"


#### LAN configuration
config interface lan
        option type     bridge
        option ifnames  "eth0.0 w10 ath0"
        option proto    static
        option ipaddr   192.168.1.20
        option netmask  255.255.255.0
        option gateway  192.168.1.1

#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp

/etc/modules.d/20-madwifi :

wlan
wlan_scan_ap
wlan_scan_sta
ath_hal
ath_rate_sample
wlan_acl
wlan_ccmp
wlan_tkip
wlan_wep
wlan_xauth
ath_pci autocreate=ap

/etc/init.d/S20madwifi

#!/bin/sh
iwpriv ath0 mode 3
wlanconfig ath0 create wlandev wifi0 wlanmode ap
iwconfig ath0 essid "OpenWrt"
iwconfig ath0 key "aaaaaaaaaa"
## At this place, you can also make other settings like channel, wep, key etc.
ifup ath0

and finally, the magic command at the end of /etc/init.d/S40network

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org

setup_switch() { return 0; }

. /etc/functions.sh
include network
setup_switch
/sbin/wifi
ifup lan

It does what I want it to do, maybe that won't be what you need.

Stanislas

thanks... a simple "ifup lan" does it...

why isn't that in the deaufl /etc/init.d/S40network ?

axc27

Actually ifup isn't what you think - we just left that in for backwards compatibility/legacy.

The way networking actually works is through the hotplug system -- the kernel generates a hotplug event each time a new network interface is created and the hotplug scripts automatically configure the resulting interface. Since some interfaces may be compiled into the kernel, there's also a few lines in S10boot to generate hotplug events for all existing interfaces -- I'll probably move those lines to S40network soon.

The reason for the hotplug system is basically plug and play automation; if you load a new module, hotplug will automatically configure the resulting interface. If your ip address changes, another hotplug event is generated which can be used for things like updating your dns entry on dyndns. In the future we'll also have hotplug events on port status so you can do things like change routing tables if a link goes down or automatically run a dhcp client when the wan port is connected.

ok, i think i understand...
sounds nice... hotplug could for example restart the dhcp-client if i connect something to the WAN-port or things like that...

That the devices are not created at boot-time is the problem that the  hotplug-scripts (for the permanently connected devices as switch) are not finished yet...


from S10boot:

for iface in $(/sbin/ifconfig -a | awk '{print $1}' | grep eth); do
        /usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug net
done

gives me my eth-decives

root@OpenWrt:/# /sbin/ifconfig -a | awk '{print $1}' | grep eth
eth0
eth0.0
eth0.1
root@OpenWrt:/#

so what i do at the moment is just a workarround, and it would be nicer to edit the hotplug-scripts?

axc27

stanelie wrote:

Also, the solution from ticket 691 solves this error too.
https://dev.openwrt.org/ticket/691

Stanislas

THNX... this solves the problem of bringing up lan. but wan is still not brought up automaticly. have to do 'ifup wan' to force dhcp on wan-port...


axc27

(Last edited by axc27 on 23 Aug 2006, 21:49)

What is the correct way to have everything up and running then?

The discussion might have continued from here.