Bridging Network Devices with Multiple IPs

643

Solution 1

The short answer is, as far as I know, NO.

The long answer: A bridge is a layer 2 device. Think of it as a virtual Switch. To bridge between a network card and an internal device you need to take all data that comes in on the network card and put it on the bridge (minus layer 2 filtering, such as .1q vlans). Let me draw a picture to explain:

This is how you want it to work (a routing scenario):

<vif> ---- <br0> --- <eth0:3> ---- <peth0> --- <internet>

But in reality the virtual bridge always bridges on layer 2:

<br0> --- <peth0>-------<internet>
  |          |
<vif0>    <eth0>
          <eth0:2>

Here peth0 is your physical device, while eth0 is the logical device (with address and such).

To get the scenario you want you will have to use routing instead of bridges. The reason that peth0 is put in promiscious mode is because it could otherwise filter out data headed to devices on the bridge. It doesn't know what the devices on the bridge might listen to.

Solution 2

Nope, I'm pretty sure it won't work that way. You'll need to put the entire eth0 device into the bridge and add subinterfaces to the bridge interface instead, such as br0:1 etc.

Is there any reason that you're trying to avoid having the additional IPs bound on the br0 interface?

Share:
643

Related videos on Youtube

user1746965
Author by

user1746965

Updated on September 17, 2022

Comments

  • user1746965
    user1746965 almost 2 years

    I am working on an iPhone application in which i have to implement Google+ API for login and fetching user details.I have used the API for it from this link https://developers.google.com done everything but immediately after login I am getting an error invalid scope.I don't know what i am missing out.Please let me know how to acheive this.

    Thank you.

    • rckoenes
      rckoenes over 11 years
      Can you post the relative code and error logs? This will give us something to go on.
    • Admin
      Admin over 2 years
      The answers to this question are now very obsolete. Since at least 2018, the Linux kernel and iproute offer an impressive array (36, as of 2021, see man ip link add help) of virtual interfaces for use in virtualization. A good reference is here, developers.redhat.com/blog/2018/10/22/…. And, by the way, creating the bridge, and then assigning IPs to both the bridge and one of the bridged interfaces now just works.
  • violet
    violet about 14 years
    +1 for awesome text-based picture!
  • user1746965
    user1746965 over 11 years
    I have integated the Google Plus SDK in my project but it is giving me the error Unknown class GooglePlusSignInButton in Interface Builder file.and crashing the application. Thanks
  • kawing-chiu
    kawing-chiu about 6 years
    What is vif0 short for?