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)