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).


    SWITCH
    |
    |
    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???

    Thanks
    Ron
     
    unix, Feb 29, 2012
    #1
    1. Advertising

  2. unix

    Rob Guest

    unix <> wrote:
    > I have a task to connect 2 Linux servers using a cross-over cable (but
    > with a twist).
    >
    >
    > SWITCH
    > |
    > |
    > 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???
    >
    > Thanks
    > Ron


    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
    #2
    1. Advertising

  3. unix

    KR Guest

    On 29.02.2012 17:47, unix wrote:
    >
    > 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???


    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
    http://tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html).

    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
    #3
  4. unix

    unix Guest

    On Feb 29, 1:34 pm, KR <>
    wrote:
    > On 29.02.2012 17:47, unix wrote:
    >
    >
    >
    > > 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???

    >
    > 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 (seehttp://tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html).
    >
    > 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.


    THANKS! THAT WAS VERY HELPFULL! I'll try it.
     
    unix, Mar 1, 2012
    #4
  5. unix

    unix Guest

    On Feb 29, 1:34 pm, KR <>
    wrote:
    > On 29.02.2012 17:47, unix wrote:
    >
    >
    >
    > > 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???

    >
    > 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 (seehttp://tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html).
    >
    > 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.


    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
    #5
  6. unix

    KR Guest

    On 01.03.2012 19:30, unix wrote:
    >
    > 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 ???


    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
    #6
  7. [OT] Re: Is this doable? Bridging using NICs.

    On Thu, 01 Mar 2012 21:46:11 +0100, KR wrote:

    > 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).


    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.

    HTH,
    M4
     
    Martijn Lievaart, Mar 3, 2012
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    5
    Views:
    8,297
    Jason
    Nov 8, 2003
  2. NNTP
    Replies:
    4
    Views:
    662
    AnyBody43
    Sep 22, 2004
  3. Robert11

    Transferring Programs From A C: To A D: Doable ?

    Robert11, Nov 13, 2004, in forum: Computer Support
    Replies:
    2
    Views:
    394
    Timmy
    Nov 14, 2004
  4. Robert11

    VCR Tapes To DVD Via PC ? Doable ? Or, ?

    Robert11, Apr 23, 2005, in forum: Computer Support
    Replies:
    3
    Views:
    720
    tarsem ajimal
    Apr 25, 2005
  5. Brian Huether

    Selling photos - is this doable?

    Brian Huether, Apr 25, 2005, in forum: Digital Photography
    Replies:
    2
    Views:
    303
Loading...

Share This Page