After changing mac address network don't working (in Freebsd 13)

Hi!

I have fanless pc like this. I install FreeBSD 13 on it, and very quickly make simple router from it. It has 2 ethernet ports, re0 and re1 (realtek devices). I want permanently change mac address of re0, in my rc.conf:
Code:
ifconfig_re0="ether 00:11:22:33:44:55"
And it applied:

ifconfig re0

Result (after reboot):

Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
        ether 00:11:22:33:44:55
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

But network not works completely, I cannot receive ip address from dhcp. If I don't change mac - all works fine.
I try to ifconfig re0 down and ifconfig re0 up and then dhclient re0, but no luck.

Just for fun I run Kali linux from usb device, and on Kali do this:

sudo ifconfig eth0 hw ether 00:11:22:33:44:55

And it works, network works fine, other devices see 00:11:22:33:44:55 in their arp tables.

What wrong in freebsd?
 
You can't really change a MAC address because it's burned into the device. It's a unique identifier which can't be changed. What you are trying to do is called spoofing your MAC address. It's like lying about who the machine really is. Nothing is wrong with FreeBSD, it just won't let you spoof your MAC address.
 
Code:
ifconfig_re0="DHCP ether 00:11:22:33:44:55"
ifconfig_re0_ipv6="inet6 accept_rtadv"

No changes - network not works completely.
 
The MAC address is produced by software. Anything produced by software can be changed.
Normally the software takes the MAC-address from the information it receives from hardware driver, it includes for instance the manufacturer.
A link,
/etc/rc.conf
Code:
ifconfig_re0_alias0="link 2b:3b:4b:5b:6b:7b"
or
/etc/start_if.re0
Code:
lladdr be:ef:be:ef:be:ef
 
You can't really change a MAC address because it's burned into the device. It's a unique identifier which can't be changed. What you are trying to do is called spoofing your MAC address. It's like lying about who the machine really is. Nothing is wrong with FreeBSD, it just won't let you spoof your MAC address.
You want to say that it is impossible in FreeBSD? It has commands, but some part of FreeBSD prevents spoofing mac address?
For example, if my ISP allow me access by MAC address, if I change router - I want to change outer mac, visible by ISP.
In my case I need go to ISP office for new contact (mac address fitted into contract), or change my mac (this is simple for me).
 
I run virtual machine, FreeBSD guest on Linux host, and changing mac address works for virtual network cards. Heh, may be problems in drivers or kernel...
 
You can't really change a MAC address because it's burned into the device. It's a unique identifier which can't be changed.
No, it's not. You can change it to anything you like. Whether or not this is actually useful is debatable.
 
You want to say that it is impossible in FreeBSD?
It's not. But it does beg the question why do you want to change the MAC address?

In my case I need go to ISP office for new contact (mac address fitted into contract),
A simple phone call or email usually suffices and they'll change the registered MAC address (some ISPs do indeed lock this). You don't need to get a new contract, that's ridiculous.
 
No, it's not. You can change it to anything you like. Whether or not this is actually useful is debatable.
Things have changed since I worked in this area. It's a complex issue now involving privacy as well as security angles. It's also possible for me to change my social security number. Yes it is debatable but I'm not here to debate it. My apologies. Carry on.
 
On my old asus laptop changing mac in FreeBSD 13 livecd works fine.
On my new router changing mac from FreeBSD 13 livecd not works too.
 
Maybe you are mac-locked by your telco-provider.
Can you login into the dhcp-server and check verify the ip-distribution.
Many times there is a web interface to do so.
As last resort you can install wireshark and analyse the protocol.
 
Maybe you are mac-locked by your telco-provider.
Can you login into the dhcp-server and check verify the ip-distribution.
Many times there is a web interface to do so.
As last resort you can install wireshark and analyse the protocol.
Now this computer connected to another router, with local DHCP server. Not to ISP directly. And I cannot get address from dhcp, or make any other network activity.
My local router does not blocks anything, for example if I boot into Kali linux, I can change MAC and all works fine.

And if I change MAC address on my old laptop on FreeBSD in liveCD mode - all works fine too.

Seems problem is deeper, in kernel or network drivers.
 
Serious ?
The network stack is thoroughly tested.
PS : If the DHCP server is under your control, you can put in the DHCP server the mac adres of the client and a fix ip to test.
 
DHCP is under my control, it is simple DIR-615 :)

Problem that is network completely not works after change mac address.

Both ethernet devices on this pc are same, both are Realtek Semiconductor Co., Ltd., RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller.
 
The mac./.ip relation can also be cached by a device. Maybe you need to power cycle the parts dpwnlink from your machine in order to make them forget that at that line once was a different mac. And maybe plug in the network once the machine has booted.
 
And last very interesting thing. I'm trying to tcpdump -ni re0 on second console, in first I dhclient re0.

AND IT WORKS!!!
All network activity works now, any protocols, routing and so on.

But how? What doing tcpdump to make it working?
May be other ifconfig command to reinitialize network interface or something similar? ifconfig re0 down and ifconfig re0 up does not help.
 
Back
Top