Intel-BMC / openbmc

Other
127 stars 56 forks source link

Failed to configure eth1 IP address #34

Closed mine260309 closed 4 years ago

mine260309 commented 4 years ago

Unexpected behavior you saw With a fresh build, I am unable to configure the IP address of eth1 (NCSI)

Expected behavior It shall be able to configure the IP address of eth1

To Reproduce Steps to reproduce the behavior:

  1. Build and flash a fresh build of Intel-BMC/openbmc on CRB
  2. Boot into OS
  3. Run inband ipmi command to configure the IP:
    ipmitool lan set 1 ipsrc static
    ipmitool lan set 1 ipaddr <ip>
    ipmitool lan set 1 netmask 255.255.255.0
    ipmitool lan set 1 defgw ipaddr <gw-ip>
  4. Wait for a few seconds, check the IP address, it's empty.
    # ipmitool lan print 1
    Set in Progress         : Set Complete
    Auth Type Support       :
    Auth Type Enable        : Callback :
                            : User     :
                            : Operator :
                            : Admin    :
                            : OEM      :
    IP Address Source       : Static Address
    IP Address              : 0.0.0.0
    Subnet Mask             : 255.255.255.255
    MAC Address             : <mac>
    Default Gateway IP      : 0.0.0.0
    Default Gateway MAC     : 00:00:00:00:00:00
    802.1q VLAN ID          : Disabled
    RMCP+ Cipher Suites     : 3,17
    Cipher Suite Priv Max   : Not Available
    Bad Password Threshold  : Not Available
  5. Connect BMC debug UART, configure the IP with dbus:
    root@intel-obmc:~# busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/eth1 xyz.openbmc_project.Network.IP.Create IP ssys "xyz.openbmc_project.Network.IP.Protocol.IPv4" "<ip>" 24 "<gw-ip>"
    o "/xyz/openbmc_project/network/eth1/ipv4/88e39147"

    The DBus call itself succeds, but the IP is not correctly configured, and after a few seconds, the D-Bus object /xyz/openbmc_project/network/eth1/ipv4/88e39147 disappears.

OpenBMC Information: The master of Intel-BMC/openbmc (55c31e54d)

cjia4 commented 4 years ago

Please also provide the CRB BIOS version.

mine260309 commented 4 years ago

BIOS Revision: WLYDCRB1.SYS.0015.D62.2003060128

kuiyingw commented 4 years ago

"MAC Address : " There is no MAC in your platform.

  1. currently, if there is no MAC in chip, it should be random. https://github.com/openbmc/linux/blob/dev-5.3/drivers/net/ethernet/faraday/ftgmac100.c#L211
  2. you also could set static mac. https://github.com/Intel-BMC/openbmc/blob/0f1b8401f7058fc88fbcf06c7e98c5ebadc23212/meta-openbmc-mods/meta-common/recipes-network/network/static-mac-addr/mac-check
kuiyingw commented 4 years ago

I double checked in my side. Don't find such issue. System is working well.

_root@intel-obmc:~# udhcpc -i eth1 udhcpc: started, v1.31.0 udhcpc: sending discover udhcpc: sending select for REMOVED-IP-ADDR udhcpc: lease of REMOVED-IP-ADDR obtained, lease time 21600 /etc/udhcpc.d/50default: Adding DNS xx.xx.2.5 /etc/udhcpc.d/50default: Adding DNS xx.xx.xx.228 /etc/udhcpc.d/50default: Adding DNS xx.xx.xx.xx root@intel-obmc:~# ifconfig eth0 Link encap:Ethernet HWaddr AE:58:5B:45:A6:6F inet addr:REMOVED-IP-ADDR Bcast:REMOVED-IP-ADDR Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1829 errors:0 dropped:123 overruns:0 frame:0 TX packets:209 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:195566 (190.9 KiB) TX bytes:33231 (32.4 KiB) Interrupt:19

eth1 Link encap:Ethernet HWaddr 32:48:3A:53:99:52 inet addr:REMOVED-IP-ADDR Bcast:REMOVED-IP-ADDR Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2016 errors:0 dropped:119 overruns:0 frame:0 TX packets:516 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:204086 (199.3 KiB) TX bytes:53067 (51.8 KiB) Interrupt:20_

NOTE: 1. Please remove asd, your met build issue. https://github.com/Intel-BMC/openbmc/blob/intel/meta-openbmc-mods/meta-common/classes/obmc-phosphor-image-common.bbclass#L14

  1. Please make sure using the correct config based your CRB platform, take wht for example. export TEMPLATECONF=meta-openbmc-mods/meta-wht/conf/ Please remove the whole build folder if you changed the config.
  2. Please make the drive working well. root@intel-obmc:~# cat /sys/class/net/eth1/address 32:48:3a:53:99:52
mine260309 commented 4 years ago

OK, will try to clean the build dir and try a clean build.

From your log, both eth0 and eth1 are connected. Please be noted that this issue occurs when only eth1 (NCSI) is connected, while eth0 is disconnected.

kuiyingw commented 4 years ago

Still working well, even disconnect the eth0. BTW: Please make sure your system could get MAC address correctly.

mine260309 commented 4 years ago

What I observe is that the issue occurs on both eth0 and eth1. Below is how I reproduce the issue:

  1. Do a factory reset, so that BMC's settings are default
  2. Connect to BMC's debug UART, check the default eth configs:
    # cat /etc/systemd/network/00-bmc-eth1.network
    [Match]
    Name=eth1
    [Link]
    MACAddress=<xxx>
    Unmanaged=yes
    [Network]
    LinkLocalAddressing=yes
    IPv6AcceptRA=false
    DHCP=false
    [DHCP]
    ClientIdentifier=mac
    UseDNS=true
    UseNTP=true
    UseHostname=true
    SendHostname=true

    Be noted Unmanaged=yes is the root cause.

  3. Assign an IP address, e.g.
    # busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/eth1 xyz.openbmc_project.Network.IP.Create IP ssys "xyz.openbmc_project.Network.IP.Protocol.IPv4" 
    "192.168.1.101" 24 "192.168.1.1"

    The expected behavior is that the IP will be added to eth1. But no IP is added. Checking the config:

    # cat /etc/systemd/network/00-bmc-eth1.network
    [Match]
    Name=eth1
    [Link]
    MACAddress=<xxx>
    Unmanaged=yes
    [Network]
    LinkLocalAddressing=yes
    IPv6AcceptRA=false
    DHCP=false
    [Address]
    Address=192.168.1.101/24
    [DHCP]
    ClientIdentifier=mac
    UseDNS=true
    UseNTP=true
    UseHostname=true
    SendHostname=true

    We can see that the IP is correctly written into the config, but due to Unmanaged=yes, systemd-networkd will not use this config file.

kuiyingw commented 4 years ago

Seems there is an issue on setting the static ip addr. You could use DHCP get the ip address. It should not block you.

mine260309 commented 4 years ago

This issue is gone in the update branch, revision d2bd6ff4b Close.