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

Re: Networking: unable to get multi-homed host working in Debian 8



On Tue, Aug 9, 2016 at 8:16 PM, Tom Browder <tom.browder@gmail.com> wrote:
> I have read the current Debian networking docs on the subject
> (https://wiki.debian.org/NetworkConfiguration#iproute2_method).  I
> want to use at least two IPv4 static addresses on the same physical
> NIC.  Following examples I have tried this in my
> "/etc/network/interfaces" file:
...

I have now had success on my test host running Debian  on my local
network.  Below is a working "/etc/network/interfaces" file, but there
are some warnings, notes, and caveats for its use.  Note also the file
is IDENTICAL to the one I asked about originally.  I went down a
rabbit hole because the "service networking restart" command locked me
out of my test host and I couldn't get back in locally because I had
an KVM failure I didn't know about.  Just today I got all working
again.

1. WARNING:   The following command, mentioned in the some networking
docs (like the one mentioned by my server hosting company!!!), caused
a system lock-up and loss of all network contact external to or
internal from the host:

  # service networking restart.

However, a subsequent reboot worked.  That might be impossible or
expensive to do if you do not have direct access (i.e., non-network)
access to the host.

2. CAUTION: I have not tried all the various if* or ip commands on the
test host.  Your mileage may vary.

The "/etc/network/interfaces" file:
=======================

# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
  address 192.168.0.17
  netmask 255.255.255.0
  gateway 192.168.0.1
  dns-nameservers 208.67.222.222   208.67.220.220
  up     ip addr add 192.168.0.18/24 dev $IFACE label $IFACE:0
  down ip addr del  192.168.0.18/24 dev $IFACE label $IFACE:0
  up     ip addr add 192.168.0.19/24 dev $IFACE label $IFACE:1
  down ip addr del  192.168.0.19/24 dev $IFACE label $IFACE:1

RESULTS
=======

Running "sbin/ifconfig" on the test host (with two NICs: one used and
one unused, and the two new alias IPv4s) yields:

eth0      Link encap:Ethernet  HWaddr 00:1d:7d:aa:fa:7b
          inet addr:192.168.0.17  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21d:7dff:feaa:fa7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:735 errors:0 dropped:0 overruns:0 frame:0
          TX packets:749 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:82025 (80.1 KiB)  TX bytes:101457 (99.0 KiB)

eth0:0    Link encap:Ethernet  HWaddr 00:1d:7d:aa:fa:7b
          inet addr:192.168.0.18  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0:1    Link encap:Ethernet  HWaddr 00:1d:7d:aa:fa:7b
          inet addr:192.168.0.19  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
eth1      Link encap:Ethernet  HWaddr 00:15:e9:81:14:b4
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:123 errors:0 dropped:0 overruns:0 frame:0
          TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:49276 (48.1 KiB)  TX bytes:49276 (48.1 KiB)

I can ssh into the test host using all three IPv4s.

NOTES
=====
RECOMMENDATIONS
================

Test network changes on a host that you have direct access to!!!!

Thanks for the help Pascal, and I hope this will help someone else.

Best regards,

-Tom


Reply to: