如何在Linux中查看mac地址

用ifconfig查看mac 地址

ifconfig -a

ens1f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

    inet 10.124.202.230  netmask 255.255.255.128  broadcast 10.124.202.255

    ether 70:ca:9b:ce:67:ae  txqueuelen 1000  (Ethernet)

    RX packets 12187970  bytes 7390885300 (6.8 GiB)

    RX errors 0  dropped 0  overruns 0  frame 0

    TX packets 16813496  bytes 16253942714 (15.1 GiB)

    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    device memory 0xb1960000-b197ffff  

用IP link show 查看mac 地址

ip link show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: ens1f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000

link/ether 70:ca:9b:ce:67:ae brd ff:ff:ff:ff:ff:ff

从/sys目录查看mac地址

more /sys/class/net/ens1f0/address

70:ca:9b:ce:67:ae

文章来自: 3 ways to get mac address in Linux

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值