OpenNebula / one-apps

Toolchain to build OpenNebula appliances
Apache License 2.0
12 stars 9 forks source link

Default gateway is assumed when missing #78

Open OpenNebulaSupport opened 3 months ago

OpenNebulaSupport commented 3 months ago

If a VM has no gateway defined on its NIC configuration, then the gateway is assumed as the .1 number of the last 8 bits of the IP address.

To reproduce

[oneadmin@alma8-context-kvm-6-9-jnks275-0 readiness]$ ssh "192.168.150.100"
Microsoft Windows [Version 10.0.20348.1]
(c) Microsoft Corporation. All rights reserved.

oneadmin@WIN-662E6H8G00Q C:\Users\oneadmin>ipconfig

Windows IP Configuration

Ethernet adapter Ethernet Instance 0 2:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:db8::c0ff:fea8:9664
   IPv6 Address. . . . . . . . . . . : fd00::c0ff:fea8:9664
   Link-local IPv6 Address . . . . . : fe80::c0ff:fea8:9664%6
   IPv4 Address. . . . . . . . . . . : 192.168.150.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 2001:db8::1
                                       192.168.150.1

oneadmin@WIN-662E6H8G00Q C:\Users\oneadmin>exit
Connection to 192.168.150.100 closed.
[oneadmin@alma8-context-kvm-6-9-jnks275-0 readiness]$ onevm show 7 -j | jq .VM.TEMPLATE.CONTEXT.ETH0_GATEWAY
""
[oneadmin@alma8-context-kvm-6-9-jnks275-0 readiness]$ onevm show 7 -j | jq .VM.TEMPLATE.CONTEXT.ETH0_IP
"192.168.150.100"

Culprit