[SOLVED] spoof eth0 under bridge

svennd

Active Member
Aug 4, 2014
39
0
26
Hey,

I'm looking for a "reboot" stable configuration. I want to spoof (permanently) the mac address of eth0 that is allocated for bridge (vmbr0). I first attempted to change the mac addr for vmbr0 but that is not working. (or atleast not as intended)
After a bit of reading, it seems that a bridge needs a "valid mac address" of a device (beeing eth0 here).

So I need to change the eth0 mac address, now I figured out how I could achieve this using :
Code:
ifconfig eth0 hw ether 00:11:22:33:44:55

This results in : (ip addr)
Code:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
9: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
    link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
    inet 111.111.111.111/16 brd 111.111.255.255 scope global vmbr0
    inet6 fe80::21a:8cff:fe22:6d8/64 scope link
       valid_lft forever preferred_lft forever

However I'm pretty sure it won't survive a reboot; I assume /etc/network/interfaces is the right place to look; however eth0 is not defined there
Code:
 cat /etc/network/interfacesauto lo
iface lo inet loopback


auto vmbr0
iface vmbr0 inet static
        address ***
        netmask 255.255.0.0
        gateway ***
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0

So how can I define eth0 or where is it defined so I can make this adaptation survive reboot.

ps. I changed the values of mac & IP
 
Last edited:

Nemesiz

Well-Known Member
Jan 16, 2009
678
47
48
Lithuania
Try this

Code:
auto eth0
iface eth0 inet manual
    hwaddress ether 00:11:22:33:44:55

Or this

Code:
auto eth0
iface eth0 inet manual
    pre-up ifconfig eth0 hw ether 00:11:22:33:44:55
 

svennd

Active Member
Aug 4, 2014
39
0
26
Hey Nemesiz,

Thx for your help, the second solution did the trick, the first din't seem to have any effect.

thx!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!