Ubuntu系统下查看IP地址


可以通过 ifconfig 命令来查看本地IP地址,正常的结果如下:

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.89.129  netmask 255.255.255.0  broadcast 192.168.89.255
        inet6 fe80::45fb:9d4a:7d48:3797  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:e1:c5:f3  txqueuelen 1000  (以太网)
        RX packets 300224  bytes 387989103 (387.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 115129  bytes 7165354 (7.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (本地环回)
        RX packets 3422  bytes 316027 (316.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3422  bytes 316027 (316.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

如果提示命令没找到,通过下面的命令先安装:

sudo apt install net-tools

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM