Is this doable? Bridging using NICs.

Discussion in 'Cisco' started by unix, Feb 29, 2012.

  1. unix

    unix Guest

    I have a task to connect 2 Linux servers using a cross-over cable (but
    with a twist).

    Server-A - [NIC-A1 , NIC-A2]
    x-over cable
    Server-B - [NIC-B1 , NIC-B2]

    NIC-A1 is the only interface connected to a switch. I need to connect
    Server-B to the same switch but have no more switch ports.

    My idea (may be silly) is to run a x-over cable from NIC-A2 to NIC-B1
    and thus be on the same VLAN as NIC-A1.
    For this, I need to somehow internally bridge NIC-A1 and NIC-A2 so
    when I run the x-over cable, NIC-B1 will be part of the same segment.
    Then I can assign IP to NIC-B1 and have my L2 connection via Server-A.
    Is this at all doable???

    unix, Feb 29, 2012
    1. Advertisements

  2. unix

    Rob Guest

    Of course this is possible in Linux.
    It can be debated whether it is a good idea to do this, but it is your
    own decision.
    Rob, Feb 29, 2012
    1. Advertisements

  3. unix

    KR Guest

    Certainly. You'll need to create a bridge interface on server A and add
    NIC-A1 and NIC-A2 to the bridge. Assuming NIC-A1 and NIC-A2 are called
    eth0 and eth1 respectively:

    modprobe bridge
    brctl addbr br0
    brctl addif br0 eth0
    brctl addif br0 eth1

    This assumes that your kernel has bridge support compiled as a module,
    and that you have the bridge userspace tools installed (see

    The IP configuration on NIC-A1 must then be moved to the new bridge
    interface (br0). Also, the commands above must be added to the startup
    scripts of your Linux distribution.
    KR, Feb 29, 2012
  4. unix

    unix Guest

    unix, Mar 1, 2012
  5. unix

    unix Guest

    I looked at this and it seems once you bridge NIC-A1 and NIC-A2 you
    can't assign IPs to NIC-A1. I need NIC-A1 to be reachable via L3 still
    and have another IP for NIC-B1 in the same subnet. Can be done ???
    unix, Mar 1, 2012
  6. unix

    KR Guest

    You can't IP addresses to interfaces enslaved under a bridge interface,
    but the bridge interface can have any number of different IP addresses
    assigned to aliases (br0:0, br0:1 etc).

    BTW, you're in the wrong newsgroup.
    KR, Mar 1, 2012
  7. Nitpicks:

    - Yes you can assign IP adresses to enslaved interfaces and that does
    work. It's even the default Xen bridge setup. Whether it's a good idea in
    terms of clarity is debatable, but it does work.

    - Aliases are a thing of the past, of the 2.2 kernel. They are supported
    nowadays only for backward compatibility. Today you just assign multiple
    addresses to the same interface.

    Martijn Lievaart, Mar 3, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.