Update 9th of January 2020
This post was written many years ago, when I was installing CentOS minimal, after several years I am surprised that this post is still being viewed.
As recommended below in the comments, there is no need to use net-tools anymore, this package has already been deprecated although still exists in the yum repository but there will be no more updates meaning any available bugs or vulnerabilities will not be fixed and maintained.
ss instead of
ip addr show dev enp0s3 instead of
ifconfig enp0s3, so instead of
netstat -rn use
On newly installed minimal installation the interface may not have automatically obtain ip address from dhcp server, use
dhclient enp0s3 then to easily make it always obtain ip address download the NetworkManager’s
nmtui. Refer to this post.
You have the freedom of choice which is why the old net-tools package is still in yum repo, I do not see it a must to use the new method, use what is comfortable for you.
I have just installed Centos 7 with the minimal installation options, lots of things which were taken for granted by me were not installed, one of them is netstat.
In the repo there is no software package that names as netstat.
To find out netstat is by which software package.
yum whatprovides netstat Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.secureax.com * extras: centos.mirror.secureax.com * updates: centos.mirror.secureax.com net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools Repo : @base Matched from: Filename : /usr/bin/netstat
So netstat is part of a software in the package known as net-tools.
To install net-tools:
[anything@SQUID ~]$ sudo yum install net-tools Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.secureax.com * extras: centos.mirror.secureax.com * updates: centos.mirror.secureax.com Resolving Dependencies --> Running transaction check ---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k Transaction Summary ================================================================================ Install 1 Package Total download size: 304 k Installed size: 917 k Is this ok [y/d/N]: y Downloading packages: net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Installed: net-tools.x86_64 0:2.0-0.17.20131004git.el7 Complete!