Is this doable? Bridging using NICs.

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

Reply to
unix
Loading thread data ...

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.

Reply to
Rob

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

formatting link
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.

Reply to
KR

THANKS! THAT WAS VERY HELPFULL! I'll try it.

Reply to
unix

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

Reply to
unix

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.

Reply to
KR

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

Reply to
Martijn Lievaart

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.