1

After updating the kernel in my Raspberry Pi B+, I moved the card/flash drive to my Pi 2. There are no kernel issues and I boot to the shell, but there is no network access whatsoever.

Inserted everything back into the B+, all is normal there. I thought there were no incompatibilities between the two models except for the v6 vs. v7 kernel? What could possibly be happening? (All packages are up to date)

This is the output of ifconfig:

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: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)

And the contents of /etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static

address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off

2 Answers 2

2

After a bit more searching, I found the answer. Apparently, since the MAC address of the new unit is different from the old unit, it didn't recognize the new IP address as eth0. This is what I did to make the fix (assumes your static IP is set on eth0):

  1. Run sudo ifconfig and observe that eth0 is not present
  2. Run sudo ifconfig -a and observe an unnamed Ethernet connection
  3. Write down the MAC address of that Ethernet connection
  4. Make a backup of /etc/udev/rules.d/70-persistent-net.rules
  5. Edit that file and replace the MAC address in the line with NAME="eth0" with the MAC address from Step 3
  6. Reboot.

These steps worked for me - I am going to assume that should one want to move back to the old unit, they would have to do the same again on the other unit.

Slightly modified from answer found on https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=90319

0

At boot time /etc/udev/rules.d/70-persistent-net.rules is populated with a mapping of the MAC address of your interface card to the interface used if it doesn't exist already.

So that's what happened for you when you inserted the card in your new Pi 2 and booted the system:

  1. There exists already a mapping of your Pi B+ MAC address to eth0
  2. Pi 2 boots and a second mapping is created in /etc/udev/rules.d/70-persistent-net.rules from the new Pi 2 MAC address to eth1
  3. You defined eth0 in your /etc/network/interfaces but the old interface from Pi B+ now doesn't exists any more. There exists the interface with a new MAC address on your Pi 2

You can fix the issue by:

  1. Modifying the MAC address in /etc/udev/rules.d/70-persistent-net.rules to get the new MAC address (that's what you did);
  2. Changing /etc/network/interfaces to use eth1 instead of eth0;
  3. Deleting /etc/udev/rules.d/70-persistent-net.rules. That way a new mapping of the new interface MAC will be created to eth0 during boot and the definition of eth0 in /etc/network/interfaces will be used.

This is a common issue whenever you want to clone existing cards and to use them on other Raspberries. If you delete /etc/udev/rules.d/70-persistent-net.rules on the card you use as the template for cloned cards you will not hit the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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