[SOLVED] Problem configuration two interfaces

Issues related to configuring your network
Post Reply
safranero
Posts: 3
Joined: 2021/04/20 09:30:23

[SOLVED] Problem configuration two interfaces

Post by safranero » 2021/04/20 09:38:20

Hello,

I have a kvm container in my Proxmox server with Centos 7 installed.

I have created two network devices with same options.

I configurated two interfaces with different ips in the same network but only works the first. Two ips can't work simultanely. If I down eth0 and up eth1 works eth1.

There are my conf files:

File: ifcfg-eth0

Code: Select all

# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
GATEWAY=31.200.240.161
HWADDR=d6:0a:7f:95:90:16
IPADDR=31.200.240.134
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
File: ifcfg-eth1

Code: Select all

# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth1
GATEWAY=31.200.240.161
HWADDR=3a:ef:bf:f9:88:d9
IPADDR=31.200.240.145
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
The ips are in same network and their gateway is 31.200.240.161.

For example, if I down eth1 and configure alias of eth0 for configure secondary ip, the two ips works simultaneously.

Can you help me?
Last edited by safranero on 2021/04/20 15:09:47, edited 1 time in total.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Problem configuration two interfaces

Post by jlehtone » 2021/04/20 13:01:45

Why? Why do you intentionally want two interfaces to same subnet?

safranero
Posts: 3
Joined: 2021/04/20 09:30:23

Re: Problem configuration two interfaces

Post by safranero » 2021/04/20 13:12:16

Is a good question...

The problem is Proxmox with cloud-init network configuration not permit by default configure aliases of a network device and then I have to create differents devices and configure an ip for each.

In a manual configuration I haven't problem because create alias of eth0:x and works fine. But in this case I can't.

Regards.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Problem configuration two interfaces

Post by jlehtone » 2021/04/20 13:48:34

I have used aliases ... like never.
IP-aliases are an obsolete way to manage multiple IP-addresses/masks per interface. Newer tools such as iproute2 support multiple address/prefixes per interface, but aliases are still supported for backwards compatibility.
The "newer" iproute2 has been around two decades. NetworkManager does support multiple address/prefixes per interface too.

Cloud-init can be controlled to some extent (I override part of config on VMs that I have on OpenStack). Proxmox ... no idea.


Overall, why multiple addresses on same subnet (regardless of interfaces)? That is bothersome even when you have free control.

safranero
Posts: 3
Joined: 2021/04/20 09:30:23

Re: Problem configuration two interfaces

Post by safranero » 2021/04/20 15:09:09

Hello,

Proxmox not permit configure multiple ips in same network by default in web interface. For make this, I should generate a dataset for network configuration by proxmox cli.

Solution for multiple routes in multiple network device:

https://jensd.be/468/linux/two-network-cards-rp_filter

Exactly:

Code: Select all

echo "net.ipv4.conf.all.rp_filter = 2"|sudo tee /etc/sysctl.d/99-rp_filter.conf
Thanks.

Post Reply