a5sk4s
Posts: 9
Joined: Fri Sep 26, 2014 11:09 pm

How to avoid 2min delay for direct ethernet cable setup?

Mon Oct 20, 2014 5:42 pm

I am using a direct ethernet cable as a fallback option to be able to administer the RPi. There is no dhcp server, both sides have static ips.

The delay occurs, when there is no cable connected.

At the moment, I have the ip address for the RPi hardcoded at the end of /boot/cmdline.txt

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p6 rootfstype=ext4 elevator=deadline rootwait ip=192.168.2.2
When I remove it and use /etc/network/interfaces as follows

Code: Select all

auto wlan0

iface lo inet loopback

iface eth0 inet static
        address 192.168.2.2
        netmask 255.255.255.0
        gateway 192.168.2.1

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp
the lo (loopback) interface disappears from ifconfig, and the postgresql server fails to start up as a result.

I can later correct the situation by manually invoking 'sudo ifup lo' and '/etc/init.d/postgresql start', but i would prefer not to - maybe other things failed as well.

What can I do to correct the situation?

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: How to avoid 2min delay for direct ethernet cable setup?

Mon Oct 20, 2014 5:57 pm

Remove anything you changed in the FAT partition

Adjust to suit

Code: Select all

auto lo

iface lo inet loopback

auto eth0
iface eth0 inet static
  address 192.168.1.246
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.1
It fires up straight away cable or not, and if its started without, it just works when you plug it in.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

a5sk4s
Posts: 9
Joined: Fri Sep 26, 2014 11:09 pm

Re: How to avoid 2min delay for direct ethernet cable setup?

Mon Oct 20, 2014 7:03 pm

Remove anything you changed in the FAT partition
Not sure what to do with this statement. The rest worked like a charm. I assume that I was basically missing the 'auto lo'.

Thank you.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to avoid 2min delay for direct ethernet cable setup?

Mon Oct 20, 2014 7:53 pm

if you add ip=xxx.xxx.xxx.xxx to /boot/cmdline.txt and the eth0 isn't wired to an active connection you WILL get the 120 second delay.

Two options to fix it
1. Connect a cable to a router/switch or laptop
2. Drop the ip= parm
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

a5sk4s
Posts: 9
Joined: Fri Sep 26, 2014 11:09 pm

Re: How to avoid 2min delay for direct ethernet cable setup?

Tue Oct 21, 2014 7:35 pm

Yes, the following configuration in /etc/network/interfaces allowed me to do that (no need to plug in a cable to avoid the delay):

Code: Select all

auto wlan0
auto eth0
auto lo

iface lo inet loopback

iface eth0 inet static
	address 192.168.2.2
	netmask 255.255.255.0
	network 192.168.2.0

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Return to “Troubleshooting”