在Ubuntu上更改您的网卡MAC地址

There are a lot of reasons you might want to manually set your MAC address for your network card. I won’t ask you what your reason is.

有很多原因可能需要您手动设置网卡的MAC地址。 我不会问你你的原因是什么。

To change this setting, we’ll need to edit the /etc/network/interfaces file. You can choose to use a different editor if you’d like.

要更改此设置,我们需要编辑/ etc / network / interfaces文件。 您可以根据需要选择使用其他编辑器。

sudo gedit /etc/network/interfaces

sudo gedit / etc / network / interfaces

You should see the line for your network interface, which is usually eth0. If you have dhcp enabled, it will look like this:

您应该看到网络接口的行,通常为eth0。 如果启用了dhcp,它将如下所示:

auto eth0iface eth0 inet dhcp

自动eth0iface eth0 inet dhcp

Just add another line below it to make it look something like this:

只需在它下面添加另一行,使其看起来像这样:

auto eth0iface eth0 inet dhcp       hwaddress ether 01:02:03:04:05:06

自动eth0iface eth0 inet dhcp hwaddress ether 01:02:03:04:05:06

Obviously you would want to choose something else for the MAC address, but it needs to be in the same format.

显然,您可能想为MAC地址选择其他内容,但是它必须采用相同的格式。

sudo /etc/init.d/networking restart

sudo /etc/init.d/networking重新启动

You will need to restart networking or reboot to take effect.

您将需要重新启动网络或重新启动才能生效。

翻译自: https://www.howtogeek.com/howto/ubuntu/change-your-network-card-mac-address-on-ubuntu/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值