You are not logged in.

#1 2012-04-10 03:13:08

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 190
Website

How to automatically reconnect after unplugging LAN cable?

Hi all,

Since switching to Arch Linux I have noticed that whenever I unplug the Ethernet cable going into my desktop (or power cycle my switch) the network won't reconnect when the cable is reconnected.  Running ping says 'network unreachable' and I have no IP address.  I have to run "rc.d restart network" to get back online ("rc.d start network" doesn't work because it says the network is already running when it's not.)

Is it possible to make it so that my DHCP configured network card automatically tries to renew its IP address after the cable has been unplugged?

This is the networking section of /etc/rc.conf:

# NETWORKING
# ----------
HOSTNAME="korath"

interface=eth0
address=
netmask=
broadcast=
gateway=

NETWORK_PERSIST="no"

After replugging the cable, this is what appears in /var/log/everything.log:

Apr 10 13:01:54 localhost kernel: [862426.173307] r8169 0000:04:00.0: eth0: link down
Apr 10 13:01:54 localhost dhcpcd[5560]: eth0: carrier lost
Apr 10 13:02:00 localhost dhcpcd[5560]: eth0: carrier acquired
Apr 10 13:02:00 localhost kernel: [862432.227316] r8169 0000:04:00.0: eth0: link up

However dhcpcd isn't running any more, it seems to terminate immediately after providing the above log message.

Any ideas?

Offline

#2 2012-04-10 04:04:12

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: How to automatically reconnect after unplugging LAN cable?

I think the daemon you want is ifplug (in extra). It's not installed by default as it is in many other distros.

Scott

Offline

Board footer

Powered by FluxBB