如何在Linux中查找OUI(组织唯一标识符)?

Network switches or Layer 2 technology Ethernet protocol uses MAC addresses in order to transfer frames between systems. MAC addresses are 48-bit value. This 48-bit value contains the device manufacturer ID as the first 24 bit. In this tutorial we will learn how to look, search and find the Organizationally Unique Identifier in Linux distributions like Ubuntu, Debian, Mint, Kali, Fedora, CentOS, RHEL, etc.

网络交换机或第2层技术以太网协议使用MAC地址以便在系统之间传输帧。 MAC地址是48位值。 此48位值包含设备制造商ID作为前24位。 在本教程中,我们将学习如何在Linux发行版(如Ubuntu,Debian,Mint,Kali,Fedora,CentOS,RHEL等)中查找,搜索和找到组织唯一标识符。

MAC地址 (Mac Address)

As stated in the previous part MAC address is used to address and route Ethernet frames. MAC address consists of a 48-bit value and simply expressed as the hexadecimal format. Here is an example of MAC Address.

如前所述,MAC地址用于寻址和路由以太网帧。 MAC地址由48位值组成,并简单表示为十六进制格式。 这是MAC地址的示例。

00:50:56:c0:00:4b

OUI(组织唯一标识符) (OUI (Organizationally Unique Identifier))

OUI or Organizationally Unique Identifier is the first 24 bit or 6 hexadecimal value of the MAC address. IEEE is responsible for the OUI in MAC addresses. They provide the Ethernet card manufacturer company. In the previous example 00:50:56 is OUI of the MAC address.

OUI或组织唯一标识符是MAC地址的第一个24位或6个十六进制值。 IEEE负责MAC地址中的OUI。 他们提供了以太网卡制造商公司。 在前面的示例中, 00:50:56是MAC地址的OUI。

打印MAC地址 (Print MAC Address)

First, we will start by printing the MAC address of the system. There are a lot of commands those have used to print MAC address but the ip link command is the easiest way.

首先,我们将从打印系统的MAC地址开始。 有很多命令用于打印MAC地址,但是ip link命令是最简单的方法。

$ ip link
Print MAC Address
Print MAC Address
打印MAC地址

使用get-oui命令查找OUI(Find OUI with get-oui Command)

get-oui command is the most popular way to learn OUI . It is provided by arp-scan package. We can install arp-scan package like below.

get-oui命令是学习OUI的最流行方法。 它由arp-scan软件包提供。 我们可以安装如下的arp-scan软件包。

Ubuntu,Debian,Mint,Kali (Ubuntu, Debian, Mint, Kali)

$ sudo apt install arp-scan -y
Ubuntu, Debian, Mint, Kali
Ubuntu, Debian, Mint, Kali
Ubuntu,Debian,Mint,Kali

Fedora,CentOS,RHEL (Fedora, CentOS, RHEL)

$ sudo yum install arp-scan

使用ieee-data查找OUI (Find OUI with ieee-data)

ieee-data is another package which provides the oui.txt file . We can install this with the following commands

ieee-data是另一个提供oui.txt文件的软件包。 我们可以使用以下命令安装它

LEARN MORE  Best Linux Hex Editors
了解更多最佳Linux Hex编辑器

Ubuntu,Debian,Mint,Kali(Ubuntu, Debian, Mint, Kali)

$ sudo apt install ieee-data/bionic
Ubuntu, Debian, Mint, Kali
Ubuntu, Debian, Mint, Kali
Ubuntu,Debian,Mint,Kali

Fedora,CentOS,RHEL (Fedora, CentOS, RHEL)

$ sudo yum install ieee-data

在oui.txt中搜索并查找OUI (Search and Look For OUI In oui.txt)

Installing previously explianed commands will create a file named oui.txt in the /usr/share/ieee-data/oui.txt this file provides the OUI data.

安装先前解释的命令将在/usr/share/ieee-data/oui.txt创建一个名为oui.txt的文件,该文件提供OUI数据。

Search and Look For OUI In oui.txt
Search and Look For OUI In oui.txt
在oui.txt中搜索并查找OUI

Lets look into oui.txt file to learn its format.

让我们查看oui.txt文件以了解其格式。

$ less /usr/share/ieee-data/oui.txt
Search and Look For OUI In oui.txt
Search and Look For OUI In oui.txt
在oui.txt中搜索并查找OUI

As we can see the first column is about OUI and the second column provides the organization name and the address of the organization. OUI is written in two formats first one is dash-separated and the other is without a separator.

我们可以看到,第一列是关于OUI的,第二列是组织的名称和组织的地址。 OUI以两种格式编写,一种是破折号,另一种是没有分隔符。

B4-99-BA   (hex)                 
B499BA     (base 16)

使用更少的查询 (Lookup Using Less)

We will lookup using less command provided by Linux system. We will open the oui.txt file and search with /

我们将使用Linux系统提供的less命令来查找。 我们将打开oui.txt文件,并使用/搜索

$ less /usr/share/ieee-data/oui.txt

AND then put the OUI . In this example we search for 00179A or 00-17-9A

然后放OUI。 在此示例中,我们搜索00179A或00-17-9A

/00179A

OR

要么

/00-17-9A

使用Grep查找 (Lookup Using Grep)

We can also use grep command to search and filter OUI. We will provide the OUI part and the oui.txt file as below. In this example, we will search for 00179A or 00-17-9A

我们还可以使用grep命令来搜索和过滤OUI。 我们将提供OUI部分和oui.txt文件,如下所示。 在此示例中,我们将搜索00179A00-17-9A

$ grep 00179A  /usr/share/ieee-data/oui.txt

OR

要么

$ grep 00-17-9A  /usr/share/ieee-data/oui.txt
Lookup Using Grep
Lookup Using Grep
使用Grep查找

使用Nmap Mac前缀文件查找(Lookup Using Nmap Mac Prefixes File)

nmap is a popular network scanner which provides a lot of features. One of them is the OUI information. OUI information is stored in a file /usr/share/nmap/nmap-mac-prefixes . We can search for a given OUI in this file with the grep command. First we need to install nmap package if it is not installed.

nmap是一种流行的网络扫描仪,具有许多功能。 其中之一是OUI信息。 OUI信息存储在文件/usr/share/nmap/nmap-mac-prefixes 。 我们可以使用grep命令在此文件中搜索给定的OUI。 首先,我们需要安装nmap软件包(如果尚未安装)。

Ubuntu,Debian,Mint,Kali: (Ubuntu, Debian, Mint, Kali:)

$ sudo apt install nmap
Install Nmap For Ubuntu, Debian, Mint, Kali:
Install Nmap For Ubuntu, Debian, Mint, Kali:
为Ubuntu,Debian,Mint,Kali安装Nmap:

Fedora,CentOS,RHEL: (Fedora, CentOS, RHEL:)

$ sudo yum install nmap

Now we will search with grep the OUI 0024A5 in this case.

现在,在这种情况下,我们将使用grep搜索OUI 0024A5

$ grep 0024A5  /usr/share/nmap/nmap-mac-prefixes
Lookup Using Nmap Mac Prefixes File
Lookup Using Nmap Mac Prefixes File
使用Nmap Mac前缀文件查找

翻译自: https://www.poftut.com/how-to-lookup-oui-organizationally-unique-identifier-in-linux/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值