I have 2 interfaces


There are two machines are connected from per interface

Machine 1 to eth0 with address
Machine 2 to eth1 with address

I want to connect from each interface to each machine but it connects to Machine 1 but not to Machine 2. I tried ssh option bind with

ssh -b 

but not responded.How can be achievable?

  • Are both machine reachable? What does pinging them tell you? – alk Apr 1 '13 at 8:30

This will be because as soon as you put an IP address like onto an interface, a route is added for that network out of that interface. If you need to indicate that a specific address should be reached via specific interface then you will need a static route to it, like this:

# ip route add dev eth1

Note the /32 for a single IPv4 address route.

You could also maybe do it with source routing, iptables trickery and so on, but I think a static route is the most simple and obvious way.

As an aside, it is a bad idea to two interfaces onto the same network, so should probably have a netmask that makes sure it isn't on the same network as, e.g.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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