Monday, January 02, 2023

Re: Change (spoof) MAC address

Hi,

Thank you for the reply.

> 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 may have written this incorrectly.
My ISP provides dynamic IPs via DHCP. I have requested a fixed IP address
which they have bound to my MAC address on my WAN port.
Which means that whenever I change my hardware I need to spoof my MAC
address or I will get a random IP address.
So the autoconf option should be the valid and correct way.

> 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'

For reference, this is my Debian configuration:
# cat /etc/network/interfaces
auto enp1s0
allow-hotplug enp1s0
iface enp1s0 inet dhcp
hwaddress ether 00:11:22:33:44:55

I want to achieve the same on OpenBSD. My current configuration is:
# cat /etc/hostname.em0
inet autoconf

# cat /etc/dhcpleased.conf
interface em0 {
send client id "00:11:22:33:44:55"
}

But my lladdr remains unchanged.

Best regards,
Tomaz

V V pon., 2. jan. 2023 ob 14:42 je oseba Bodie <bodie@bodie.cz> napisala:

> 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