Wednesday 12 March 2014

Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning). SOLVED!!!

I have few Debian servers. (Debian GNU/Linux 6.0 \n \l )

Recently, I had demand to add another ethernet card and assign IP to it. No big deal, right? Right!

But ...

This was my network configuration

-# cat /etc/network/interfaces
 

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1


So I just append configuration for eth1.

allow-hotplug eth1
iface eth1 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0       



And normally restart network and than ......

#/etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).

and than nothing. Both interface were down. I manually bring then up

#ifup eth0
#ifup eth1

And that worked just fine. I was able to connect thru both IP addresses.
But when I try to restart network using /etc/init.d/networking restart same thing occurred. That was strange because they read same configuration file but from some reason restart do not work and ifup works.

Hm....

After 30 minutes of googling ....

Running either /etc/init.d/networking restart or invoke-rc.d networking restart would run: # ifdown -a
then
# ifup -a

The problem is that ifdown -a will bring down all network interfaces, whereas ifup -a will only bring up any network devices in /etc/network/interfaces that are set to auto, anything with allow-hotplug won't be bought back up until it detects a hotplug event, usually when a network cable is plugged in.

So I add

auto eth0

and

auto eth1

And now /etc/init.d/networking start/restart works fine!!!

No comments: