# How to change the MAC-address of an interface with DHCP client?



## ogogon (Jul 18, 2022)

Colleagues, tell me, please, how can I properly configure the interface?

I have a computer that receives its network settings from the provider via DHCP. Naturally, the provider's DHCP server recognizes the computer by the MAC address of the external interface.

Now the computer will be replaced and the MAC address will change. Dealing with the provider is long and difficult. He is very problematic.

How do I properly tell the interface to change its MAC? Would the following string in /etc/rc.conf be correct?


```
ifconfig_re0=" ether 00:01:02:03:04:05 DHCP"
```

Grateful for the replies,
Ogogon.


----------



## gpw928 (Jul 18, 2022)

Are you paying for a static IP address?  If not, the MAC address may not matter.

Have you tried out your `ifconfig_re0` above?


----------



## Andriy (Jul 18, 2022)

Yes, that should work.


----------



## im (Jul 19, 2022)

I had a similar task with the interface with a VLAN. But nothing works with 1-line /etc/rc/conf option.
I found an advice about splitting IP and MAC address configuration via 'alias'
Here is a correct config for VLAN setup and MAC change.

```
cloned_interfaces="vlan112"
ifconfig_vr0="up"
ifconfig_vr0_alias0="ether 1c:7e:e5:1f:e2:8a"
ifconfig_vlan112="inet 4.2.1.9 netmask 255.255.255.240 vlan 112 vlandev vr0"
```

Now I tried to setup something similar for an interface without VLAN and I had no success, but it may be because of my hardware configuration.
Try to use something like this:

```
ifconfig_vr0="DHCP"
ifconfig_vr0_alias0="ether 1c:7e:e5:1f:e2:8a"
```


----------

