Impossible to add good network values "Validation failed: IP address can't be the network or broadcast address" - OVH (ESXI/Proxmox) with screenshots

@GG_jr: You can look here the configuration with ESXI and Proxmox VE:

The “IP_FAILOVER” for VM is linked to MAC Address of the VM, it is not same than ESXI/Proxmox VE (main IP is for server management).

Example of dedicated server (ESXI or Proxmox VE):

  • IP: 195.XXX.XXX.XXX
  • Gateway: 195.XXX.XXX.254

VM (number 1, etc):

  • IP_FAILOVER: 100.XXX.XXX.XXX
  • Gateway: 195.XXX.XXX.254
  • Netmask: 255.255.255.255

It is: 100.XXX.XXX.XXX/32.

These just aren’t valid. The netmask isn’t valid at all (you have to leave at least 2 bits for the “host” portion of the address, so 252 is the highest valid value for the last octet), it’s unlikely the IP address is valid (unless you’re on a subnet larger than Class C), and the IP and its gateway both need to be in the same subnet (which is literally impossible with the subnet mask you’ve given). Either OVH gave you bogus information, you misunderstood what they gave you, or you’ve redacted it in such a way that makes it impossible to understand what’s happening.

Edit: Why are you posting links to information on configuring ESXi and Proxmox? Neither of those appears to be relevant to what you’re trying to do in Nethserver.

1 Like

The configuration specified by OVH is good.

The problem in NethServer is not new, example here:

I use both VMWare and Proxmox, on both platforms having several NethServer VMs, and I have never encountered the problem reported by you.

I try to explain you the difference between main dedicated server IP (ESXI/Proxmox) for management and VM (like NethServer) IP and I have shown you the details of the VM configuration specified in OVH docs (RedHat/CentOS) with IP/GW/NR…

@danb35, @GG_jr: CentOS VM configuration details:

You can see other people with the problem here:

The problem is that the Cockpit Dashboard - Network section can not permit to add the configuration, screenshots previously here:

When we edit manually (without Cockpit Dashboard), it works (but it is modified by NethServer when we update/change other settings) after manually edition of /etc/sysconfig/network-scripts/ifcfg-ensXXX and creation of /etc/sysconfig/network-scripts/route-ensXXX.

These instructions don’t say to use a .0 IP address for your VM, nor do they say to use a /32 subnet mask.

IMO, this has nothing to do with installing NethServer on OVH, just configuring NIC on NethServer.
I think you are facing two different problems.

Of course, all “IP_FAILOVER” from OVH is possible, it is automatically generated after new IP payement.
The problem is not the IP but the configuration is impossible in Cockpit Dashboard - Network.

When we do a manual edition of file, it works but it is remove when we change settings, updates, …

Yes, it is. A .0 IP (on a Class C or smaller subnet) means it’s a network address, not a host address. That’s why Cockpit is (rightly) refusing to use it.

It does not work with Cockpit Dashboard - Network but it works if we edit manually files but it is removed when we change settings, updates, …

It is same with XXX.XXX.XXX.1.

The problem is the IP is not on the same gateway.

Example:

  • IP: 1.2.3.4
  • Gateway: 1.2.3.254 works
  • Gateway: 5.6.7.8 does not work

@filippo_carletti: I have seen that you have worked on a part of this problem previously, maybe you can add a feature to have the good network in all place (Cockpit Dashboard - Network and /etc/sysconfig/network-scripts/ifcfg-ensXXX) and the route /etc/sysconfig/network-scripts/route-ensXXX?

In this case, the network card is ensXXX but it can be ethX etc.

For the first part, I think that the solution will be to add:
A feature to accept an IP address with a gateway in another range.

Maybe you can add the “HWADDR” form too?

Please check that your setup is working fine using the network configuration database (using your example data):

db networks setprop ensXXX gateway 5.6.7.8
signal-event interface-update

Thanks for your reply!

db networks setprop ensXXX role red and db networks setprop ensXXX gateway 5.6.7.8 work and without signal-event interface-update

Screenshots:

Note: 192.168.1.1 and 255.255.255.0 are always in Cockpit Dashboard - Network instead of the good IP and the 255.255.255.255 specified in files.

@filippo_carletti: This line works perfectly, for example:
db networks set ensXXX ethernet role red hwaddr XX:XX:XX:XX:XX:XX ipaddr XX.XXX.XXX.0 netmask 255.255.255.255 gateway XXX.XXX.XXX.254 onboot yes bootproto none nm_controlled no userctl no ipv6init no peerdns no arp yes name ensXXX defroute yes

The /etc/sysconfig/network-scripts/ifcfg-ensXXX has all lines.

After a signal-event interface-update, the connection is down, the route has been removed, I create again with vi /etc/sysconfig/network-scripts/route-ensXXX and it works:

GATEWAY_IP dev ensXXX
default via GATEWAY_IP dev ensXXX

Screenshots:

The problem is in Cockpit Dashboard - Network, how it is possible to solve the main bug (Validation failed: IP address can't be the network or broadcast address) and add the feature for OVH (and other ISP) by default without manual modifications/adding?

Maybe I am the one noob/ignorant here, but… for what i know about routing, the interface is right. The gateway cannot be reached with that kind of IP/Subnet.
However… I never managed something similar for network connection.

And also, I don’t know if a manually configuration put into eSmith/Nethserver db could override data verification and been correctly applied.

@filippo_carletti: I have found one bug!

The IP is not in /etc/hosts but it works.

Please, list in detail all the steps needed to reproduce the bug.

@filippo_carletti: I have done several tests, I give you the process:

1/ Bug with Cockpit Dashboard Network: Impossible to select the good IP Address / Netmask / Gateway (Validation failed: IP address can't be the network or broadcast address.) and other options (there is only IP address / Netmask / Gateway / Label (optional)).

2/ Bug with the core: The /etc/sysconfig/network-scripts/route-ensXX1 manually route file is removed, I have found to add a “manual” action but it must be “automatic”.


In ESXI, for the NethServer VM:
2 virtual network cards, one for WAN with MAC Address, one for LAN.

Install NethServer “without connection”, after it, connect with root account in console.

WAN:

db networks set ensXX1 ethernet role red hwaddr AB:CD:EF:GH:IJ:KL
 ipaddr XXX.XXX.XXX.XXX netmask 255.255.255.255 gateway YYY.YYY.YYY.254
 onboot yes bootproto none nm_controlled no userctl no
 ipv6init no peerdns no arp yes
 name ensXX1 defroute yes

signal-event interface-update

LAN:

db networks set ensXX2 ethernet role green
 ipaddr 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.254
 name ensXX2

signal-event interface-update


There is a problem: ip route show:

default via 192.168.1.254 dev ensXX2
192.168.1.0/24 dev ensXX2 proto kernel scope link src 192.168.1.1

It is in the code:

I have done for ensXX1 configuration: defroute yes.

Now, I must to create an action, the ip route del default must not be in this file…

vi /etc/e-smith/events/actions/ovh-route

#!/bin/bash

ip route del default

GATEWAY_VM=YYY.YYY.YYY.254
INTERFACE=ensXX1

cat > /etc/sysconfig/network-scripts/route-$INTERFACE << EOF
$GATEWAY_VM dev $INTERFACE
default via $GATEWAY_VM dev $INTERFACE
EOF

ln -sf /etc/e-smith/events/actions/ovh-route /etc/e-smith/events/static-routes-save/S33ovh-route

chmod 0554 /etc/e-smith/events/static-routes-save/S33ovh-route
chown root:root /etc/e-smith/events/static-routes-save/S33ovh-route

signal-event interface-update

ip route show:

default via YYY.YYY.YYY.254 dev ensXX1
YYY.YYY.YYY.254 dev ensXX1 scope link
192.168.1.0/24 dev ensXX2 proto kernel scope link src 192.168.1.1

First Cockpit Dashboard connection:
→ FQDN
→ Organization settings
→ Updates