S
S
Sinot2017-03-02 11:22:55
linux
Sinot, 2017-03-02 11:22:55

How to set the mac-address of an interface to a network bridge?

Greetings!
Set up an L2 tunnel using OpenVPN. And, of course, on the server, the TAP interface (tap0) and the physical one (eth2) were added to the bridge (br0).

/etc/network/interfaces

auto br0
iface br0 inet dhcp
    bridge_ports eth2 tap0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0
    pre-up openvpn --mktun --dev tap0
    pre-down openvpn --rmtun --dev tap0

And there is a virtual machine with a similar configuration for tests. On a real server, br0 has the same mac-address as eth2 (does not change on restarts), but on a virtual machine, after a network restart, br0 is set to the mac-address of the tap0 interface.
Now I solved this problem by setting the mac-address with the "bridge_hw" option.
Actually, according to what rules is the mac-address selected for the bridge (I thought it was from the first interface in the list)? And how can I force bridge to select the mac-address from the network interface I need?
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question