You are not logged in.

#1 2012-09-16 18:54:53

patsmith
Member
Registered: 2012-09-16
Posts: 10

[SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

I recently installed Arch Linux on my MacBook 6,1, dual booting with Mac OS Mountain Lion, and it is mostly working quite well. I do have one minor annoyance, namely:

If I am running Mac OS, reboot the computer, and let it boot into Linux (which is the default), it does not acquire a dhcp lease from my DSL router. However, if I then halt the computer and then power it on again and boot into Linux, it does acquire a dhcp lease.

I'd appreciate any ideas on how I could figure out why I can't get a dhcp lease after rebooting from Mac OS to Linux.

According to lspci, I have:

00:0a.0 Ethernet controller: NVIDIA Corporation MCP79 Ethernet (rev b1)

Output of ip addr show dev eth0 after the reboot:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 34:15:9e:1c:3d:ec brd ff:ff:ff:ff:ff:ff
    inet6 fe80::3615:9eff:fe1c:3dec/64 scope link 
       valid_lft forever preferred_lft forever

and after the halt:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 34:15:9e:1c:3d:ec brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.64/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::3615:9eff:fe1c:3dec/64 scope link 
       valid_lft forever preferred_lft forever

Logged by dhcpcd -d after the reboot:

Sep 16 11:34:43 localhost dhcpcd[488]: version 5.6.2 starting
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: sending IPv6 Router Solicitation
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: broadcasting for a lease
Sep 16 11:34:43 localhost dhcpcd[488]: wlan0: waiting for carrier
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: carrier lost
Sep 16 11:34:43 localhost dhcpcd[488]: wlan0: carrier acquired
Sep 16 11:34:43 localhost dhcpcd[488]: wlan0: carrier lost
Sep 16 11:34:43 localhost dhcpcd[488]: wlan0: waiting for carrier
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: carrier acquired
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: sending IPv6 Router Solicitation
Sep 16 11:34:43 localhost dhcpcd[488]: eth0: broadcasting for a lease
Sep 16 11:34:47 localhost dhcpcd[488]: eth0: sending IPv6 Router Solicitation
Sep 16 11:34:51 localhost dhcpcd[488]: eth0: sending IPv6 Router Solicitation
Sep 16 11:34:55 localhost dhcpcd[488]: eth0: sending IPv6 Router Solicitation
Sep 16 11:34:55 localhost dhcpcd[488]: eth0: no IPv6 Routers available
Sep 16 11:35:13 localhost dhcpcd[488]: forked to background, child pid 530

And after the halt:

Sep 16 11:36:49 localhost dhcpcd[474]: version 5.6.2 starting
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: sending IPv6 Router Solicitation
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: broadcasting for a lease
Sep 16 11:36:49 localhost dhcpcd[474]: wlan0: waiting for carrier
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: carrier lost
Sep 16 11:36:49 localhost dhcpcd[474]: wlan0: carrier acquired
Sep 16 11:36:49 localhost dhcpcd[474]: wlan0: carrier lost
Sep 16 11:36:49 localhost dhcpcd[474]: wlan0: waiting for carrier
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: carrier acquired
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: sending IPv6 Router Solicitation
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: broadcasting for a lease
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: offered 192.168.1.64 from 192.168.1.254
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: acknowledged 192.168.1.64 from 192.168.1.254
Sep 16 11:36:49 localhost dhcpcd[474]: eth0: checking for 192.168.1.64
Sep 16 11:36:53 localhost dhcpcd[474]: eth0: sending IPv6 Router Solicitation
Sep 16 11:36:54 localhost dhcpcd[474]: eth0: leased 192.168.1.64 for 86400 seconds
Sep 16 11:36:54 localhost dhcpcd[474]: forked to background, child pid 531

Last edited by patsmith (2012-09-28 07:48:52)

Offline

#2 2012-09-16 19:03:12

Jasonvw
Member
From: Detroit, Michigan
Registered: 2011-12-23
Posts: 22

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

I had the same type of issue with my laptop between Arch/Windows. I just set the hostnames on each OS differently so the DHCP server sees them as two different machines. Let me know if that dosen't work, maybe giving yourself a static lease on the router might help if it supports it (most do) or shortening the lease time. Really I think the best idea would be just to use different hostnames.


RAID !=backup

Offline

#3 2012-09-17 04:41:43

patsmith
Member
Registered: 2012-09-16
Posts: 10

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

Thanks, but this did not work.

The two OSes already have different hostnames. Although it may be that Mac OS is not passing the hostname, as when I am running MacOS, the router shows "Unknown" for the hostname. When I run Linux, the Linux hostname shows up in the router as the computer's name.

I tried setting both MacOS and Linux to use the same DHCP client id; that didn't help.

When I tried setting the router to hand out a static IP address to the computer's MAC address, I had similar results:
Reboot into MacOS => MacOS now gets the static IP address.
Reboot into Linux => Linux can't get a dhcp lease.
Power off, power on, boot LInux => Linux gets a lease with the static IP address.

Offline

#4 2012-09-24 00:48:56

patsmith
Member
Registered: 2012-09-16
Posts: 10

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

After poking around some, I've found some differences that may or may not mean anything.

I'm printing out the interface registers with

sudo ethtool -d eth0 raw on | od -tx4 -w4 -Ax -v

This yields lots of data I don't understand, that changes from invocation to invocation. What is interesting is that there are four locations which always seem to have the same value after a reboot from MacOS, and always seem to have another consistent value after a power off.
These are:

address    after        after
(hex)      reboot       halt
000128     a000fff0     ac00ffef
000180     00000006     00000016
000278     00004002     00000002
000600     00074020     00000020

Does anyone know what these signify, or where I could find out?

And does anyone know how I could change the values stored at these locations?

Thanks!

Offline

#5 2012-09-28 07:46:01

patsmith
Member
Registered: 2012-09-16
Posts: 10

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

Well, forcing one of the register values mentioned in my last post does seem to do the trick. I put the following code into /etc/dhcpcd.enter-hook, and now when I reboot from Mac OS into Linux, I do get an Internet connection.

#!/bin/sh -e

if [ "$reason" = PREINIT ] && [ "$interface" = eth0 ]; then
   d=`readlink /sys/class/net/eth0 \
      | sed -e 's,/net/eth0$,,' -e 's,.*/[0-9a-f]*:,,'`
   base=`lspci -vv -s $d | awk '/Region 0:/ { print $5 }'`
   where=`perl -e "print ((0x$base + 0x278) / 4)"`
   perl -e "printf '%c%c%c%c', 2, 0, 0, 0" \
         | dd of=/dev/mem bs=4 count=1 seek=$where 2>/dev/null
fi

This makes me suspect that perhaps the forcedeth driver is missing a little bit of initialization that it should be doing. Does anyone know offhand how to contact the maintainers of this driver?

Offline

#6 2012-10-05 13:49:00

kekules_dream
Member
Registered: 2009-05-19
Posts: 102

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

Hi, patsmith and welcome!  Seven to one you are using refind, yes?  I had that exact problem with refind, but it did not happen when I switched to refit.  I know refind is supposed to be "better" but refit does it modest chore fine for me and I get a lease without a hook.

A couple of differences in my case, however:  This is an iMac10,1 with snow leopard.  Haven't really had enough desire to upgrade the mac side since it would require wiping out the arch partition and reinstalling it.  Or maybe there is a way to do it I don't know about but when I stuck in a ml disk I could not do it without losing my sda3.

Offline

#7 2012-10-05 17:16:05

patsmith
Member
Registered: 2012-09-16
Posts: 10

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

Interesting! But no, I'm using neither refind nor refit. Just the builtin OS picker from Apple, and GRUB2.

Doesn't the Mountain Lion installer allow you to pick the partition you want to install to, without wiping the entire hard drive?

Offline

#8 2012-11-08 23:26:33

sasvari
Member
Registered: 2012-11-08
Posts: 4

Re: [SOLVED] No dhcp lease after reboot from Mac OS Mountain Lion

Here's the same behaviour: after rebooting into Linux from Mac OS X Lion dhcpcd is not getting a lease. Booting into the Live CD and chrooting, rebooting it is working again.

(using refind with EFI_STUB)

EDIT: MacBookPro5,5

Last edited by sasvari (2012-11-09 08:40:55)

Offline

Board footer

Powered by FluxBB