Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

ethX:0 equivalent in ensX

Writer Matthew Barrera

I'm trying to configure a failover IP in a Ubuntu 16.04 but I have ens3 where it usually was eth0.

Previously I followed this guide and I added to /etc/network/interfaces:

post-up /sbin/ifconfig eth0:X IP.DE.FAIL.OVER netmask 255.255.255.255 broadcast IP.DE.FAIL.OVER post-down /sbin/ifconfig eth0:X down

I tried doing in the terminal (to test):

ifconfig post-up ens3:0 94.23.76.87 netmask 255.255.255.255 broadcast 94.23.76.87

but the result was:

ens3:0: Unknown host

I know this is the new naming but I can't find any documentation on it (even the man ifconfig still uses eth0...

My config file is:

auto lo
iface lo inet loopback
auto ens3
iface ens3 inet dhcp

How should I do this?

3

1 Answer

Try this:

The network card configuration file of Ubuntu system is /etc/network/interfaces.

In the terminal run:

exec sudo -i
cat /etc/network/interfaces

Sample output:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens3
iface ens3 inet dhcp

As you see in the above output, the Interface is DHCP enabled.

To assign an additional address, for example 94.23.76.87/24

Edit file /etc/network/interfaces:

exec sudo -i
nano /etc/network/interfaces

Add additional IP address.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto ens3
iface ens3 inet dhcp
iface ens3 inet static
address 94.23.76.87/24

Save and close the file.

Run the following file to take effect the changes without rebooting:

exec sudo -i
ifdown ens3
ifup ens3
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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