linux中查看IP地址,ifconfig命令查到的信息所代表的含义

时间:2025-02-15 20:00:56

在linux中查看虚拟机的IP地址,需要用到ifconfig,出现如下信息:
root@ruiva filesys]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:92:58:12 
inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe92:5812/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:894066 errors:0 dropped:0 overruns:0 frame:0
TX packets:793 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:70393381 (67.1 MiB) TX bytes:77635 (75.8 KiB)
Interrupt:19 Base address:0x2024 
lo Link encap:Local Loopback 
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:159 errors:0 dropped:0 overruns:0 frame:0
TX packets:159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:15704 (15.3 KiB) TX bytes:15704 (15.3 KiB)

其中:
eth1是网卡代号,如果有两块网卡,就会出现eth1、eth2

inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0分别是ip地址/网关/子网掩码
inet6 addr 是IPv6的地址,还不怎么普及
RX packets:894066 errors:0 dropped:0 overruns:0 frame:0 接受包数量/出错数量/丢失数量...

TX packets:793 errors:0 dropped:0 overruns:0 carrier:0 发送包数量/出错数量/丢失数量...

lo 是loop设备的意思,地址是127.0.0.1即本机回送地址,具体有什么用,请查网络相关知识。
--------------------- 
作者:ZPHTTT 
来源:**** 
原文:/zphttt/article/details/82598463 
版权声明:本文为博主原创文章,转载请附上博文链接!