如何查看Linux的IP地址
1. 前言
本文主要讲解如何查看Linux的IP地址。
如何查看Linux的IP地址
2. 通过图形界面查看Linux的IP地址
以Ubuntu 20.04为例:
使用本地显示器登录到Ubuntu图形桌面后,点击右上角网络设置-选择相应网卡-进入网络设置界面-点击齿轮就可以查看到Linux服务器的IP地址。

使用本地显示器登录到Ubuntu图形桌面后,点击右上角网络设置

进入Linux网络设置界面-点击齿轮
这里演示的Linux的IP地址为192.168.122.197。

通过图形界面查看Linux的IP地址
你可以点击其它选项卡进行设置,比如IPv4选项卡设置IPv4的地址,点击IPv6选项卡,设置IPv6的地址。
3. 通过命令行查看Linux的IP地址
大多数的情况,我们的Linux服务器只有命令行界面。
到机房使用本地显示器登录一Linux系统后,输入正确的用户名和密码。

通过命令行查看Linux的IP地址
然后输入以下命令查看Linux的IP地址
ip addr
如下图所示:

通过ip addr命令行查看Linux的IP地址
第一张网卡为虚拟网卡,回环接口。通常它的IP地址为127.0.0.1
第二张网卡通常为物理网卡,我这里的网卡地址名称为enp1s0,是一张有线网卡。
在旧版的Linux中,默认使用以下命令查看Linux IP的地址。新版本已经废弃该命令。
ifconfig

通过ifconfig命令行查看Linux的IP地址
4. 如何修改Linux的IP地址
在Linux上修改IP地址可是一件技术活,因为不同的版本,设置的方法完全不一样。
比如Ubuntu Linux服务器版本与Ubuntu Linux桌面版本设置的方法不一样。
CentOS 6与CentOS 7的配置方法不一样。
相关推荐
-
第18问:MySQL CPU 高了,怎么办?2025-02-24 10:27:18
-
mysql索引类型 normal, unique, full text
mysql索引类型 normal, unique, full text2025-02-24 10:05:05 -
uwsgi+django+nginx 搭建部分总结2025-02-24 10:03:33
-
使用Docker配置Nginx环境部署Nextcloud2025-02-24 10:02:03
-
Nginx安装和怎么使用2025-02-24 10:00:45