Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to set up following network architecture :

+-----------------+     |          +------------------+
|  Centos6-1      |     |          |      Centos6-2   |
|      +---- eth0 + ----+          |                  |
| (br0)|          |                |                  |
|      +---- eth1 +----------------+ eth0             |
+-----------------+                +------------------+
                     ( cable connection )

Two public IP's are to be configured like follows :

  • eth0 and eth1 of **Centos6-1 are to be configured as a bridge with IP1
  • Centos6-1 can be accessed with IP1
  • eth0 of Centos6-2 is configured with IP2
  • any request destined to IP2 will flow through Centos6-1

How can i accomplish this feat?

There is a service running in the second server. This service will bind to IP2. what will happen


If i do the following in box1:

brctl addbr br0
ifdown eth0
ifdown eth1
ifconfig eth0 up
ifconfig eth1 up
ifconfig br0 IP1 ****

would it do what i want?

share|improve this question
Visio? Who needs Visio? Not this guy! +1 – MDMarra Apr 16 '12 at 14:00
Putting ASCII diagrams in your questions is asking for free +1's on ServerFault -- welcome aboard! – Kyle Smith Apr 16 '12 at 14:42
Hand drawn is the new ASCII diagram of '12! – pfo Apr 16 '12 at 14:53
if only my superior understood the power of ascii :) – Aftnix Apr 16 '12 at 14:59
it will flow thru Centos6-1 but only at the link layer. sort of like using your Centos6-1 as a network switch. – sybreon Apr 17 '12 at 4:24
up vote 1 down vote accepted

According to this blog, you can setup bridge under CentOS in this way:

You have to add /etc/sysconfig/network-scripts/ifcfg-br0:


And in the ifcfg-eth0:


ifcfg-eth1 will be similar.

HWADDR you have to have MAC address of eth0, resp. eth1...

Between two servers you have to have crossover Ethernet cable...

share|improve this answer
Thanks, i'll test it and post the results – Aftnix Apr 16 '12 at 15:00

That's not bridging, what you want is simple NAT forwarding.

iptables -t nat -A PREROUTING -i eth0 -d IP2 --to-destination internal_IP2 -j DNAT

And let the boxes communicate using a private internal_IP pair (internal_IP1, internal_IP2)

share|improve this answer
does this leave the packets verbatim or modify packet header? I'm going for link layer because i want my packets intact. – Aftnix Apr 16 '12 at 15:00
It changes the destination IP of the incoming packets, and the source IP of the outgoing packets. Why do you think this is a problem ? – adaptr Apr 16 '12 at 15:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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