# [SOLVED] Bridging different networks under one br device

## GODLiKE

Hi all, I've searched virtually everywhere I could think of for this (google, mailing lists, gentoo-related pages, kvm-related pages), so i'm hoping for a guru out here to give me a hand  :Smile: 

I recently hired a dedicated server with 5 IP addresses:

1. 94.x.x.x

2-5. 5.x.x.x

It originally came like this in /etc/conf.d/net:

```

#config_eth0=(

#  "94.23.x.y netmask 255.255.255.0"

#  "noop"

#  "5.39.x.y netmask 255.255.255.255 broadcast 5.39.x.y"

#  "5.39.x.y netmask 255.255.255.255 broadcast 5.39.x.y"

#  "5.39.x.y netmask 255.255.255.0 broadcast 5.39.x.255"

#  "5.39.x.y netmask 255.255.255.0 broadcast 5.39.x.255"

#)

```

I know it's baselayout-1 (I already took care of upgrading its rotten-old 2008 base system to a proper 2012, baselayout-2-newer-udev-compliant system and everything works  :Smile: 

I ordered 4 additional IP addresses (the 5.x ones) so I could setup several VMs and use the server as a KVM hypervisor. Of course I have br0 instead of eth0 as the active interface.

br0 always has the 94.x IP configured on it. If I configure an additional 5.x IP (from the assigned pool I have), it works. I can reach it, even the SSH port, so the cabling or anything related to the guys in the data center is not the issue here.

When I bring up a KVM VM, with its NIC bridged to br0, there's no way to have the NIC properly up. I can see the vnet0 interface on the hypervisor side, but it's not attached at all to the eth0 interface inside the VM (if I configure an IP address on vnet0 from the hypervisor side, the VM does not see it reflected on its eth0, and viceversa).

I have tried/searched for everything I could think of. I would be pretty sure that doing this (bridging different network segments under one br device) is possible. Besides, I have bridging set up like this at home (using dhcp and all-interfaces-in-one-network though). Any ideas as to how get this working?[/code]

----------

## Hu

Configuring an address on the hypervisor side tap device is not supposed to configure the guest, nor vice versa.  If you want to use bridging, then configure a management address on br0 (done), bridge the hypervisor side tap device into br0, name this device in the ifname= argument to KVM, configure an IP address+route on the guest eth0, and that should be enough.  The hypervisor side tap device does not need an address.

----------

## GODLiKE

I know it's not supposed to, but I was guided by how KVM bridging works at home: I have one eth0 physical device, slave to a br0. br0 receives IP from my dhcp server. Each KVM guest is configured to bridge to br0, and each VM receives IP from the same DHCP server. And when it does, I see it assigned on vnetX too. I never touched any tap device on KVM side (i'm using libvirt/virt-manager here).

----------

## GODLiKE

Fixed. Datacenter guys had to generate a virtual MAC for each additional IP, so their switches wouldn't complain when seeing another MAC coming from the same ethernet port.

After that it all worked flawlessly. I bridged the VM ifaces to br0 and I configured IP/netmask/MAC manually.

----------

## AgBr

 *GODLiKE wrote:*   

> Fixed. Datacenter guys had to generate a virtual MAC for each additional IP, so their switches wouldn't complain when seeing another MAC coming from the same ethernet port.
> 
> After that it all worked flawlessly. I bridged the VM ifaces to br0 and I configured IP/netmask/MAC manually.

 

As it seems, I have the same problem. See https://forums.gentoo.org/viewtopic-t-925466-highlight-.html

May I ask you details as to how these additional MAC-Addresses have been generated?  I have individual MAC-Addresses ( 00:00:00:00:00:00:01, ...:02, ...:03, ...) assigned to the tap-interfaces though. It still does not work.

----------

