1

On my Beaglebone card I run Angstrom Linux. It has one cable in the ethernet port (etho) and a USB 3G modem dongle in the USB port whose interface is named wwan0.

At the other end of the crossover ethernet cable is another Linux computer running on Raspberry Pi.

When the ethernet cable is disconnected, I have internet access, but when the cable is attached, internet traffic gets directed on the eth0 interface.

The ip route table looks like this:

root@beaglebone:~# ip route
default dev eth0  scope link
default via 95.192.114.29 dev wwan0
95.192.114.28/30 dev wwan0  proto kernel  scope link  src 95.192.114.30
169.254.0.0/16 dev eth0  proto kernel  scope link  src 169.254.29.204

When doing ping 8.8.8.8 this fails, but when I do

ping -I wwan0 8.8.8.8

This works fine. I can also ping

ping 169.254.1.N # 'far' end of ethernet crossover cable

which is the other end of the ethernet crossover cable and it works. So how do I make sure that internet traffic goes out on the right interface? Is this one of the cases where the "Advanced router" option must be selected in menuconfig before recompiling the kernel? Or is it enough to swap the order between the two default routes?

This card doesn't route any data coming from somewhere else, it receives data on an I2C bus and is supposed to write this data to one server on the internet and another server on the other end of the crossover cable.

/etc/network/interfaces
iface eth0 inet static
    address 169.254.1.N+1 # 'near' end of crossover cable
    netmask 255.255.0.0
    gateway 169.254.1.2

allow-hotplug wwan0
iface wwan0 inet dhcp

Another issue which might be related is that the IP address isn't correctly set to the static one I set in /etc/network/interfaces above, it's on the correct subnet 169.254.0.X but it isn't what I statically configured.

EDIT 4

If I try to delete the default route under EDIT 2

route del default gw 0.0.0.0 dev eth0

connman jumps into action and immediately re-adds it again, as visible via journalctl:

beaglebone connmand[853]: eth0 {del} route 0.0.0.0 gw 0.0.0.0 scope 0 <UNIVERSE>
beaglebone connmand[853]: eth0 {add} route 0.0.0.0 gw 0.0.0.0 scope 0 <UNIVERSE>

(the timestamps of those two lines are identical as viewed with journalctl --follow)

EDIT 3

root@beaglebone:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
    link/can
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 34:b1:f7:1b:02:86 brd ff:ff:ff:ff:ff:ff
    inet 169.254.252.60/16 brd 169.254.255.255 scope global eth0
4: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:01:02:03:04:05 brd ff:ff:ff:ff:ff:ff
    inet 78.78.88.67/29 scope global wwan0

EDIT 2

In my opinion the first row looks suspicious.

netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         0.0.0.0         0.0.0.0         U         0 0          0 eth0
0.0.0.0         95.196.157.233  0.0.0.0         UG        0 0          0 wwan0
95.196.157.232  0.0.0.0         255.255.255.252 U         0 0          0 wwan0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0

EDIT 0 & EDIT 1

As per comment by FloHimself below, the only subnet involved is 169.254.0.0/16 and one beginning with 192 is a typo. However, changing the static IP address doesn't keep the static IP from changing and the ping -I wwan0 is still the only way to reach the world wide web.

  • 1
    Can you please append the output of ip a to the question and explain the subnets that are involved in your network? There are 169.254.0.0/16 and 192.254.0.0/16 on eth0? – FloHimself Jun 25 '15 at 19:00
  • I think you have found at least one of the bugs, I have a copy-paste error with 169/192 in my /etc/network/interfaces file. This might explain why eth1 gets a new IP address from DHCP when the ethernet cable is attached. I don't have access to the test rig again until the next week, so I can't post the output of "ip a" until then. Thanks for the input! – Adam.at.Epsilon Jun 26 '15 at 8:52
  • I have done another edit with the correct 169.254 IP address. The behaviour is as before. Now I suspect there is some sort of conflict between connmand and the Avahi daemon. I will also add the output from netstat -rn – Adam.at.Epsilon Aug 3 '15 at 16:23
  • Hi @FloHimself I've added the output of ip a under EDIT 3. – Adam.at.Epsilon Aug 5 '15 at 8:35
0

By using telnet to read the output from journalctl --follow I could see that connmand deleted routes whenever I tried to correct the routing table. So I disabled it using systemctl:

systemctl disable connman.service

I also modified /etc/network/interfaces to use a point-to-point configuration for eth0:

auto eth0
iface eth0 inet static
        address 169.254.1.2
        netmask 255.255.0.0
        pointopoint 169.254.1.1
        gateway 169.254.1.1
        scope link

Then using ifup eth0 the interface came up. Now I can ping both the remote endpoint of the eth0 cable 169.254.1.1 and 8.8.8.8 without using ping -I N.N.N.N.

EDIT 0

The eth0 never came up automatically at boot after disabling connman in systemd so I created a new .service file. So now everything works at boot time.

[Unit]
Description=Network interface eth0
Wants=network.target
Before=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "ifup eth0"
ExecStop=/bin/sh -c "ifdown eth0"

[Install]
WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.