When changing ip df -h command not return

Hello

OS: Oracle Linux 8.6

when i change ip on my server, df -h does not return list

When I give the old ip, it returns df -h work

IP statick

WHY?

Change the IP address? That should not have an impact on the df command.
Can you give an example?
In a triple-backtick paragraph please, like this:

```
  code or output
```

Does the df finish without printing anything, or is it hung?

1 Like

OK, I think it's related to network settings
when i change my ip address new ip comes too late

ifdown ifcfg-ens4f1np1 && ifdown ifcfg-ens4f1np1

and first of all I would like to say,

notlist.

1 Like

not listed ifcfg-ens4f1np1

network-script

Hello,

The only reason that changing your IP would make the output of a df command hang would be if you had some network filesystem mounted prior to the IP change, and after changing the IP you can no longer access that network filesystem. That would cause the output of df to hang, as it would be trying to talk to the remote server and finding that it received no response. That's the most likely explanation I can think of, anyway.

After changing your IP, and re-starting the networking service, are you still able to ping the IP or hostname that your network filesystem is mounted from ? And indeed, could you ping it beforehand on the original IP ? Also, could you try un-mounting and re-mounting your network filesystem after changing your IP, and seeing if that then makes it accessible ?

1 Like

Thank you, ı mounted another server disk using sshfs.

the server gets the new ip but not as fast as my other server makes it wait 40-50 seconds, other server 5-10 seconds

why could it be?

Can you outline for me the exact sequence of steps you're doing to change the IP ? Myself, if I were changing the IP locally on a RHEL-style system, I would:

  1. Edit the appropriate interface file in /etc/sysconfig/network-scripts/ to update the IPADDR= line, and any other lines that needed updated (e.g. NETMASK=, etc.)
  2. Re-start networking with systemctl restart network.service
  3. Verify the IP had changed in the output of ip addr
  4. If anything did not appear as expected, verify the current status of the networking service with systemctl status network.service
1 Like

vi ifcfg-ens4f1np1 and I removed this "NM_CONTROLLED=no" parameter
IP change was fast

but i don't understand why it sped up when i deleted it

Ah. The meaning of NM_CONTROLLED is that an interface is under the control of Network Manager, and not under the control of the traditional networking service. When you removed this, you told RHEL to initialise the network the old-fashioned way for this interface, by directly reading the contents of the configuration file and configuring the interface accordingly. This would indeed have resulted in a quicker switchover than waiting for Network Manager to pick up on the changes, though you could probably have used nmcli to handle this via Network Manager if you really wanted to.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.