Ubuntu18.04查看ip地址

Ubuntu安装时默认没有安装net-tools,也就是说,你没办法直接通过ifconfig查看ip地址,使用如下命令以安装net-tools并查看虚拟机ip地址:

sudo apt-get install net-tools
ifconfig

输出将类似如下:

hadoop@ubuntu:/usr/local/hadoop$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.232.131 netmask 255.255.255.0 broadcast 192.168.232.255
inet6 fe80::ea5e:285c:206:9acb prefixlen 64 scopeid 0x20
ether 00:0c:29:d0:db:3b txqueuelen 1000 (Ethernet)
RX packets 777911 bytes 1140658779 (1.1 GB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 137255 bytes 8401615 (8.4 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
loop txqueuelen 1000 (Local Loopback)
RX packets 2787 bytes 1816194 (1.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2787 bytes 1816194 (1.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

由此你可以获得你的ip,我当前的ip为 192.168.232.131

如果你安装的Ubuntu带有GUI界面,你也可以在Settings中在以下位置查看ip地址:

posted @ 2020-03-05 13:31  focksor  阅读(6659)  评论(0编辑  收藏  举报