LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2020, 02:30 PM   #1
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Rep: Reputation: Disabled
Post How to clear NIC cache?


Hello,
I'm using CentOS 8. when I set a manual IP to my NIC and back it to DHCP then the NIC IP doesn't change. I restarted "networking" service and used "ifdown" and "ifup" commands too, but problem exist.
How can I clear NIC cache or Flush it?

Thank you.
 
Old 09-10-2020, 04:29 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Is the manual IP in the range of dynamic addresses provided by the dhcp server? If so, changing the type from static to dynamic may not cause the IP address to change.
There isn’t a “NIC cache” afaik
 
Old 09-11-2020, 04:03 AM   #3
n00b_noob
Member
 
Registered: Sep 2020
Posts: 436

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Is the manual IP in the range of dynamic addresses provided by the dhcp server? If so, changing the type from static to dynamic may not cause the IP address to change.
There isn’t a “NIC cache” afaik
Yes, it is.
As I said, after changed the IP address, I restarted networking service and I used "ifdown" and "ifup" to bring NIC Down and UP.
 
Old 09-11-2020, 09:16 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
As a frame of reference it worked for me.

How did you set a manual IP address? Did you manually edit the ifcfg configuration file or use the Network Manager applet?

If you manually edited the ifcfg file then without seeing those changes it is difficult to determine what is not working. ifdown and ifup actually use Network Manager's cli interface i.e. nmcli to stop/start networking.

If you installed the legacy network-scripts package make sure you stop network manager.
 
Old 09-11-2020, 02:17 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
Quote:
Originally Posted by n00b_noob View Post
Yes, it is.
As I said, after changed the IP address, I restarted networking service and I used "ifdown" and "ifup" to bring NIC Down and UP.
You should never set a static IP that’s in the range of dynamic IPs...you run the risk of having duplicate IPs on your network.
As I said, if that’s what you did, there’s no reason for the computer to reassign/change the IP address because you changed the type.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cant fix: "CLEAR: command not found" when trying to execute in terminal. "CLEAR" is part of code not the command to wipe the terminal screen Kintaro Linux - Newbie 12 08-03-2020 04:27 PM
clear is hashed (/user/bin/clear) What does it mean? mohammed.hossain Linux - Newbie 1 10-24-2010 07:53 PM
How to clear a std::string buff.clear()? lucky6969b Programming 3 03-17-2006 07:50 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM
Clear cache raysr Linux - Newbie 2 03-26-2004 01:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration