CENTOS查看ip

方法一:
可以使用在终端下使用ifconfig命令查看ip信息

centos中的配置文件一般在/etc/sysconfig/network-script/ifcfg-eth0文件中;通过配置该配置文件,可以自动进行一个网络的设置,包括IPADDR,gateway,netmask,DNS1和DNS2等等;
如果想直接进行网络临时配置可以使用以下命令:

#ifconfig eth0 192.XXX.XXX.XXX
#route add default gw XXX.XXX.XXX.XXX

方法二:

[***@localhost ~]$ ifconfig eth0
eth0 Link encap:Ethernet
inet addr:192.168.91.132 Bcast:192.168.91.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:feb3:45b3/64 Scopeink
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:46481 errors:0 dropped:0 overruns:0 frame:0
TX packets:32811 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:52759994 (50.3 MiB) TX bytes:2879378 (2.7 MiB)
Interrupt:19 Base address:0x2024
方法三:
[cj@localhost ~]$ ifconfig|grep 'Bcast'

inet addr:192.168.91.132 Bcast:192.168.91.255 Mask:255.255.255.0

方法四:
centos系统查看本机IP地址,输入 ifconfig -a查看

centos查询上网公网IP输入 curl ifconfig.me 命令即可查看

centos查询上网网关IP,tracepath www.baidu.com

方法五:
centos7查看IP地址:ip addr show eth0。
设置IP地址:ip addr add 192.168.1.1/24 dev eth0。
删除IP地址:ip addr del 192.168.1.1 dev eth0。

猜你喜欢

转载自www.cnblogs.com/thoughtful-actors/p/9093803.html