1. # centos查看IP
  2. ifconfig -a
  3. if addr
  4. if link
  5. # 测试链接
  6. ping 你主机的内网IP
  7. ping www.baidu.com

CentOS

注:ifconfig在CentOS 7之后被弃用

# 查看哪个软件包包括了
yum provides ifconfig
yum whatprovides ifconfig
# 查询到在net-tools中,之后就可以安装了
yum install net-tools

注:CentOS 7里面的网卡名称默认不再是eth0,而是ens33