Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two private networks say: 10.0.1.0/8 and 192.168.0.0/24

I have two machines with two NICs per each machine.

machine1 NIC1: 192.168.0.10
machine1 NIC2: 10.0.1.10

machine2 NIC1: 192.168.0.11
machine2 NIC2: 10.0.1.11

How to configure the routing so that from machine1 to machine2, it would use actually machine1 NIC2?

The thing is that 10.0.1.0 network is Gigabit and 192 one is Fast Ethernet (100Mbit).

My goal is to communicate between those two through the fastest connection (i.e: NIC2) even if they are trying to access by NIC1's IP.

share|improve this question
    
You mean you want to use NIC2 between machine1 and machine2, right? (I think there's a typo in your actual question sentence.) –  Mat Feb 12 '12 at 21:26
    
@mat yes two NIC's in different private networks –  bakytn Feb 12 '12 at 21:30

1 Answer 1

I am assuming you have the networks 10.0.0.0/8 one switch and 192.168.0.0/24 on another, the simplest solution to the problem would be put the following into /etc/hosts file or whatever else you are using for name resolution.

192.168.0.10   machine1-100
192.168.0.11   machine2-100

10.0.1.10      machine1
10.0.1.11      machine2

As long as you have presence on the same network as another machine the system will automatically route the traffic on that interface unless you add specific routes overriding this behavior.

share|improve this answer

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.