Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind to a specific local IP address 2

Status
Not open for further replies.

ycohen

Programmer
Jul 31, 2005
5
IL
I have two network devices/interface in my computer (each of 1Gbit) that are configured with a different IP address (but on the same network). These two interfaces IP1 & IP2 are connected by two cables to a switch and from the switch to other devices.

I would like to connect by TCP/IP to two devices D1 & D2, such that each of the network devices IP1 & IP2 will be connected to its equivalent device DIP1 & DIP2. In other words, I would like to force that communication to D1 will pass only through IP1 and that communicationm to D2 will pass only through IP2.

Now, the question is whether "bind" with the relevant local IP address of the network interface will do the work? Will it force communication to pass through the specific network device? I was told that binding to a specific local network interface (IP address) does not neccesarly force that communication will pass through the physical interface. Please advice.

Thanks

Yossi
 
Thanks for your reply.

If I understood correctly, you suggest to replace the switch by static router? However, the switch is part of our system configuration and can't be replaced by router. Using the switch, will it work using the bind command?

Thanks

Yossi
 
No, a static route is something placed onto the OS.

For instance on an MS product you would type "route print" to view the static routes from your PC to other destinations.

As I don't know what OS you're working on I can't really help too much but basically you would do something like this on an XP box with two nics.

route -p ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 IF 1

The -p makes it persistant, the first address is the destination, the second is the mask (obvious as it's preceeded by MASK and the final address is the gateway, the IF is for the specific interface.
 
Is it possible to configure the routing table for the two interfaces using the SAME sub mask? Something like:

route -p ADD 157.0.0.1 MASK 255.0.0.0 157.55.80.1 IF 1
route -p ADD 157.0.0.2 MASK 255.0.0.0 157.55.80.2 IF 2
 
I believe that's why they give you the opportunity of using the IF switch but I don't know for sure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top