openbmc / bmcweb

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

Can't ping to the static IP after disabling DHCP via Redfish #294

Open chnguyen-ampere opened 3 weeks ago

chnguyen-ampere commented 3 weeks ago

Is this the right place to submit this?

Bug Description

I tried to use Redfish command to set a Static IPv4, After that I tried to disable the DHCP then the Static IPv4 is died (can't ping to the Static IPv4)

Step 1 : Check the eth0 interface, It is 10.39.122.87 DHCP4

root@board:~# ip a

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.39.122.87/24 brd 10.39.122.255 scope global dynamic eth0
       valid_lft 41691sec preferred_lft 41691sec
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever

root@board:/# ip ro | grep "eth0"
default via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.38.18.70 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.38.18.71 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.38.20.10 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.39.122.0/24 dev eth0 scope link  src 10.39.122.87  metric 1024
10.39.122.1 dev eth0 scope link  src 10.39.122.87  metric 1024
root@board:~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0
NAME                                              TYPE      SIGNATURE RESULT/VALUE                             FLAGS
org.freedesktop.DBus.Introspectable               interface -         -                                        -
.Introspect                                       method    -         s                                        -
org.freedesktop.DBus.Peer                         interface -         -                                        -
.GetMachineId                                     method    -         s                                        -
.Ping                                             method    -         -                                        -
org.freedesktop.DBus.Properties                   interface -         -                                        -
.Get                                              method    ss        v                                        -
.GetAll                                           method    s         a{sv}                                    -
.Set                                              method    ssv       -                                        -
.PropertiesChanged                                signal    sa{sv}as  -                                        -
xyz.openbmc_project.Collection.DeleteAll          interface -         -                                        -
.DeleteAll                                        method    -         -                                        -
xyz.openbmc_project.Network.EthernetInterface     interface -         -                                        -
.AutoNeg                                          property  b         true                                     emits-change
.DHCP4                                            property  b         true                                     emits-change writable
.DHCP6                                            property  b         true                                     emits-change writable
.DHCPEnabled                                      property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.DefaultGateway                                   property  s         "10.39.122.1"                            emits-change writable
.DefaultGateway6                                  property  s         ""                                       emits-change writable
.DomainName                                       property  as        0                                        emits-change writable
.EmitLLDP                                         property  b         false                                    emits-change writable
.IPv6AcceptRA                                     property  b         true                                     emits-change writable
.InterfaceName                                    property  s         "eth0"                                   const
.LinkLocalAutoConf                                property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.LinkUp                                           property  b         true                                     emits-change
.MTU                                              property  u         1500                                     emits-change writable
.NICEnabled                                       property  b         true                                     emits-change writable
.NTPServers                                       property  as        0                                        emits-change writable
.Nameservers                                      property  as        3 "10.38.20.10" "10.38.18.70" "10.38.... emits-change
.Speed                                            property  u         1000                                     emits-change
.StaticNTPServers                                 property  as        0                                        emits-change writable
.StaticNameServers                                property  as        0                                        emits-change writable
xyz.openbmc_project.Network.IP.Create             interface -         -                                        -
.IP                                               method    ssys      o                                        -
xyz.openbmc_project.Network.MACAddress            interface -         -                                        -
.MACAddress                                       property  s         "88:2b:1e:ed:ad:e0"                      emits-change writable
xyz.openbmc_project.Network.Neighbor.CreateStatic interface -         -                                        -
.Neighbor                                         method    ss        o                                        -
root@board:~# networkctl status 2
* 2: eth0
                   Link File: /usr/lib/systemd/network/99-default.link
                Network File: /etc/systemd/network/00-bmc-eth0.network
                              `-/run/systemd/network/00-bmc-eth0.network.d/updated.conf
                       State: routable (configured)
                Online state: online
                        Type: ether
                        Path: platform-1e660000.ethernet
                      Driver: ftgmac100
            Hardware Address: 88:2b:1e:ed:ad:e0
  Permanent Hardware Address: be:d3:a6:0f:18:ed
                         MTU: 1500 (min: 68, max: 1500)
                       QDisc: pfifo_fast
IPv6 Address Generation Mode: eui64
    Number of Queues (Tx/Rx): 1/1
            Auto negotiation: yes
                       Speed: 1Gbps
                      Duplex: full
                        Port: tp
                     Address: 10.39.122.87 (DHCP4 via 10.39.200.10)
                              fe80::9ec2:c4ff:fe53:7d77
                     Gateway: 10.39.122.1
                         DNS: 10.38.20.10
                              10.38.18.70
                              10.38.18.71
              Search Domains: domain-platform.com
           Activation Policy: up
         Required For Online: yes
             DHCP4 Client ID: 88:2b:1e:ed:ad:e0
           DHCP6 Client DUID: DUID-EN/Vendor:0000ab11d51e3bc286783f91
                Connected To: SwitchF97DB2 on port gi14

Step 2 : Set a static IP (10.39.122.90) when DCHP is Enabled and print eth0 interface

curl -X PATCH --user root:0penBmc -H "Content-Type: application/json" -H "If-match: *" --insecure https://10.39.122.87/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -d '{"IPv4StaticAddresses": [{"Address": "10.39.122.90", "Gateway": "10.39.122.1", "SubnetMask": "255.255.255.0"}]}'
root@board:~# ip a

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.39.122.90/24 brd 10.39.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.39.122.87/24 brd 10.39.122.255 scope global secondary dynamic eth0
       valid_lft 43199sec preferred_lft 43199sec
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever

root@board:/# ip ro | grep "eth0"
default via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024 
10.38.18.70 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.38.18.71 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.38.20.10 via 10.39.122.1 dev eth0  src 10.39.122.87  metric 1024
10.39.122.0/24 dev eth0 scope link  src 10.39.122.90
10.39.122.1 dev eth0 scope link  src 10.39.122.87  metric 1024
root@board:~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0
NAME                                              TYPE      SIGNATURE RESULT/VALUE                             FLAGS
org.freedesktop.DBus.Introspectable               interface -         -                                        -
.Introspect                                       method    -         s                                        -
org.freedesktop.DBus.Peer                         interface -         -                                        -
.GetMachineId                                     method    -         s                                        -
.Ping                                             method    -         -                                        -
org.freedesktop.DBus.Properties                   interface -         -                                        -
.Get                                              method    ss        v                                        -
.GetAll                                           method    s         a{sv}                                    -
.Set                                              method    ssv       -                                        -
.PropertiesChanged                                signal    sa{sv}as  -                                        -
xyz.openbmc_project.Collection.DeleteAll          interface -         -                                        -
.DeleteAll                                        method    -         -                                        -
xyz.openbmc_project.Network.EthernetInterface     interface -         -                                        -
.AutoNeg                                          property  b         true                                     emits-change
.DHCP4                                            property  b         true                                     emits-change writable
.DHCP6                                            property  b         true                                     emits-change writable
.DHCPEnabled                                      property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.DefaultGateway                                   property  s         "10.39.122.1"                            emits-change writable
.DefaultGateway6                                  property  s         ""                                       emits-change writable
.DomainName                                       property  as        0                                        emits-change writable
.EmitLLDP                                         property  b         false                                    emits-change writable
.IPv6AcceptRA                                     property  b         true                                     emits-change writable
.InterfaceName                                    property  s         "eth0"                                   const
.LinkLocalAutoConf                                property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.LinkUp                                           property  b         true                                     emits-change
.MTU                                              property  u         1500                                     emits-change writable
.NICEnabled                                       property  b         true                                     emits-change writable
.NTPServers                                       property  as        0                                        emits-change writable
.Nameservers                                      property  as        3 "10.38.20.10" "10.38.18.70" "10.38.... emits-change
.Speed                                            property  u         1000                               .StaticNameServers                                property  as        0                                        emits-change writable
xyz.openbmc_project.Network.IP.Create             interface -         -                                        -
.IP                                               method    ssys      o                                        -
xyz.openbmc_project.Network.MACAddress            interface -         -                                        -
.MACAddress                                       property  s         "88:2b:1e:ed:ad:e0"                      emits-change writable
xyz.openbmc_project.Network.Neighbor.CreateStatic interface -         -                                        -
.Neighbor                                         method    ss        o                                        -
root@board:~# networkctl status 2
* 2: eth0
                   Link File: /usr/lib/systemd/network/99-default.link
                Network File: /etc/systemd/network/00-bmc-eth0.network
                              `-/run/systemd/network/00-bmc-eth0.network.d/updated.conf
                       State: routable (configured)
                Online state: online
                        Type: ether
                        Path: platform-1e660000.ethernet
                      Driver: ftgmac100
            Hardware Address: 88:2b:1e:ed:ad:e0
  Permanent Hardware Address: be:d3:a6:0f:18:ed
                         MTU: 1500 (min: 68, max: 1500)
                       QDisc: pfifo_fast
IPv6 Address Generation Mode: eui64
    Number of Queues (Tx/Rx): 1/1
            Auto negotiation: yes
                       Speed: 1Gbps
                      Duplex: full
                        Port: tp
                     Address: 10.39.122.87 (DHCP4 via 10.39.200.10)
                              10.39.122.90
                              fe80::9ec2:c4ff:fe53:7d77
                     Gateway: 10.39.122.1
                         DNS: 10.38.20.10
                              10.38.18.70
                              10.38.18.71
              Search Domains: domain-platform.com
           Activation Policy: up
         Required For Online: yes
             DHCP4 Client ID: 88:2b:1e:ed:ad:e0
           DHCP6 Client DUID: DUID-EN/Vendor:0000ab11d51e3bc286783f91
                Connected To: SwitchF97DB2 on port gi14

Step 3 : Test the static IP (10.39.122.90) just allocated. Ping to static IP from other machine.

chanh@HCM ~ % ping 10.39.122.90
PING 10.39.122.90 (10.39.122.90): 56 data bytes
64 bytes from 10.39.122.90: icmp_seq=0 ttl=63 time=19.019 ms
64 bytes from 10.39.122.90: icmp_seq=1 ttl=63 time=16.297 ms
64 bytes from 10.39.122.90: icmp_seq=2 ttl=63 time=13.962 ms
64 bytes from 10.39.122.90: icmp_seq=3 ttl=63 time=16.509 ms
64 bytes from 10.39.122.90: icmp_seq=4 ttl=63 time=16.139 ms
^C
--- 10.39.122.90 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 13.962/16.385/19.019/1.606 ms

Step 4 : Disable the DHCP and print eth0 interface

curl -X PATCH --user root:0penBmc -H "Content-Type: application/json" -H "If-match: *" --insecure https://10.39.122.90/redfish/v1/Managers/bmc/EthernetInterfaces/eth0 -d '{"DHCPv4": {"DHCPEnabled": false}}'
root@board:~# ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 169.254.116.73/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet 10.39.122.90/24 brd 10.39.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever

root@board:/# ip ro | grep "eth0"
10.39.122.0/24 dev eth0 scope link  src 10.39.122.90
169.254.0.0/16 dev eth0 scope link  src 169.254.64.89  metric 2048
~# busctl introspect xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0
NAME                                              TYPE      SIGNATURE RESULT/VALUE                             FLAGS
org.freedesktop.DBus.Introspectable               interface -         -                                        -
.Introspect                                       method    -         s                                        -
org.freedesktop.DBus.Peer                         interface -         -                                        -
.GetMachineId                                     method    -         s                                        -
.Ping                                             method    -         -                                        -
org.freedesktop.DBus.Properties                   interface -         -                                        -
.Get                                              method    ss        v                                        -
.GetAll                                           method    s         a{sv}                                    -
.Set                                              method    ssv       -                                        -
.PropertiesChanged                                signal    sa{sv}as  -                                        -
xyz.openbmc_project.Collection.DeleteAll          interface -         -                                        -
.DeleteAll                                        method    -         -                                        -
xyz.openbmc_project.Network.EthernetInterface     interface -         -                                        -
.AutoNeg                                          property  b         true                                     emits-change
.DHCP4                                            property  b         false                                    emits-change writable
.DHCP6                                            property  b         true                                     emits-change writable
.DHCPEnabled                                      property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.DefaultGateway                                   property  s         ""                                       emits-change writable
.DefaultGateway6                                  property  s         ""                                       emits-change writable
.DomainName                                       property  as        0                                        emits-change writable
.EmitLLDP                                         property  b         false                                    emits-change writable
.IPv6AcceptRA                                     property  b         true                                     emits-change writable
.InterfaceName                                    property  s         "eth0"                                   const
.LinkLocalAutoConf                                property  s         "xyz.openbmc_project.Network.Ethernet... emits-change writable
.LinkUp                                           property  b         true                                     emits-change
.MTU                                              property  u         1500                                     emits-change writable
.NICEnabled                                       property  b         true                                     emits-change writable
.NTPServers                                       property  as        0                                        emits-change writable
.Nameservers                                      property  as        0                                        emits-change
.Speed                                            property  u         1000                                     emits-change
.StaticNTPServers                                 property  as        0                                        emits-change writable
.StaticNameServers                                property  as        0                                        emits-change writable
xyz.openbmc_project.Network.IP.Create             interface -         -                                        -
.IP                                               method    ssys      o                                        -
xyz.openbmc_project.Network.MACAddress            interface -         -                                        -
.MACAddress                                       property  s         "88:2b:1e:ed:ad:e0"                      emits-change writable
xyz.openbmc_project.Network.Neighbor.CreateStatic interface -         -                                        -
.Neighbor                                         method    ss        o                                        -
~# networkctl status 2
* 2: eth0
                   Link File: /usr/lib/systemd/network/99-default.link
                Network File: /etc/systemd/network/00-bmc-eth0.network
                              `-/run/systemd/network/00-bmc-eth0.network.d/updated.conf
                       State: routable (configured)
                Online state: online
                        Type: ether
                        Path: platform-1e660000.ethernet
                      Driver: ftgmac100
            Hardware Address: 88:2b:1e:ed:ad:e0
  Permanent Hardware Address: be:d3:a6:0f:18:ed
                         MTU: 1500 (min: 68, max: 1500)
                       QDisc: pfifo_fast
IPv6 Address Generation Mode: eui64
    Number of Queues (Tx/Rx): 1/1
            Auto negotiation: yes
                       Speed: 1Gbps
                      Duplex: full
                        Port: tp
                     Address: 10.39.122.90
                              169.254.116.73
                              fe80::9ec2:c4ff:fe53:7d77
           Activation Policy: up
         Required For Online: yes
           DHCP6 Client DUID: DUID-EN/Vendor:0000ab11d51e3bc286783f91
                Connected To: SwitchF97DB2 on port gi14

Step 5 : Test the static IP (10.39.122.90). Ping to static IP from other machine

~ % ping 10.39.122.90
PING 10.39.122.90 (10.39.122.90): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
^C
--- 10.39.122.90 ping statistics ---
6 packets transmitted, 0 packets received, 100.0% packet loss

Expectation: At step 5, I can ping to the static IP. Actually: At step 5, I can't ping to the static IP.

Version

The bmcweb version:
SRCREV = "02ea923f13de196726ac2f022766a6f80bee1c0a"

Additional Information

Other observations:

  1. From step 4 logs, We can see the DefaultGateway is empty after we disable the DHCP by Redfish command.
  2. After step 4, If I set again the DefaultGateway value by dbus command, then the static IP will work fine.
    busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.EthernetInterface DefaultGateway s "10.39.122.1"
  3. Follow the document https://github.com/openbmc/phosphor-networkd/blob/master/docs/Network-Configuration.md#configure-dhcp, I tried to disable DHCP by the dbus command; then the issue doesn't happen
  4. I tried to trace the bmcweb's history, I saw my issue happens after the https://github.com/openbmc/bmcweb/commit/743eb1c0cb44c955078daa2912767cd6d6bb6432#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408 commit merged.
chnguyen-ampere commented 2 weeks ago

Hi all, I'm looking forward to receiving any comments from everyone on my issue. I wonder if I missed anything in the Bug Description.

wangmin239 commented 2 weeks ago

Try deleting the IP address '169.254.116.73', then test the ping command.

mdmillerii commented 2 weeks ago

Is your ping from the same subnet as the device? Did you assign a static default gateway or were you using one from DHCP while it was configured?

I see the interface address has net mask/24

chnguyen-ampere commented 2 weeks ago

Try deleting the IP address '169.254.116.73', then test the ping command.

Hi @wangmin239 ; After step 4, I tried to delete the IP address 169.254.124.108 but The operation is not allowed error.

root@board:~# ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 169.254.124.108/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet 10.39.122.90/24 brd 10.39.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever

root@board:~# busctl tree xyz.openbmc_project.Network | grep "eth0"
      |- /xyz/openbmc_project/network/eth0
      | |- /xyz/openbmc_project/network/eth0/_310_2e39_2e122_2e90_2f24
      | |- /xyz/openbmc_project/network/eth0/_3169_2e254_2e124_2e108_2f16
      | |- /xyz/openbmc_project/network/eth0/_66e80_3a_3a9ec2_3ac4ff_3afe53_3a7d77_2f64
      | |- /xyz/openbmc_project/network/eth0/dhcp4
      | `- /xyz/openbmc_project/network/eth0/dhcp6

root@board:~# busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0/_3169_2e254_2e124_2e108_2f16 xyz.openbmc_project.Object.Delete Delete
Call failed: The operation is not allowed
chnguyen-ampere commented 2 weeks ago

Is your ping from the same subnet as the device?

Yes, In step 5, I'm pinging from another subnet as the device.

Did you assign a static default gateway or were you using one from DHCP while it was configured?

As you saw at step 2, I assigned a static default gateway 10.39.122.1

I see the interface address has net mask/24

Yes, at step 2, I assigned a "SubnetMask" is "255.255.255.0"

mdmillerii commented 2 weeks ago

I don't see where you report the IPv4 route table.

The commit you mentioned

  1. I tried to trace the bmcweb's history, I saw my issue happens after the 743eb1c#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408 commit merged. Talks about removing the static route when deleting the static IPv4 but you
  1. You are finding no static route after deleting DHCP
  2. You didn't print the static route table to establish if a static route was added or just the existing dynamic was available https://www.man7.org/linux/man-pages/man8/ip-route.8.html -- update networkctl does show default gateway going missing
wangmin239 commented 2 weeks ago

@chnguyen-ampere The command 'busctl call' maybe haven't enough privilege to delete ip address. Instead of using 'ifconfig' command to reconfigure the network interface 'eth0'.

chnguyen-ampere commented 2 weeks ago

I don't see where you report the IPv4 route table.

Thank @mdmillerii for your suggestion! I updated ip ro command report in Bug Description , please help me review that!

chnguyen-ampere commented 2 weeks ago

@chnguyen-ampere The command 'busctl call' maybe haven't enough privilege to delete ip address. Instead of using 'ifconfig' command to reconfigure the network interface 'eth0'.

Yes @wangmin239 , I tried to use the ip command to delete the IP address as you mentioned, and still can't ping to the static IP address 10.39.122.90

root@board:~# ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 169.254.222.221/16 brd 169.254.255.255 scope link eth0
       valid_lft forever preferred_lft forever
    inet 10.39.122.90/24 brd 10.39.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever

root@board:~# ip addr del 169.254.222.221/16 dev eth0

root@board:~# ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 88:2b:1e:ed:ad:e0 brd ff:ff:ff:ff:ff:ff
    inet 10.39.122.90/24 brd 10.39.122.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9ec2:c4ff:fe53:7d77/64 scope link
       valid_lft forever preferred_lft forever
wangmin239 commented 2 weeks ago

@chnguyen-ampere It seems like the eth0's SubNetMask should be set '255.255.255.0',while the eth0's inet is '10.39.122.90/16 ' as the log shown.

mdmillerii commented 2 weeks ago

169.254 is for link local addressing and not interfering.

In step 2 the routes are src .87 In step 3 the route was deleted

The gateway add chose the DHCP assigned address and was deleted when that address was. Not sure if assigning a source would have avoided this.

chnguyen-ampere commented 2 weeks ago

In step 2 the routes are src .87 In step 3 the route was deleted

Hi @mdmillerii , Confirm that In step 4 the route was deleted, not step 3

The gateway add chose the DHCP assigned address and was deleted when that address was. Not sure if assigning a source would have avoided this.

 Yes @mdmillerii , Both the DHCP address and static address use the DefaultGateway from /xyz/openbmc_project/network/eth0 object. When the DHCP is disabled, this DefaultGateway property is also removed. That causes the static IP to not work.

When DHCP disable Redfish command is called, the DefaultGateway property will be removed at line https://github.com/openbmc/bmcweb/commit/743eb1c0cb44c955078daa2912767cd6d6bb6432#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408

You can see at Additional Information, If I add again the DefaultGateway property by dbus command, then the static IP will work fine.

chnguyen-ampere commented 1 week ago

Hi all, I would like to propose a solution to improve this situation. When handling the DHCP patch, we should check if any other IPv4 address existed. If there is no IP address, then remove the DefaultGateway.
The code will be implemented at line https://github.com/openbmc/bmcweb/commit/743eb1c0cb44c955078daa2912767cd6d6bb6432#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408

wangmin239 commented 1 week ago

Hi @chnguyen-ampere, Does the patch solve your issue?

then remove the DefaultGateway. 743eb1c#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408

chnguyen-ampere commented 1 week ago

Hi @chnguyen-ampere, Does the patch solve your issue?

then remove the DefaultGateway. 743eb1c#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408

Sorry @wangmin239 , May you confuse my comments. You can refer to the Additional Information section for more detailed information. I tried to trace the bmcweb's history, I saw my issue happens after the https://github.com/openbmc/bmcweb/commit/743eb1c0cb44c955078daa2912767cd6d6bb6432#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408 commit merged.

I would like to propose a solution to improve this situation, When handling the DHCP patch, we should check if any other IPv4 address existed. If there is no IP address, then remove the DefaultGateway.

The code will be implemented at line https://github.com/openbmc/bmcweb/commit/743eb1c0cb44c955078daa2912767cd6d6bb6432#diff-275215f5290a693394a85916c653f04c7cb99163f4d93fc6b1bf39e348d55620R1408

chnguyen-ampere commented 1 week ago

Hi @Howitzer105mm, Do you have any comments on this issue? I wonder if my behavior is correct or not?

wangmin239 commented 1 week ago

@chnguyen-ampere Thanks,I got it.