Linux Virtual Network Interfaces Go Down When I bring Down eth0:0

h‮ptt‬s://www.lautturi.com
Linux Virtual Network Interfaces Go Down When I bring Down eth0:0

If virtual network interfaces (also known as alias interfaces) go down when you bring down the primary interface (eth0), it is likely because the virtual interfaces are configured to depend on the primary interface.

In Linux, virtual interfaces are created by assigning multiple IP addresses to a single physical interface, using a naming convention such as eth0:0, eth0:1, etc. By default, virtual interfaces depend on the primary interface, meaning that if the primary interface goes down, the virtual interfaces will also go down.

To prevent this behavior, you can configure the virtual interfaces to use a different interface as their primary interface. For example, you can use the ifenslave command to configure the virtual interfaces to use the lo (loopback) interface as their primary interface.

To do this, you can use the following steps:

  1. Bring down the primary interface and the virtual interfaces:
ifdown eth0
ifdown eth0:0
ifdown eth0:1
...
  1. Use the ifenslave command to configure the virtual interfaces to use the lo interface as their primary interface:
ifenslave lo eth0:0
ifenslave lo eth0:1
...
  1. Bring up the primary interface and the virtual interfaces:
ifup eth0
ifup eth0:0
ifup eth0:1
...

This will configure the virtual interfaces to use the lo interface as their primary interface, so they will not go down when you bring down the primary interface (eth0).

By using these steps, you can configure the virtual interfaces to use a different interface as their primary interface, so they will not go down when you bring down the primary interface. You may want to refer to the ifenslave documentation or online resources for more information about the command and its options.

Created Time:2017-10-30 10:17:39  Author:lautturi