We have two ALT linux servers with real IPs. They both are in intranet via commutator. Each of them also has an additional LAN network interface.

We want to connect these servers to each other additonally via patch-cord.

Is it possible to build bridge with these two interfaces on such network configuration on both servers only for intranet keeping internet connections with same IP-s? Will such solution hurt existence configuration?

enter image description here


Almost definitely it will just work as you've described. Older hardware needed patch cables to speak with switches and crossover cables to speak directly to other nics, but that was before nics could detect and automatically switch their input/ouput lines as needed. If you're working with equipment less than say 8 or so years old, you have nothing to fear.

For intranet-only communications you will need new ips, but not from your service provider. The simplest configuration is simply to arbitrarily pick a private subnet and two static ips and start talking. You'll need to set the scope of the links so the kernel will route packets correctly.

I did this recently for a private connection to my cable modem via USB over which I did not want the rest of my traffic routed:

ip address add \
    dev $NIC \
    local \
    peer \
    broadcast \
    scope link

The became my computer's static ip through which my computer would then route only requests to 192.168.100.? addresses. With only two machines (and probably I didn't either) you won't need the whole /24 subnet range, though you might find it convenient to keep more than just two open. Any online CIDR calculator can help you solve that pretty quickly.

I doubt it was necessary for me to specify .255 broadcast, but I was skimming man pages and plugging it in as I went - in any case, that's almost definitely what yours will be so it won't hurt. The local and scope options are important to restrict traffic appropriately, though, so include them.

Oh, I've almost forgot - merely setting the ip isnt all you need - you'll also need to bring up the links after doing so.

ip link set dev $NIC up

You can then (or any time, say, maybe, to find the value of $NIC for instance) check it with :

ip address show

Or just:

ip a

You can have a look at the effect this had on your routing table with:

ip route
  • Ok, and how do this bridge? An idea is to double speed intranet communactions, keeping internet connection configuration alive.
    – Andremoniy
    Mar 12 '14 at 9:50
  • Wait, you don't want the connection to be private? You want to team the connections then, I guess?
    – mikeserv
    Mar 12 '14 at 10:03
  • Or do you mean you're looking to offer a separate path for internal communication and thereby avoid its possible choking of public communication? If so the above should put you well on your way. The ip command noted is pretty close to all you need, I think.
    – mikeserv
    Mar 12 '14 at 10:17
  • Ok, but where there is bridge here? Actually what I want - is to double speed intranet connection, so packages could go through commutator and through crossover.
    – Andremoniy
    Mar 12 '14 at 12:21
  • There is no bridge here - for that you need just a little more - bridge-utils. I'm not sure of a distro-generic means of configuring it simply via the command-line, though. I use Arch Linux's netctl to bridge two nics and mu /etc/netctl/br0 file looks just like this:Description="bridge" Interface=br0 Connection=bridge BindsToInterfaces=($NIC $NIC) IP=dhcp I'm sure could do something similar.
    – mikeserv
    Mar 12 '14 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.