0

seems like I have my network misconfigured and I have no clue what's wrong. Any help from a networking guru is appreciated. I'm using TrueNAS Community Edition, so it's pretty much generic linux. I have a VM which needs to talk to processes running on the host so I configured the network as below:

  • Removed DHCP and any static IP from my NIC.
  • Created a bridge with the NIC and VM interfaces.
  • Assigned a static IP to the bridge.

The problem is that when the system starts, sometimes my router sees it connected with the bridge MAC and IP, but sometimes it sees my NIC MAC and the same IP as the bridge. In the first case, everything works fine, but in the second there's no communication with the server. The only workaround I found is restarting the system until the router sees the bridge again instead of the NIC. Is there something else I should do?

1 Answer 1

1

Several options:

  1. Assign the NIC's MAC address to the bridge explicitly. I believe the raw command would be ip link set dev <bridgename> address <macaddress> Your distribution may provide another way to do this.
  2. Wait. Just after a reboot, the remote hosts have the old MAC address in their cache. After some time, the cache will time-out, and be refreshed with the new address.
  3. Route instead of bridging. Or even neither if the VM only ever needs to talk to the host.
5
  • Wouldn't there be problems if both shared the same MAC? Commented Aug 8 at 9:28
  • Only if both are live on the same network at the same time. Since the bridge wraps the NIC, it can share its MAC. Normally, it will do so implicitly, provided you add the NIC to the bridge first, and haven't explicitly set a MAC on the bridge. Commented Aug 8 at 10:03
  • Actually, that might indicate what is going wrong for you: Maybe things are coming up without explicit order so which MAC the bridge borrows is chosen based on random boot order. Commented Aug 8 at 10:05
  • I see - so sharing MAC with the NIC is the desired state, rather than a workaround? Commented Aug 8 at 10:54
  • Well, it could be considered LInux's workaround for not having an explicit MAC for the bridge, but it is definitely the normal state. And it is not normally something you need to work around. Actually, I think Linux may assign a random MAC to an interface that doesn't have one. This can cause the behavior you've asked about. In short, share the MAC from the NIC with the bridge. Commented Aug 8 at 12:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.