1

Hi tried different options googling for advice.

As for today I have:

Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial

updated as yesterday

trying to make:

sudo ip address add 192.168.0.7/24 dev enz3   ;  
sudo ip address add 192.168.0.8/24 dev enz3

permanent

I modified the etc/network/interfaces files as:

 # interfaces(5) file used by ifup(8) and ifdown(8)
auto lo 
iface lo inet loopback


iface enz3 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1


auto enz3:1
allow-hotplug enz3:1
iface enz3:1 inet static
address 192.168.0.7
netmask 255.255.255.0
gateway 192.168.0.1

auto enz3:2
allow-hotplug enz3:2
iface enz3:2 inet static
address 192.168.0.8
netmask 255.255.255.0
gateway 192.168.0.1

then I restart network service

systemctl restart networking

I get an error:

xx@xx-VBox:~$ systemctl status  networking.service
networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)

Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
 Active: failed (Result: exit-code) since mer 2019-06-05 12:15:39 CEST; 5s ago
     Docs: man:interfaces(5)
Process: 4423 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=0/SUCCESS)
Process: 4963 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 4959 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclu
Main PID: 4963 (code=exited, status=1/FAILURE)

giu 05 12:15:38 xx-VBox systemd[1]: Starting Raise network interfaces...
giu 05 12:15:38 xx-VBox ifup[4963]: RTNETLINK answers: File exists
giu 05 12:15:38 xx-VBox ifup[4963]: Failed to bring up enz3:2.
giu 05 12:15:39 xx-VBox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
giu 05 12:15:39 xx-VBox systemd[1]: Failed to start Raise network interfaces.
giu 05 12:15:39 xx-VBox systemd[1]: networking.service: Unit entered failed state.
giu 05 12:15:39 xx-VBox systemd[1]: networking.service: Failed with result 'exit-code'.

but nevertheless

ip addr

shows

 enz3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    inet 192.168.0.2/24 brd 192.168.0.255 scope global enz3
       valid_lft forever preferred_lft forever
    inet 192.168.0.7/24 brd 192.168.0.255 scope global secondary enz3:1
       valid_lft forever preferred_lft forever
    inet 192.168.0.8/24 brd 192.168.0.255 scope global secondary enz3:2
       valid_lft forever preferred_lft forever
    inet6 XXXXXXXXXXXXXXXXXXXXXXXXXX scope link 
       valid_lft forever preferred_lft forever

and

ifconfig

shows

  enz3

  enz3:1

  enz3:2

and I am able to connect and visualize apache2 index.html

from oustide for the 192.168.0.2 address default webserver

and for the two virtual hosts webservers at 192.168.0.7 and 192.168.0.8

What Am I missing ? why I am getting the error ? Is something else that wont work with this set up ?

Edit

The system works just to access apache2 webservers: from outside I can access: 192.168.0.02 192.168.0.07 192.168.0.08

from inside (192.168.0.2) I can access: localhost 192.168.0.7 192.168.0.8

but I am not able to ping 192.168.0.2 from outside (192.168.0.3) or surf the net from inside (192.168.0.2). I can ping the host 192.168.0.3 from inside the VM (192.168.0.2 is a VM on VirtualBox)

nslookup dosent work from inside th VM (192.168.0.2)

0

debian manual says

    iproute2 method

Also, ifupdown supports specifying multiple interfaces by repeating iface sections with the same interface name. The key difference from the method described above is that all such sections are treated by ifupdown as just one interface, so user can't add or remove them individually. However, up/down commands, as well as scripts, are called for every section as it used to be.

Note however that this method is dangerous! Certain driver/hardware combinations may sometimes fail to bring the link up if no labels are assigned to the alias interfaces. (Seen this on Debian Wheezy and Jessie with RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 01) auto-negotiating to 10/full. A similar warning from another person exists in the history of this page.)

This /etc/network/interfaces text assigns three IP addresses to eth0.

auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.42/24
    gateway 192.168.1.1

iface eth0 inet static
    address 192.168.1.43/24

iface eth0 inet static
    address 192.168.1.44/24

# adding IP addresses from different subnets is also possible
iface eth0 inet static
    address 10.10.10.14/24

But even using labels (or at least I think I am using them):

    auto enz3
allow-hotplug enz3
iface enz3 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1


iface enz3:1 inet static
    address 192.168.0.7
    netmask 255.255.255.0



iface enz3:2 inet static
    address 192.168.0.8
    netmask 255.255.255.0

I still get the error:

giu 05 17:38:43 dv-VBox systemd[1]: Stopped Raise network interfaces.
giu 05 17:38:43 xx-VBox systemd[1]: Starting Raise network interfaces...
giu 05 17:38:43 xx-VBox ifup[5004]: RTNETLINK answers: File exists
giu 05 17:38:43 xx-VBox ifup[5004]: Failed to bring up enz3.
giu 05 17:38:43 xx-VBox systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
giu 05 17:38:43 xx-VBox systemd[1]: Failed to start Raise network interfaces.
giu 05 17:38:43 xx-VBox systemd[1]: networking.service: Unit entered failed state.
giu 05 17:38:43 xx-VBox systemd[1]: networking.service: Failed with result 'exit-code'.

What Should I try next ?

1
  • See answer 2. Try with managed true or remove network manager – user836049 Jun 5 '19 at 20:39
-1

maybe this is the answer ?

How do I use /etc/network/interfaces instead of network-manager

Not sure is valid for 16.04 too ?

nope

 [ifupdown] 
managed=false

is already there

1
  • Maybe I should try with true – user836049 Jun 5 '19 at 20:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.