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.

We have 2 Linux Hosts each has 2 Nic Cards with below IP addresses,ech0 and eth1 are in different network , Host1:eth1 and Host2:eth1 are connected by direct cable, due to some Hardware issue N/W cable got bad, Is there any way to communicate between Host1:eth1 and Host2:eth1 ?

In Normal conditions: Communication from Host1:eth0 to Host2:eth1 and Host2:eth0 to Host1:eth1 is not working , i checked by this by TRACEROUTE -I command (Host1# traceroute -i eth0 10.1.1.201 or Host2# traceroute -i eth0 10.1.1.200)

===========================

Host1:
eth0  : 10.162.100.200/24
eth1  : 10.1.1.200/24

Host2:
eth0  : 10.162.100.201/24
eth1  : 10.1.1.201/24

==========================

share|improve this question

migrated from stackoverflow.com Aug 15 '11 at 19:46

This question came from our site for professional and enthusiast programmers.

closed as not a real question by womble, Shane Madden, MikeyB, Iain, Chris S Aug 17 '11 at 16:37

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I don't really understand your config. Are host1 and host2 physically attached to each other with a working network cable? Are they attached to the same switch/router? Are they in the same building? –  EightBitTony Aug 15 '11 at 20:01
    
Thanks for your response.. Single static routes on HOST1(route add -host 10.1.1.200 gw 10.162.100.200 eth0) is not work ,since HOST1:eth0(10.162.100.200) don't know about HOST2:eth1(10.1.1.201). Traceroute shows this (HOST1# traceroute -i eth0 10.1.1.201 or HOST2# traceroute -i eth0 10.1.1.200). I need multiple static routes ,i am not sure how to write ROUTE/IPTABLES commands for below static routes. 1)Need static route on HOST1, If any packets with source address HOST1:eth1(10.1.1.200) and destination address HOST2:eth1(10.1.1.201) ,Then Forward packets to HOST1:eth0(10.162.100.200). 2)One mo –  Vijay Aug 16 '11 at 4:47
    
Above one can simplified as for packets with "source address HOST1:eth1(10.1.1.200) and destination address HOST2:eth1(10.1.1.201)" HOST1:eth1(10.1.1.200) => HOST1:eth0 (10.162.100.200)=> HOST2:eth0(10.162.100.201) =>HOST2:eth1(10.1.1.201) Need static routes for above path –  Vijay Aug 16 '11 at 5:11
    
Tony, HOST1 and HOST2 are in same building ,HOST1:eth1 and HOST2:eth1 are directly connected by crossover cable, but cable is not working ,HOST1:eth0 and HOST2:eth0 are connected to Office Network VIA switch ,from Workstations we can access HOST1:eth0 and HOST2:eth0 only, we can't access HOST1:eth1 and HOST2:eth1 since they are in different N/W with crossover cable. I would like to send packets from HOST1:eth1 to HOST2:eth1 using HOST1:eth0 and HOST2:eth0 interfaces. ==========Config================= Host1: eth0 : 10.162.100.200/24 eth1 : 10.1.1.200/24 Host2: eth0 : 10.162.100.201/24 eth1 : 10 –  Vijay Aug 16 '11 at 9:16
    
As per SpacemanSpiff suggestion ,i will try with below commands Please let me know if anything wrong with below commands on HOST1 ======== route add -host 10.1.1.201 gw 10.162.100.201 eth0 (HOST1:eth1(10.1.1.200) => HOST1:eth0 (10.162.100.200)=> HOST2:eth0(10.162.100.201) =>HOST2:eth1(10.1.1.201)) on HOST2 ======== route add -host 10.1.1.200 gw 10.162.100.200 eth0 (HOST2:eth1(10.1.1.201) => HOST2:eth0 (10.162.100.201)=> HOST1:eth0(10.162.100.200) =>HOST1:eth1(10.1.1.200)) –  Vijay Aug 16 '11 at 9:25
show 1 more comment

1 Answer

This should be a pretty simple case of routes and metrics. When eth1's link is up, it is a "connected" network which should have a priority and take precedence, so communication between the hosts is direct.

However, if you set a static route on Host1 pointing to host2's eth0 address as a gateway for the host2's eth1 interface, it should work when the link is down hard.

You would do the opposite on the other host.

share|improve this answer
    
A single static route will be sufficient on each host. As for iptables configuration I'm not familiar. –  SpacemanSpiff Aug 16 '11 at 5:38
add comment