当前位置:首页 > linux > 正文

linux看ip地址命令(linux查看ip指令)

  • linux
  • 2024-03-27 00:32:22
  • 4550
Linux 查看 IP 地址命令
CLI 命令: ifconfig
要素:
- 接口名称:以太网或 Wi-Fi 接口的名称,例如 eth0 或 wlan0。
- IP 地址:分配给接口的 IP 地址,例如 192.168.1.10。
- 子网掩码:用于确定网络中地址范围的位掩码,例如 255.255.255.0。
- 广播地址:用于在网络内广播流量的地址,例如 192.168.1.255。
- MAC 地址:接口的唯一标识符,例如 00:11:22:33:44:55。
举例:
bash
# 查看 eth0 接口的 IP 信息
ifconfig eth0
# 输出结果:
eth0: flags=4163 mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
ether 00:11:22:33:44:55 txqueuelen 1000 (Ethernet)
RX packets 15000 bytes 24689000 (23.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1600 bytes 1802000 (1.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0