Virtual IPs in Buster

Kernels & Hardware, configuring network, installing services

Virtual IPs in Buster

Postby lxdn » 2019-10-09 11:53

Hi there,

Just found out about network aliases syntax change in Buster.
My former working config from Stretch:

Code: Select all
auto lo
iface lo inet loopback

auto enp3s0
allow-hotplug enp3s0
iface enp3s0 inet dhcp


auto enp3s0:0
iface enp3s0:0 inet static
address 192.168.1.2/24


now it looks like this:
Code: Select all
auto lo
iface lo inet loopback

auto enp3s0
allow-hotplug enp3s0
iface enp3s0 inet dhcp


auto enp3s0.0
allow-hotplug enp3s0.0
iface enp3s0.0 inet static
address 192.168.1.2/24


ip link show tells that both interfaces are up, but I am able to send packets only from first physical interface and no ping via 192.168.1.2
Could you please give a hint where to dig?
lxdn
 
Posts: 2
Joined: 2019-10-09 10:42

Re: Virtual IPs in Buster

Postby p.H » 2019-10-09 13:52

1) "IP aliases" are obsolete and have been long before buster. With buster just add multiple addresses to the interface.
2) "Virtual IP" has nothing to do with "IP aliases".
3) enp3s0.0 is neither an IP alias nor a virtual IP, it is a tagged VLAN interface (in VLAN 0), which means it sends and receives frames with a special VLAN ID tag. Normal untagged interfaces ignore such frames. Only interfaces/ports in the same VLAN can communicate with it.
p.H
 
Posts: 1151
Joined: 2017-09-17 07:12

Re: Virtual IPs in Buster

Postby lxdn » 2019-10-09 14:26

p.H, many thanks,

It is weird, but I have tried to make it like this earlier, getting the info from https://wiki.debian.org/NetworkConfigur ... e_manually, and no success. I guess after the network file change I just restarted interfaces with /etc/init.d/networking restart command, then get ip link show output again and see only one interface with one address.

All I had to do is to restart the system and use ip -4 a to discover both IPv4 addresses. So below config is enough to everything works well:
Code: Select all
auto enp3s0
allow-hotplug enp3s0
iface enp3s0 inet dhcp

iface enp3s0 inet static
    address 192.168.1.2/24


Thanks again)
lxdn
 
Posts: 2
Joined: 2019-10-09 10:42

Re: Virtual IPs in Buster

Postby p.H » 2019-10-09 14:59

lxdn wrote:I guess after the network file change I just restarted interfaces with /etc/init.d/networking restart command

Doing this has issues : ifupdown does not keep track of how it configured an interface, so running ifdown or networking restart after changing the interface file may fail to stop the interface properly. Instead you should :
- ifdown the interface(s) you want to modify
- modify /etc/network/interfaces
- ifup the interface(s)

lxdn wrote:ip link show output again and see only one interface with one address.

"ip link" shows only the MAC address. Obviously, there is only one. You must use "ip addr" to show IP addresses.

PS : I would double check the IP addresses after the DHCP lease renewal.
p.H
 
Posts: 1151
Joined: 2017-09-17 07:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable