centos 查看IP

Posted jeely

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos 查看IP相关的知识,希望对你有一定的参考价值。

[root@centosnet ~]# man ip
[root@centosnet ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:d3:10:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.123/24 brd 192.168.8.255 scope global noprefixroute dynamic ens33
       valid_lft 85800sec preferred_lft 85800sec
    inet6 fe80::c595:c345:cd87:8a5c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:31:dd:3a brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:31:dd:3a brd ff:ff:ff:ff:ff:ff
[root@centosnet ~]# clear

[root@centosnet ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:d3:10:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.123/24 brd 192.168.8.255 scope global noprefixroute dynamic ens33
       valid_lft 85735sec preferred_lft 85735sec
    inet6 fe80::c595:c345:cd87:8a5c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:31:dd:3a brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:31:dd:3a brd ff:ff:ff:ff:ff:ff
[root@centosnet ~]# 

 然后我们输入ip查询命名 ip addr  也可以输入 ifconfig查看ip,但此命令会出现3个条目,centos的ip地址是ens33条目中的inet值。

以上是关于centos 查看IP的主要内容,如果未能解决你的问题,请参考以下文章

Centos7安装febootstrap

大数据之在Liunx中安装MySQL

Centos6.4和Centos5.8混合实例

Centos6.4搭建NFS 服务器实例

Centos5.8搭建NFS 服务器实例

CentOS8的web终端-cockpit