[CentOS] How to make a network interface come up automatically on link up?

Tue Mar 26 00:09:51 UTC 2013
Joakim Ziegler <joakim at terminalmx.com>

On 24/03/13 4:01, Nux! wrote:
> On 24.03.2013 02:27, Joakim Ziegler wrote:
>> I have a recently installed Mellanox VPI interface in my server. This
>> is
>> an InfiniBand interface, which, through the use of adapters, can also
>> do
>> 10GbE over fiber. I have one of the adapter's two ports configured for
>> 10GbE in this way, with a point to point link to a Mac workstation
>> with
>> a Myricom 10GbE card.

>> I've configured this interface on the Linux box (eth2) using
>> /etc/sysconfig/network-scripts/ifcfg-eth2 , setting its IP address,
>> MTU,
>> subnet, etc.

> Try adding HOTPLUG=yes in the cfg file.

Neither HOTPLUG=yes or MANAGED=no seems to make this interface come back
up when the cable is unplugged and then plugged, unfortunately. For
instance, before unplugging anything, ifconfig says:

eth2      Link encap:Ethernet  HWaddr 00:02:C9:29:64:8F
             inet addr:10.10.0.1  Bcast:10.10.255.255  Mask:255.255.0.0
             inet6 addr: fe80::2:c900:129:648f/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
             RX packets:47 errors:0 dropped:0 overruns:0 frame:0
             TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:14924 (14.5 KiB)  TX bytes:3940 (3.8 KiB)

Then I unplug the cable, which, in dmesg, gives me:

mlx4_en: eth2: Link Down

And in /var/log/messages:

Mar 25 11:36:24 resolve02 ntpd[4819]: Deleting interface #14 eth2,
10.10.0.1#123, interface stats: received=0, sent=0, dropped=0,
active_time=163 secs

(Which I guess is just ntpd reacting)

And then I plug the cable back in, and in dmesg, I have:

mlx4_en: eth2: Link Up

Mar 25 11:38:09 resolve02 kernel: mlx4_en: eth2: Link Up
Mar 25 11:38:09 resolve02 NetworkManager[4429]: <info> (eth2): carrier
now ON (device state 2)
Mar 25 11:38:09 resolve02 NetworkManager[4429]: <info> (eth2): device
state change: 2 -> 3 (reason 40)

But ifconfig gives me:

eth2      Link encap:Ethernet  HWaddr 00:02:C9:29:64:8F
             inet6 addr: fe80::2:c900:129:648f/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
             RX packets:104 errors:0 dropped:0 overruns:0 frame:0
             TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:25567 (24.9 KiB)  TX bytes:3940 (3.8 KiB)

So no IP address, and no joy. ifup eth2 brings me back to:

eth2      Link encap:Ethernet  HWaddr 00:02:C9:29:64:8F
             inet addr:10.10.0.1  Bcast:10.10.255.255  Mask:255.255.0.0
             inet6 addr: fe80::2:c900:129:648f/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
             RX packets:104 errors:0 dropped:0 overruns:0 frame:0
             TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
             RX bytes:25567 (24.9 KiB)  TX bytes:6493 (6.3 KiB)

Ideas?

-- 
Joakim Ziegler  -  Supervisor de postproducción  -  Terminal
joakim at terminalmx.com   -   044 55 2971 8514   -   5264 0864