linux修改mac地址

A device’s MAC address is assigned by the manufacturer, but it’s not to hard to change—or “spoof”—those addresses when you need to. Here’s how do do it, and why you might want to.

设备的MAC地址是由制造商分配的,但要更改这些地址(或“欺骗”)这些地址并不难。 这是操作方法,以及您可能要这么做的原因。

Each network interface connected to your network—whether it’s your router, wireless device, or network card in your computer—has a unique media access control (MAC) address. These MAC addresses—sometimes referred to as physical or hardware addresses—are assigned in the factory, but you can usually change the addresses in software.

连接到网络的每个网络接口 (无论是路由器,无线设备还是计算机中的网卡)都具有唯一的媒体访问控制(MAC)地址 。 这些MAC地址(有时称为物理地址或硬件地址)是在工厂分配的,但是通常可以在软件中更改地址。

什么MAC地址用于 (What MAC Addresses Are Used For)

At the lowest networking level, network interfaces attached to a network use MAC addresses to communicate with one another. When a browser on your computer needs to grab a web page from a server on the Internet, for example, that request passes down through several layers of the TCP/IP protocol. The web address you type gets translated to the IP address of the server. Your computer sends the request to your router, which then sends it out onto the Internet. At the hardware level of your network card, though, your network card is only looking at other MAC addresses for interfaces on the same network. It knows to send the request to the MAC address of your router’s network interface.

在最低的网络级别上,连接到网络的网络接口使用MAC地址相互通信。 例如,当您计算机上的浏览器需要从Internet上的服务器获取网页时,该请求将通过TCP / IP协议的多个层传递。 您键入的网址将转换为服务器的IP地址。 您的计算机将请求发送到路由器,然后路由器将其发送到Internet。 但是,在网卡的硬件级别上,网卡仅查找同一网络上接口的其他MAC地址。 它知道将请求发送到路由器网络接口的MAC地址。

In addition to their core networking use, MAC addresses are often used for other purposes:

除了其核心网络用途外,MAC地址通常还用于其他目的:

  • Static IP Assignment: Routers allow you to assign static IP addresses to your computers. When a device connects, it always receives a specific IP address if it has a matching MAC address

    静态IP分配 :路由器使您可以为计算机分配静态IP地址 。 设备连接时,如果它具有匹配的MAC地址,则它总是会收到一个特定的IP地址。

  • MAC Address Filtering: Networks can use MAC address filtering, only allowing devices with specific MAC addresses to connect to a network. This isn’t a great security tool because people can spoof their MAC addresses.

    MAC地址过滤 :网络可以使用MAC地址过滤 ,仅允许具有特定MAC地址的设备连接到网络。 这不是一个很好的安全工具,因为人们可以欺骗其MAC地址。

  • MAC Authentication: Some Internet service providers may require authentication with a MAC address and only allow a device with that MAC address to connect to the Internet. You may need to change your router or computer’s MAC address to connect.

    MAC身份验证 :某些Internet服务提供商可能要求使用MAC地址进行身份验证,并且仅允许具有该MAC地址的设备连接到Internet。 您可能需要更改路由器或计算机的MAC地址才能连接。

  • Device Identification: Many airport Wi-Fi networks and other public Wi-Fi networks use a device’s MAC address to identify it. For example, an airport Wi-Fi network might offer a free 30 minutes and then ban your MAC address from receiving more Wi-Fi. Change your MAC address and you could get more Wi-Fi. (Free, limited Wi-Fi may also be tracked using browser cookies or an account system.)

    设备标识 :许多机场Wi-Fi网络和其他公共Wi-Fi网络使用设备的MAC地址进行标识。 例如,机场Wi-Fi网络可能会提供30分钟的免费时间,然后禁止您的MAC地址接收更多Wi-Fi。 更改您的MAC地址,您获得更多的Wi-Fi。 (也可以使用浏览器Cookie或帐户系统跟踪免费的有限Wi-Fi。)

  • Device Tracking: Because they’re unique, MAC addresses can be used to track you. When you walk around, your smartphone scans for nearby Wi-Fi networks and broadcasts its MAC address. A company named Renew London used trash bins in the city of London to track people’s movements around the city based on their MAC addresses. Apple’s iOS 8 will use a random MAC address each time it scans for nearby Wi-Fi networks to prevent this sort of tracking.

    设备跟踪 :由于它们是唯一的,因此可以使用MAC地址来跟踪您。 当您走来走去时,您的智能手机会扫描附近的Wi-Fi网络并广播其MAC地址。 一家名为Renew London的公司使用伦敦市的垃圾桶来根据人们的 MAC地址跟踪人们在城市周围的活动 。 苹果的iOS 8每次扫描附近的Wi-Fi网络时都会使用随机的MAC地址,以防止此类跟踪。

Bear in mind that each network interface has its own MAC address. So, on a typical laptop with both a Wi-Fi radio and a wired Ethernet port, the wireless and wired network interface each have their own unique MAC addresses.

请记住,每个网络接口都有其自己的MAC地址。 因此,在同时具有Wi-Fi无线电和有线以太网端口的典型笔记本电脑上,无线和有线网络接口各自具有自己的唯一MAC地址。

在Windows中更改MAC地址 (Change a MAC Address in Windows)

Most network cards allow you to set a custom MAC address from their configuration panes in the Device Manager, although some network drivers may not support this feature.

尽管某些网络驱动程序可能不支持此功能,但大多数网卡都允许您从“设备管理器”的配置窗格中设置自定义MAC地址。

First, open the Device Manager. On Windows 8 and 10, press Windows+X, and then click “Device Manager” on the Power User menu. On Windows 7, press the Windows key, type “Device Manager” to search for it, and then click the “Device Manager” entry. The Device Manager app will look the same no matter which version of Windows you’re using.

首先,打开设备管理器。 在Windows 8和10上,按Windows + X,然后在“高级用户”菜单上单击“设备管理器”。 在Windows 7上,按Windows键,键入“设备管理器”进行搜索,然后单击“设备管理器”条目。 无论您使用哪个Windows版本,设备管理器应用程序的外观都相同。

In Device Manager, under the “Network adapters” section, right-click the network interface you want to modify, and then select “Properties” from the context menu.

在设备管理器的“网络适配器”部分下,右键单击要修改的网络接口,然后从上下文菜单中选择“属性”。

In the properties window, on the “Advanced” tab and select the “Network Address” entry in the “Property” list. If you don’t see this option, then your network driver doesn’t support this feature.

在属性窗口中的“高级”选项卡上,然后在“属性”列表中选择“网络地址”条目。 如果看不到此选项,则说明您的网络驱动程序不支持此功能。

Enable the Value option and type your desired MAC address without any separating characters—don’t use dashes or colons. Click “OK” when you’re done.

启用“值”选项,并键入所需的MAC地址,且不要包含任何分隔符-请勿使用破折号或冒号。 完成后,单击“确定”。

在Linux中更改MAC地址 (Change a MAC Address in Linux)

Modern Linux distributions like Ubuntu typically use Network Manager, which provides a graphical way to spoof a MAC address.

像Ubuntu这样的现代Linux发行版通常使用网络管理器,它提供了一种欺骗MAC地址的图形方式。

For example, in Ubuntu you’d click the network icon on the top panel, click “Edit Connections,” select the network connection you want to modify, and then click “Edit.” On the Ethernet tab, you’d enter a new MAC address in the “Cloned MAC address” field, and then save your changes.

例如,在Ubuntu中,您将单击顶部面板上的网络图标,单击“编辑连接”,选择要修改的网络连接,然后单击“编辑”。 在“以太网”选项卡上,您将在“克隆的MAC地址”字段中输入新的MAC地址,然后保存所做的更改。

You can also do this the old-fashioned way. This involves taking the network interface down, running a command to change its MAC address, and then bringing it back up. Be sure to replace “eth0” with the name of the network interface you want to modify and enter the MAC address of your choice:

您也可以使用老式的方法。 这涉及关闭网络接口,运行命令以更改其MAC地址,然后将其恢复。 确保将“ eth0”替换为您要修改的网络接口的名称,然后输入您选择的MAC地址:

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig eth0 up

You’ll have to modify the appropriate configuration file under /etc/network/interfaces.d/ or the /etc/network/interfaces file itself if you want this change to always take effect at boot time. If you don’t, your MAC address will be reset when you restart.

如果要使此更改始终在引导时生效,则必须修改/etc/network/interfaces.d/下的适当配置文件或/etc/network/interfaces文件本身。 如果不这样做,则重新启动时将重置您的MAC地址。

在Mac OS X中更改MAC地址 (Change a MAC Address in Mac OS X)

Mac OS X’s System Preferences pane displays each network interface’s MAC address, but doesn’t allow you to change it. For that, you need the Terminal.

Mac OS X的“系统偏好设置”窗格显示每个网络接口的MAC地址,但不允许您对其进行更改。 为此,您需要终端。

Open a Terminal window (press Command + Space, type “Terminal,” and then press Enter.) Run the following command, replacing en0 with your network interface’s name and filling in your own MAC address:

打开一个“终端”窗口( 按Command + Space ,输入“ Terminal”,然后按Enter。)运行以下命令,用网络接口名称替换en0并填写您自己的MAC地址:

sudo ifconfig en0 xx:xx:xx:xx:xx:xx

The network interface will generally be either en0 or en1 , depending on whether you want to configure a Mac’s Wi-Fi or Ethernet interface. Run the ifconfig command to see a list of interfaces if you’re not sure of the appropriate network interface’s name.

网络接口通常为en0en1 ,具体取决于您要配置Mac的Wi-Fi还是以太网接口。 如果不确定合适的网络接口名称,请运行ifconfig命令以查看接口列表。

As on Linux, this change is temporary and will be reset when you next reboot. You’ll need to use a script that automatically runs this command on boot if you’d like to permanently change your Mac address.

与在Linux上一样,此更改是临时的,下次重新启动时将重置。 如果您想永久更改Mac地址,则需要使用在启动时自动运行此命令的脚本。



You can verify your change took effect by running a command that shows your network connection details and checking what MAC address your network interface reports afterwards. On Windows, run the ipconfig /all command in a Command Prompt window. On Linux or Mac OS X, run the ifconfig command. And if you need to change the MAC address on your router, you’ll find this option in your router’s web interface.

您可以通过运行显示网络连接详细信息的命令并检查网络接口随后报告的MAC地址来验证更改是否生效。 在Windows上,在“命令提示符”窗口中运行ipconfig /all命令。 在Linux或Mac OS X上,运行ifconfig命令。 而且,如果您需要更改路由器上的MAC地址,则可以在路由器的网络界面中找到此选项。

翻译自: https://www.howtogeek.com/192173/how-and-why-to-change-your-mac-address-on-windows-linux-and-mac/

linux修改mac地址

linux修改mac地址_如何(以及为什么)在Windows,Linux和Mac上更改您的MAC地址相关推荐

  1. linux修改服务器时间_操作系统基础解析:Windows和Linux 到底有何不同?

    出品丨自主可控新鲜事 内容节选自东方证券 正文共2520字,建议阅读时间8分钟 计算机操作系统是基础软件,分为闭源和开源两类. 广义的操作系统包括:计算机(PC.工作站.服务器)系统.移动端系统(例如 ...

  2. 修改路由器mac地址_你知道吗:路由器转发报文时,会剥掉MAC地址,重新封装

    概述 我们都知道路由器作为Internet的骨架,连接了整个互联网,可以说是整个网络的基石.但为什么路由器这么牛呢?是因为路由器能够在不同的网段之间进行通信,可以根据一定的规则把报文一跳一跳的转到目的 ...

  3. linux检测不到win,c# – 如何正确检测Windows,Linux和Mac操作系统

    我找不到任何真正有效的检测C#程序正在运行的平台(Windows / Linux / Mac)的功能,特别是在Mac上返回Unix并且几乎不能与Linux平台区分开来! 所以我根据Mac的特点,做了一 ...

  4. linux如何卸载内核模块_如何加载或卸载Linux内核模块

    linux如何卸载内核模块 本文摘自Manning出版的< Linux in Action>第15章. Linux使用内核模块管理硬件外围设备. 这是这样的. 一个运行中的Linux内核是 ...

  5. vnc远程linux命令,用VNC实现远程桌面共享(支持Windows, Linux, …) | 易水博客

    用VNC实现远程桌面共享(支持Windows, Linux, -) VNC,全称为Virtual Network Computing,它是一个桌面共享系统.它的功能,类似于windows中的远程桌面功 ...

  6. linux系统手柄模拟器下载,Switch Amiibo模拟器(Windows|Linux PC + JoyControl + Bluetooth)...

    之前我发了一篇文章,介绍如何用安卓手机模拟switch的pro手柄刷amiibo,大家如果感兴趣可以点击我的那篇文章:蓝牙5.0安卓手机连接switch刷任意amiibo,不用白卡.但是如果你没有蓝牙 ...

  7. linux修改mysql配置文件_忘记MySQL密码怎么办?一招教你搞定!

    在安装完 MySQL 或者是在使用 MySQL 时,最尴尬的就是忘记密码了,墨菲定律也告诉我们,如果一件事有可能出错,那么它一定会出错.那如果我们不小心忘记了 MySQL 的密码,该如何处理呢?别着急 ...

  8. linux修改ip配置文件_协助调试Linux服务器经验分享

    achair教程网,原创教程,经验分享.有个微信群,与WordPress爱好者交流,加群方法:添加微信号368537,回复WordPress群. 大家好,我是achair,周末整个下午都在搞Linux ...

  9. linux修改文件内容_详解5种实用方法---Linux系统清空或删除大文件内容

    概述 有时我们在处理Linux终端中的文件时,可能要去清除文件的内容,而无需使用任何Linux命令行编辑器打开它.怎么才能实现呢?下面通过几种不同的方式教大家清空文件内容. 1.通过重定向到空来清空文 ...

  10. linux怎么创建牡蛎_文件amp;目录小技巧 | Linux后门系列

    0x01 Linux 目录技巧 我们都知道 Windows 下文件和文件夹命名是有很多规则和限制的,但是可以通过一些程序来绕过限制,今天我们来看看 Linux 有哪些有趣的规则 参考 https:// ...

最新文章

  1. 强如 Disruptor 也发生内存溢出?
  2. 逻辑判断 java_写 JS 逻辑判断,不要只知道用 if-else 和 switch
  3. java volatile线程可见_volatile-验证线程之间的可见性
  4. java双引号的转义字符_JAVA中转义字符
  5. 【转】三、QT例子-打开一个图片并且显示
  6. php主题怎么增加导航页,教你如何给wordpress主题添加导航栏
  7. 优秀代码所具备的5大品质 你的代码呢?
  8. jquery利用appendTo动态创建元素
  9. 使用Docker跑MySQL 作为Django的存储后端
  10. 《信息安全工程》读书笔记
  11. js和jQuery的总结
  12. Linux 基础——ls 命令
  13. 合成器插件Sylenth1 2.2.1绿化版亲测有效
  14. 从零开始设计共享电动车充电桩(一)——构思篇
  15. 根据经纬度来计算旋转矩阵
  16. 姿态估计(人体关键点检测)之CPN
  17. LAZARUS APT利用恶意word文档攻击MAC用户
  18. html的中性标签,HTML的figcaption标签
  19. read和fread有什么区别
  20. anaconda配置h5py===2.10.0

热门文章

  1. java线程游戏之随机小球游戏V1
  2. 使用Nginx Upstream 部署 OpenERP
  3. 电脑各个硬件的理论知识 经典
  4. spring-test部分翻译
  5. android Rect
  6. 爬虫爬取东方财富网的股票走势图
  7. php单页菜单,纯CSS3单页切换导航菜单界面设计
  8. 关键路径例题图表_关键路径习题.ppt
  9. uniapp 跳转到外部链接
  10. Unity太空大战游戏-Socket网络通信教学示例