openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
160 stars 131 forks source link

After initial flash, network details get wrongly #258

Closed sivaprabug closed 1 year ago

sivaprabug commented 1 year ago

Describe the bug

After flashing initially we got the wrong Network details conflict between static and DHCP

Environment

evb-ast2600, Not tested in QEMU

Build steps

git clone https://github.com/openbmc/openbmc
cd openbmc
. setup evb-ast2600 ast_2600_build
time bitbake obmc-phosphor-image

To Reproduce

GET -> /redfish/v1/Managers/bmc/EthernetInterfaces/eth0
{
  "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
  "@odata.type": "#EthernetInterface.v1_9_0.EthernetInterface",
  "DHCPv4": {
    "DHCPEnabled": true,
    "UseDNSServers": true,
    "UseDomainName": true,
    "UseNTPServers": true
  },
  "DHCPv6": {
    "OperatingMode": "Stateful",
    "UseDNSServers": true,
    "UseDomainName": true,
    "UseNTPServers": true
  },
  "Description": "Management Network Interface",
  "EthernetInterfaceType": "Physical",
  "FQDN": "evb-ast2600",
  "HostName": "evb-ast2600",
  "IPv4Addresses": [
    {
      "Address": "10.0.96.78",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    }
  ],
  "IPv4StaticAddresses": [
    {
      "Address": "10.0.96.78",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    }
  ],
  "IPv6AddressPolicyTable": [],
  "IPv6Addresses": [
    {
      "Address": "fe80::f067:ffff:fe03:f1b4",
      "AddressOrigin": "LinkLocal",
      "PrefixLength": 64
    },
    {
      "Address": "3001:df24:df25:df26:f067:ffff:fe03:f1b4",
      "AddressOrigin": "SLAAC",
      "PrefixLength": 64
    }
  ],
  "IPv6DefaultGateway": "0:0:0:0:0:0:0:0",
  "IPv6StaticAddresses": [],
  "Id": "eth0",
  "InterfaceEnabled": true,
  "LinkStatus": "LinkUp",
  "MACAddress": "f2:67:ff:03:f1:b4",
  "MTUSize": 1500,
  "Name": "Manager Ethernet Interface",
  "NameServers": [
    "10.0.0.31",
    "10.0.0.32"
  ],
  "SpeedMbps": 1000,
  "StaticNameServers": [],
  "Status": {
    "State": "Enabled"
  }
}

Here DHCPEnabled: true but in IPv4Addresses AddressOrigin is Static Mode

image

In webui-vue:

image

For example setting Static IP for eth1.

{
    "IPv4StaticAddresses": [{
        "Address": "10.0.98.151",
        "SubnetMask": "255.255.224.0",
        "Gateway": "10.0.96.1"
    }, {
        "Address": "10.0.198.153",
        "Gateway": "10.0.96.1",
        "SubnetMask": "255.255.224.0"
    }]
}

In GET call IPv4Addresses array Address value get the Gateway value.

{
  "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth1",
  "@odata.type": "#EthernetInterface.v1_9_0.EthernetInterface",
  "DHCPv4": {
    "DHCPEnabled": false,
    "UseDNSServers": true,
    "UseDomainName": true,
    "UseNTPServers": true
  },
  "DHCPv6": {
    "OperatingMode": "Stateful",
    "UseDNSServers": true,
    "UseDomainName": true,
    "UseNTPServers": true
  },
  "Description": "Management Network Interface",
  "EthernetInterfaceType": "Physical",
  "FQDN": "evb-ast2600",
  "HostName": "evb-ast2600",
  "IPv4Addresses": [
    {
      "Address": "10.0.96.1",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    },
    {
      "Address": "10.0.198.153",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    },
    {
      "Address": "169.254.160.2",
      "AddressOrigin": "IPv4LinkLocal",
      "Gateway": "0.0.0.0",
      "SubnetMask": "255.255.0.0"
    }
  ],
  "IPv4StaticAddresses": [
    {
      "Address": "10.0.96.1",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    },
    {
      "Address": "10.0.198.153",
      "AddressOrigin": "Static",
      "Gateway": "10.0.96.1",
      "SubnetMask": "255.255.224.0"
    }
  ],
  "IPv6AddressPolicyTable": [],
  "IPv6Addresses": [
    {
      "Address": "3001:df24:df25:df26:bcdf:76ff:feff:bfc3",
      "AddressOrigin": "SLAAC",
      "PrefixLength": 64
    },
    {
      "Address": "fe80::bcdf:76ff:feff:bfc3",
      "AddressOrigin": "LinkLocal",
      "PrefixLength": 64
    }
  ],
  "IPv6DefaultGateway": "0:0:0:0:0:0:0:0",
  "IPv6StaticAddresses": [],
  "Id": "eth1",
  "InterfaceEnabled": true,
  "LinkStatus": "LinkUp",
  "MACAddress": "be:df:76:ff:bf:c3",
  "MTUSize": 1500,
  "Name": "Manager Ethernet Interface",
  "NameServers": [
    "10.0.0.31",
    "10.0.0.32"
  ],
  "SpeedMbps": 1000,
  "StaticNameServers": [],
  "Status": {
    "State": "Enabled"
  }
}

Due to this scenario, Gateway IP assigned to IP address Network collapsed

image

Is this a regression

Not verified previously, now only looking at this module.

Expected behavior was

DHCP mode IP addresses AddressOrigin in DHCP mode only Static mode IP addresses AddressOrigin in Static mode only

Kindly help to resolve this issue

edtanous commented 1 year ago

Please fill out the template as requested when filing bugs.

sivaprabug commented 1 year ago

Please fill out the template as requested when filing bugs.

Thanks for the guidance. Followed the requested template .

edtanous commented 1 year ago

@sunharis Can you please take a look at the above?

sunharis commented 1 year ago

@sunharis Can you please take a look at the above?

Sure. Will check.

sunharis commented 1 year ago

@sivaprabug Can you please check if your networkd repo is pointing to the latest master? There is some recent fix for this issue.

https://github.com/openbmc/phosphor-networkd/commit/86c4f44d22fb0a7185dade081f780948b0eecc42

You also need https://github.com/openbmc/phosphor-networkd/commit/c6201207fc8523b3ccc53fa44ad28e44d38af02d

sivaprabug commented 1 year ago

@sivaprabug Can you please check if your networkd repo is pointing to the latest master? There is some recent fix for this issue.

openbmc/phosphor-networkd@86c4f44

You also need openbmc/phosphor-networkd@c620120

Hi @sunharis

Above commit changes available. While setting the second static ip we get the same Gateway ip as the IP Address.

image

sunharis commented 1 year ago

OK. The fix which i mentioned was for After flashing initially we got the wrong Network details conflict between static and DHCP

But the issue you are talking about here is - After patching the static network, you see that it writes the gateway ip value on the address property. Have you checked what values are set at the dbus network objects?

sivaprabug commented 1 year ago

OK. The fix which i mentioned was for After flashing initially we got the wrong Network details conflict between static and DHCP

But the issue you are talking about here is - After patching the static network, you see that it writes the gateway ip value on the address property. Have you checked what values are set at the dbus network objects?

Hi @sunharis

/redfish/v1/Managers/bmc/EthernetInterfaces/eth1

Payload:


{
    "IPv4StaticAddresses": [
        {
            "Address": "10.0.100.20",
            "SubnetMask": "255.255.224.0",
            "Gateway": "10.0.96.1"
        },
        {
            "Address": "10.0.100.21",
            "SubnetMask": "255.255.224.0",
            "Gateway": "10.0.96.1"
        }
    ]
}

Response from GET call:

/redfish/v1/Managers/bmc/EthernetInterfaces/eth1

image

Verified in DBUS :

FYI:

image

image

Webui:

image

raviteja-b commented 1 year ago

@sivaprabug seems this is working as expected, can we close this issue

sivaprabug commented 1 year ago

@sivaprabug seems this is working as expected, can we close this issue

Yes @raviteja-b now working as expected we can close this issue

image