[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /etc/init.d/networking does not start everything in /etc/network/interfaces



On Wed 18 May 2016 at 10:56:01 (-0400), Gene Heskett wrote:
> On Wednesday 18 May 2016 07:31:34 Lisi Reisz wrote:
> 
> > On Tuesday 17 May 2016 18:29:36 Elimar Riesebieter wrote:
> > > * Gilles Mocellin <gilles.mocellin@nuagelibre.org> [2016-05-17 19:09 
> +0200]:
> > > > Le 17/05/2016 à 14:34, Mimiko a écrit :
> > > > > On 17.05.2016 15:16, Elimar Riesebieter wrote:
> > > > > > Ask your search engine: "init.d/networking restart is
> > > > > > deprecated"
> > > > >
> > > > > This was the only tool to fully restart all networking even the
> > > > > interface thru which connection is made.
> > > > > Are the `ifdown eth & ifup eth` the only option now?
> > > >
> > > > Just to add these commands in that thread.
> > > >
> > > > To restart all the interfaces as they are defined in
> > > > /etc/network/interfaces, I do :
> > > >
> > > > # ifdown -a; ifup -a
> > >
> > > /etc/init.d/networking stop does ifdown -a
> > > /etc/init.d/networking start does ifup -a
> >
> > But
> > # ifdown -a; ifup -a
> > is much more elegant!!
> >
> > Lisi
> 
> If it worked, but no one, including me, has found where the database of 
> devices the -a is supposed to manage.  Apparently this is written at 
> boot time. And I have no reason to reboot.
> 
> But if some kind soul knows where this database is, or knows of a utility 
> that would update it once I have enabled the 2nd RJ45 jack as eth1, now 
> that will get a hearty thank you and a tip of my hat in his/her 
> direction.   And in terms of hand editing a file, it looks 
> like /etc/network/run/ifstate may be that file. It currently contains:
> lo=lo
> eth0=eth0
> so I fired up a root editor and added it. But a sudo service networking 
> restart failed, and erased my hand edit from that file.
> 
> Snips from the verbose output of the restart:
> Configuring interface eth1=eth1 (inet)
> run-parts --verbose /etc/network/if-down.d
> run-parts: executing /etc/network/if-down.d/avahi-autoipd
> run-parts: executing /etc/network/if-down.d/clamav-freshclam-ifupdown
> run-parts: executing /etc/network/if-down.d/upstart
> run-parts: executing /etc/network/if-down.d/wpasupplicant
>  ip route del default via 192.168.1.1  dev eth1 2>&1 1>/dev/null || true 
> RTNETLINK answers: No such process

According to your routing table, the default route doesn't go through
dev eth1, so that line can't work.

(> 0.0.0.0        192.168.71.1   0.0.0.0       UG    0      0      0   eth0)

> ip -4 addr flush dev eth1 label eth1
> ip link set dev eth1 down
> 
> So that looks like it worked.  Later;
> Configuring interface eth1=eth1 (inet)
> run-parts --verbose /etc/network/if-pre-up.d
> run-parts: executing /etc/network/if-pre-up.d/wireless-tools
> run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
> ip addr add 192.168.1.3/255.255.255.0 broadcast 192.168.1.255 	  dev eth1 
> label eth1
> ip link set dev eth1   up
>  ip route add default via 192.168.1.1  dev eth1 
> RTNETLINK answers: File exists

According to your routing table, the default route is already set up,
so yoou can't have another one.

(> 0.0.0.0        192.168.71.1   0.0.0.0       UG    0      0      0   eth0)

> Failed to bring up eth1.
> 
> But.....  that router is still connected
> gene@coyote:/etc/udev/rules.d$ ping 192.168.1.1
> PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
> 64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.831 ms
> 64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.340 ms
> 64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.342 ms
> 64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=0.347 ms
> 64 bytes from 192.168.1.1: icmp_req=5 ttl=64 time=0.480 ms
> 64 bytes from 192.168.1.1: icmp_req=6 ttl=64 time=0.287 ms
> ^C
> --- 192.168.1.1 ping statistics ---
> 6 packets transmitted, 6 received, 0% packet loss, time 4999ms
> rtt min/avg/max/mdev = 0.287/0.437/0.831/0.187 ms
> 
> So despite the apparent failure, which seems to cause RTNETLINK to 
> excrete the bogus fail message, and remove the eh1=eth1 from the ifstate 
> file, it does work, but adding that line to the ifstate file everytime 
> sure seems like the wrong way. FWIW that file is a link, 
> to /var/run/network/ifstate.  And its date is updated when networking 
> restart is executed.
> 
> RTNETLINK cannot find it going either way. But at least networking can 
> find it, one time only.  And that is about as close to the bug as I can 
> get, and thats not close enough to fix it.  Somebody else's turn if 
> they've a mind to.
> 
> The real failure seems to be:
> (why the leading space?)
>  ip route del default via 192.168.1.1  dev eth1 2>&1 1>/dev/null || true
> 
> which if repeated from a root account, should I think, delete that route 
> from the routing table, but it does not, the address remains:
> 
> root@coyote:/etc/network# ip route del default via 192.168.1.1  dev eth1
> RTNETLINK answers: No such process
> root@coyote:/etc/network# route -n
> Kernel IP routing table
> Destination    Gateway        Genmask       Flags Metric Ref    Use Iface
> 0.0.0.0        192.168.71.1   0.0.0.0       UG    0      0      0   eth0
> 169.254.0.0    0.0.0.0        255.255.0.0   U     1000   0      0   eth0
> 192.168.1.0    0.0.0.0        255.255.255.0 U     0      0      0   eth1
> 192.168.71.0   0.0.0.0        255.255.255.0 U     0      0      0   eth0
> 
> And the route to 1.0 remains, and the router is still pingable. I am 
> seeing that sockets led on the router blink at every ping.
> 
> Now,  for those complaining about my lack of posting the complete 
> interfaces file, here it is:
> --------------------------------------------
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> auto lo eth0 eth1
> 
> # The loopback network interface
> iface lo inet loopback
> address 127.0.0.1
> netmask 255.0.0.0

Agree with Lisi, I've never seen this (though I'm not claiming it's
either wrong or harmful).

> # regular network for coyote.den
> iface eth0 inet static
> address 192.168.71.3
> netmask 255.255.255.0
> gateway 192.168.71.1
> 
> # to access reset routers at 192.168.1.1 on the 2nd cat5 port
> iface eth1 inet static
> address 192.168.1.3
> netmask 255.255.255.0
> gateway 192.168.1.1
> ---------------------thats all folks!-------------

Cheers,
David.


Reply to: