DHCP eth0 question

I have my pi set to use either wired or wifi with both interfaces on DHCP.

If I am using the wireless connection then every so often in syslog I see an attempt to get an eth0 address. It would seem the pi can't tell there is no cable plugged in.

Again on wifi it seems to take longer to boot. I suspect it is waiting for the DHCP request on eth0 to timeout before carrying on. On another OS I can tell DHCP to return at once rather than waiting for a timeout.

Anything I can tweak to help either situation?

TIA

--
Regards 
Dave Saville
Reply to
Dave Saville
Loading thread data ...

I have a similar situation on my Debian laptop, so the fix I use for that should work on a Pi too.

I installed mii-tool, which can report details of the port status. Then I changed my /etc/network/interfaces to read something like:

iface eth0 inet dhcp pre-up ( mii-tool eth0 | grep -q "link ok" )

What this does is to check that eth0 has a link before trying to start the interface. If it doesn't then the pre-up command will return false and networking won't try and bring the interface up.

Hope that helps.

Reply to
Dom

Thanks -that looks useful. Will try next time I am playing.

--
Regards 
Dave Saville
Reply to
Dave Saville

Seems mii-tool has been superseded, for some years, by ethtool - does the same job here. Thanks.

--
Regards 
Dave Saville
Reply to
Dave Saville

Afraid not - putting the pre-up line in results in no interface on the pi getting an IP with either cable or WIFI. I tried changing the order the interfaces were defined in but it made no difference.

--
Regards 
Dave Saville
Reply to
Dave Saville

ethtool does not output "link ok". Did you change the grep argument to something like "Link detected: yes" ?

Cheers.

Jim

Reply to
Jim Diamond

I am not *that* dim Jim :-) But a valid point in that I had not posted the actual text used. I checked it out form the command line to see what I needed to grep for. Especially as I was using a different tool. But the Pi does not seem to like a pre-up - even though it is in the man page. :-)

--
Regards 
Dave Saville
Reply to
Dave Saville

Well, I'm glad you put the smiley at the end there.

Too bad.

I hope you find some solution.

Jim

Reply to
Jim Diamond

ISTR having issues with bringing networks up at some point when things 'changed' from the old way to a new way.

Somewhere around kernel 3.0

this may help

formatting link

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to  
 Click to see the full signature
Reply to
The Natural Philosopher

More than I ever wanted to know :-) Thanks.

--
Regards 
Dave Saville
Reply to
Dave Saville

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.