-1

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

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

  • 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 04: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 05:11
  • 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 09:25
  • 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 09:16
  • @Vijay - STOP adding comments as answers, this is a question and answer site, nothing else, if you carry on we'll just destroy your account. – Chopper3 Aug 16 '11 at 11:12

1 Answers1

3

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.

SpacemanSpiff
  • 8,753
  • 1
  • 24
  • 35