• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1] 2
Author Topic: Double Default routes Ubuntu SheevaPlug  (Read 8556 times)
odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« on: February 09, 2010, 03:00:53 AM »

Hi folks,

re the hints in http://plugcomputer.org/plugforum/index.php?topic=1292.msg8029#msg8029 I got one of my weired Ethernet issues fixed (thx for that).

However I still have some odd issue with a second default route active when my system reboots. My config looks like this

root@Share:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:43:01:d8:11
          inet addr:a.b.c.254       Bcast:a.b.c.255       Mask:255.255.255.0
          inet6 addr: fe80::250:43ff:fe01:d811/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:77 errors:0 dropped:0 overruns:0 frame:0
          TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8820 (8.8 KB)  TX bytes:16895 (16.8 KB)
          Interrupt:11

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          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@Share:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
a.b.c.0            0.0.0.0            255.255.255.0   U          0 0              0 eth0
0.0.0.0            a.b.c.1            0.0.0.0               UG        0 0              0 eth0

0.0.0.0            a.b.c.1            0.0.0.0               UG        0 0              0 eth0

root@Share:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
# iface eth0 inet dhcp
iface eth0 inet static
        address a.b.c.254
        netmask 255.255.255.0
        gateway a.b.c.1


I can delete one of the default route entries

root@Share:~# route del default

and it still works

root@Share:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
a.b.c.0            0.0.0.0         255.255.255.0    U          0 0                0 eth0
0.0.0.0           a.b.c.1          0.0.0.0                UG        0 0                0 eth0


however I'd like to understand where this double entry is coming from!?

Further - though I don't know if it's related - I still have an odd Samba message in my syslog which cause I couldn't "google" so far:

Feb  9 10:41:55 Share nmbd[1641]:   queue_query_name: interface 1 has NULL IP address !

Would sb have an idea where to look at? thx!
Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #1 on: February 09, 2010, 04:13:35 AM »

any fancy advanced routing stuff? Can you show the output of "ip route" and "ip rule"
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #2 on: February 09, 2010, 04:28:17 AM »

No, I'm not aware of any fancy routing stuff. BTW: IP a.b.c/24 is an official IP address, that's why I'm hiding it ;-) And actual kernel is

Linux Share 2.6.32.7 #1 PREEMPT Thu Jan 28 19:00:37 MST 2010 armv5tel

running from 1GB SD card.

root@Share:~# ip route
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.254
default via a.b.c.1 dev eth0  metric 100


root@Share:~# ip rule
RTNETLINK answers: Operation not supported
Dump terminated


PS: before deleting one of the default routes manually it looks like this:

root@Share:~# ip route
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.254

default via a.b.c.1 dev eth0
default via a.b.c.1 dev eth0  metric 100

root@Share:~# ip rule
RTNETLINK answers: Operation not supported
Dump terminated
« Last Edit: February 09, 2010, 05:14:12 AM by odoll » Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #3 on: February 10, 2010, 04:05:09 AM »

Hi folks, a brief (though strange) update. I reserved few minutes this morning to clone the OS/FS from the SD card I use in my "production" system to another SD card and plugged it into my spare SheevaPlug. Of course I had to adapt the fixed IP (and lowering the PDC level of the running Samba) before booting, however I was surprised to find this device not to have that second default route once booted. How can this be?!?

Maybe some odd difference in the U-Boot config? As I recall both use a 3.427 "pingtoo" version (http://plugcomputer.org/plugforum/index.php?topic=1134.msg7016#msg7016) though maybe at different patch levels? (I've to double check).

root@Share:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
# iface eth0 inet dhcp
iface eth0 inet static
        address a.b.c.36
        netmask 255.255.255.0
        gateway a.b.c.1

root@Share:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:43:01:da:3b
          inet addr:a.b.c.36  Bcast:a.b.c.255  Mask:255.255.255.0
          inet6 addr: fe80::250:43ff:fe01:da3b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2513 (2.5 KB)  TX bytes:4625 (4.6 KB)
          Interrupt:11

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          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@Share:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
a.b.c.0            0.0.0.0            255.255.255.0   U         0    0            0    eth0
0.0.0.0            a.b.c.1            0.0.0.0               UG       0    0            0    eth0

root@Share:~# ip route
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.36
default via a.b.c.1 dev eth0  metric 100
Logged

pancho
Newbie
*

Karma: 1
Posts: 20


View Profile
« Reply #4 on: February 10, 2010, 07:31:29 AM »

Hi, odoll.

If you had issues with the mac address, maybe udev messed things up with the ethernet interfaces.

Check the file /etc/udev/rules.d/70-persistent-net.rules and verify that no spurious mac addresses appear there.
[that is the path in debian, I don't have an ubuntu available but I think that they haven't changed it]

Hope that it helps this time too.

Cheers,

pancho.
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #5 on: February 10, 2010, 08:52:30 AM »

Hi pancho,

yeah, that is what I exactly did before opening this thread:

re the hints in http://plugcomputer.org/plugforum/index.php?topic=1292.msg8029#msg8029 I got one of my weired Ethernet issues fixed (thx for that).

However I still have some odd issue with a second default route active when my system reboots.

IMO the file looked clean, but I will double check. (And yes, it's at the same place with the Ubuntu).
Logged

pancho
Newbie
*

Karma: 1
Posts: 20


View Profile
« Reply #6 on: February 10, 2010, 09:14:41 AM »

Hi again, odoll.

I just noticed that your /etc/network/interfaces does not conform to current spec ($ man interfaces), around the 'iface lo inet loopback' line.
It seems that the lines:

address 127.0.0.1
netmask 255.0.0.0

are no longer necessary, and I wonder if that could cause the weird double route... It is a long shot, but maybe worth a try.

Good luck!
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #7 on: February 11, 2010, 03:01:58 AM »

tnx pancho. Will have a look at it. However I guess it's not the main cause. I spared some few minutes this morning again to do another test.

To double check I placed the same SD card I use in my primary Plug (with the double entries) into my spare device, making no changes to the OS/FS/configs. The 2nd comes up without the double, it has just one default route entry. So my guess is that it's not the OS in the first instance which causes this behaviour.

I also checked the uboot version. Both claim to have

Marvell>> version
U-Boot 1.1.4 (Dec 27 2009 - 22:03:21) Marvell version: 3.4.27 - pingtoo patch.01


So I also copied the printenv output of both Plugs, but haven't had time yet to compare them and spot the differences (will follow up on this, there are differences; not only mac address, but also in the order of the variables ...).

However IMO worth nothing: though the boot in the second Plug of cause created a 2nd entry in /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:43:01:d8:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:43:01:da:3b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


it comes up with just one default route for eth0. Of course I deleted the file before plugging the SD card back into my primary Sheeva.
« Last Edit: February 11, 2010, 03:06:36 AM by odoll » Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #8 on: February 11, 2010, 07:26:36 AM »

@odoll

Once you have change, try shutdown the eth0 interface (ifdown eth0). then post the progress of ifup -v eth0. may be we can see how the interface was setup.
Logged

Good Luck Smiley

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #9 on: February 11, 2010, 09:39:04 AM »

@pingtoo - have to do this when I'm at home having access to the console. Anyhow here's a brief update of the comparison of the uboot's environment variables: Nothing really catches my eye, rather than some of the args are in a different order (and of course different IP and MAC addresses). What I can try is to increase the rootdelay?

$ diff 1stPlugEnv.txt 2ndPlugEnv.txt
9d8
< console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
27a27
> console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1ff00000@0x100000(root)
28a29
> bootargs_nand=rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=a.b.c.1:a.b.c.253:a.b.c.253:255.255.255.0:DB88FXX81:eth0:none
30,31c31
< bootcmd=run bootcmd_sd; run bootcmd_nand
< bootargs_nand=rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none
---
> bootargs_sd=console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=5 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw ip=a.b.c.1:a.b.c.253:a.b.c.253:255.255.255.0:DB88FXX81:eth0:none
33,34c33
< bootargs_sd=console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=10 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw ip=a.b.c.254:a.b.c.1:a.b.c.1:255.255.255.0:DB88FXX81:eth0:none
< ethaddr=00:50:43:01:d8:11
---
> bootcmd=run bootcmd_sd; run bootcmd_nand
35a35
> ethaddr=00:50:43:01:da:3b
57c57
< Environment size: 1859/131068 bytes
\ No newline at end of file
---
> Environment size: 1873/131068 bytes
\ No newline at end of file
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #10 on: February 11, 2010, 01:55:23 PM »

@odoll,

I recommend take the ip=...none, this may cause kernel assume you want to do nfsroot setup interface before rootfs mounted.

I guess the two plugs have different kernel configure, one is configure with CONFIG_IP_PNP and the other don't.

Good luck Smiley
Logged

Good Luck Smiley

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #11 on: February 12, 2010, 07:15:00 AM »

@pingtoo: hmm, frankly don't got what you mean with "I recommend take the ip=...none". Do you mean to remove the part of the string?

If I recall correctly I once added it by intend, as without IPs the interface wasn't there at all (http://plugcomputer.org/plugforum/index.php?topic=950.0).

However as for now I left the SD card I usually boot from in my spare Plug and made it the productive one. Benefit: I can do some more testing with the "faulty" one and can also watch, if that network/Samba black-outs for my "users" are still there or gone.

Anyhow, here comes the outcome of the ifdown and up you asked for (strange):

root@Share:~# ip route
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.254
default via a.b.c.1 dev eth0
default via a.b.c.1 dev eth0  metric 100
root@Share:~# ifdown eth0
root@Share:~# ifup -v eth0
Configuring interface eth0=eth0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/dhclient3-apparmor

ifconfig eth0 a.b.c.254 netmask 255.255.255.0              up
 route add default gw a.b.c.1 metric 100 eth0
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/ntpdate
run-parts: executing /etc/network/if-up.d/openssh-server
run-parts: executing /etc/network/if-up.d/openvpn
root@Share:~# ip route
a.b.c.0/24 dev eth0  proto kernel  scope link  src a.b.c.254
default via a.b.c.1 dev eth0  metric 100


Further: why do you think they have a different kernel? IMO both had 2.6.32.7 (and are now at 2.6.32.8 ). Where did you spot the difference?

PS: do you know what's happening with the latest uboot version? Your patched ones work for me, but the one rooster posted which should have included your patches didn't! rooster never came back with any feedback ...

PPS: at least the smbd message

Feb 12 15:15:03 Share nmbd[1633]:   queue_query_name: interface 1 has NULL IP address !


is still there, though this device boots up with just one default route entry ...
« Last Edit: February 12, 2010, 07:28:32 AM by odoll » Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #12 on: February 12, 2010, 08:58:07 AM »

@odoll,

I think I was in la la land Cheesy, I mean "take out" the ip=...none portion from the bootargs_sd.

As your ifdown/ifup progress show, your linux configuration is not the problem, I conclude what happen to the extra default route was add before init boot sequence. So this mean it can only happen in initrd/initramfs or kernel autoconfig. since you don't use initrd/iniramfs than it must be in kernel. So please remove the ip=...none portion that should fix the problem.

As why I think you have different kernel is because I am guess the kerenl autoconfig is causing multiple default gateway line happening, so I am assume you compile your own kernel and each with different set of configure. One with CONFIG_NET_PNP and the other does not have it.

I am still using my own patched version. I don't know how rooster compile the u-boot. it most likely is because the tool-chain is different. mine was build base on Gentto cross-dev. I have to configure the cross-dev in selected version or else the produced result does not work for me.

I know very little about samba, I will to google it to see if I can find anything.
Logged

Good Luck Smiley

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #13 on: February 12, 2010, 09:24:57 AM »

@pingtoo: hmm, frankly don't got what you mean with "I recommend take the ip=...none". Do you mean to remove the part of the string?
...
PPS: at least the smbd message

Feb 12 15:15:03 Share nmbd[1633]:   queue_query_name: interface 1 has NULL IP address !


is still there, though this device boots up with just one default route entry ...
After some google search it looks like you have bind interfaces only=... in your smb.conf and because Sheeva SOC come with two ethernet port build in, so kernel have detected two ethernet device. And since you set bind interface only parameter in smb.conf samba is iterate through all interface and it find eth1 which is not configured. You can safely ignore the message.
Logged

Good Luck Smiley

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #14 on: February 13, 2010, 12:41:05 PM »

Hi pancho,

I just noticed that your /etc/network/interfaces does not conform to current spec ($ man interfaces), around the 'iface lo inet loopback' line.
It seems that the lines:

I guess you're right (haven't checked it, yet). It comes like this when the plug gets shipped!?

@pingtoo: this plug is strange. As advised I removed the IP address etc  info from the bootargs (btw: I'm using a Debian Lenny install on another SD card this time, but it has been the same issue as to my previous post (link insite: no interface).

bootcmd_nand=setenv bootargs $(bootargs_nand); nand read.e 0x800000 0x100000 0x400000; bootm 0x800000
bootcmd_sd=setenv bootargs $(bootargs_sd); mmcinit; ext2load mmc 0 0x8000000 /uImage; bootm 0x8000000
bootcmd=run bootcmd_sd; run bootcmd_nand
bootargs_nand=rootfstype=jffs2 console=ttyS0,115200 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw
bootargs_sd=console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=10 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw


If I now boot into NAND, which has still the Ubuntu (thou updated kernel), it comes up with both interface lo and eth0 and eth0 gets the right IP from my DHCP server (based on the MAC).

Marvell>> run bootcmd_nand
[...]
root@debian:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:43:01:d8:11
          inet addr:a.b.c.253  Bcast:a.b.c.255  Mask:255.255.255.0
          inet6 addr: fe80::250:43ff:fe01:d811/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1888 (1.8 KB)  TX bytes:4649 (4.6 KB)
          Interrupt:11

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          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@debian:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
iface eth0 inet dhcp


However, if I boot into the debian on the SD (same kernel) I have no eth interface at all, but just the lo!!

debian:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)


When I revert back to the IP settings in the uboot commands

setenv bootargs_sd 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootdelay=10 mtdparts=orion_nand:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw ip=a.b.c.253:a.b.c.1:a.b.c.1:255.255.255.0:Sheeva:eth0:none'

I can spot the following messages during the boot process

net eth0: port 0 with MAC address 00:50:43:01:d8:11
[....]
IP-Config: Complete:
     device=eth0, addr=a.b.c.253, mask=255.255.255.0, gw=a.b.c.1,
     host=Sheeva, domain=, nis-domain=(none),
     bootserver=a.b.c.1, rootserver=a.b.c.1, rootpath=
[...]
eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[...]

Waiting for /dev to be fully populated...udevd-event[725]: rename_netif: error changing netif name eth0 to eth1: Device or resource busy
[...]
Cleaning up ifupdown....
[...]
Setting up networking....
Configuring network interfaces...done.


and after the login I have eth0 with the right IP address

debian:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:50:43:01:d8:11
          inet addr:194.174.11.253  Bcast:194.174.11.255  Mask:255.255.255.0
          inet6 addr: fe80::250:43ff:fe01:d811/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:23 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2850 (2.7 KiB)  TX bytes:856 (856.0 B)
          Interrupt:11


however I can ping (two times) Wink

debian:~# ping a.b.c.1
PING a.b.c.1 (a.b.c.1) 56(84) bytes of data.
64 bytes from a.b.c.1: icmp_seq=1 ttl=64 time=6.31 ms
64 bytes from a.b.c.1: icmp_seq=2 ttl=64 time=0.249 ms
^C
--- a.b.c.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.249/3.279/6.310/3.031 ms


I can't access the interface

debian:~# ifdown eth0
ifdown: interface eth0 not configured
debian:~# ifdown eth1
ifdown: interface eth1 not configured
« Last Edit: February 13, 2010, 12:44:34 PM by odoll » Logged

Pages: [1] 2
Print
Jump to: