Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to set up following network architecture :

                       Internet
                        ^   
+-----------------+     |          +------------------+
|  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

Edit:

If i do the following in box1:

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

would it do what i want?

share|improve this question
10  
Visio? Who needs Visio? Not this guy! +1 –  MDMarra Apr 16 '12 at 14:00
1  
Putting ASCII diagrams in your questions is asking for free +1's on ServerFault -- welcome aboard! –  Kyle Smith Apr 16 '12 at 14:42
1  
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
add comment

2 Answers 2

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:

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=192.168.0.1
GATEWAY=192.168.0.1
IPADDR=192.168.0.100
NETMASK=255.255.255.0
ONBOOT=yes
SEARCH=”example.com”

And in the ifcfg-eth0:

DEVICE=eth0
HWADDR=00:1e:90:f3:f0:02
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
BRIDGE=br0

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
add comment

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
add comment

Your Answer

 
discard

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.