Monday, January 02, 2023

Re: Change (spoof) MAC address

On Mon Jan 2, 2023 at 1:44 PM CET, Tomaž Kokolj wrote:
> Hi everyone,
>
> I've requested a static IP from my ISP a long time ago and I figured out
> that my ISP binds my IP based on a MAC address which is connected to my WAN
> port.
>
> I was thinking about switching from Debian Linux to OpenBSD on my router,
> but I can't figure out how to change my MAC address.
>
> I've tried the the following configurations for my /etc/hostname.em0 (I'm
> testing this in VirtualBox):
> #
> inet autoconf lladdr 00:11:22:33:44:55
> #
>
> #
> lladdr 00:11:22:33:44:55
> inet autoconf
> #
>
> #
> inet autoconf
> lladdr 00:11:22:33:44:55
> #
> In all of those configurations, my lladdr gets changed to 00:11:22:33:44:55
> but the inet line is missing from ifconfig which means that my network
> isn't working.

Read the hostname.if(5) man page and focus on STATIC ADDRESS CONFIGURATION
part paragraph options aka you can't mix (at least that's what's written)
autoconf with static addressing (which your ISP provides, right?) and you
can't use options (like lladdr) without configuring IP/netmask at same time.

>
> I have found this old (2012) blog post:
> https://andrewmemory.wordpress.com/2012/12/06/changing-mac-address-on-openbsd/
>
> Which suggested:
> "Linux has /etc/network/interfaces, and OpenBSD has /etc/hostname.if. I
> just changed my /etc/hostname.vr1 to:
>
> dhcp lladdr 00:11:22:33:44:55
>

That is quite outdated document of course, but dhcp is shortcut for
'inet autoconf'

Plus classic dhclient is going away and instead dhcpleased(8) is used.

So look in dhcpleased.conf(5) and use option 'send client id'

> and I was requesting an IP address using my new MAC address"
>
> If I do that my inet line is present and my network/internet is working,
> but my lladdr line isn't changed.
>
> Any suggestions?
>
> Best regards,
> Tomaz

No comments:

Post a Comment