2 IP addresses (set programs to use selected one)

Alireza_

Honorable
Jan 10, 2014
28
0
10,530
Hi
I have 2 static IP addresses on 1 network adabter on my win 7. (one for internet and one for intranet)
How to set a program to use one specified IP?
or how to set windows when connecting to a target, it use one of my selected IPs to connect?

For example:
To connect to Microsoft servers use IP 1
To connect to Google site use IP 2

or:
Use IP1 for protocol 80
Use IP2 for other protocols
 
Solution
There is no way to direct just protocol 80 to a specific IP with a configuration change that I know of.

My idea would be to give the NIC that you do not want on the internet (at all, not just port 80) a gateway address that is not to a valid gateway. Then if internet traffic tries to go across it it would fail and I assume through the dual nic setup it would learn this and use the other automatically.

Skippy27

Distinguished
Nov 23, 2009
366
0
18,860
Let me see if I understand you correctly....
So you have 2 NICs that are on 2 different networks? As in one of the NICs is set to 192.168.1.2/255.255.255.0 and the other is 192.168.2.2/255.255.255.0
 

Alireza_

Honorable
Jan 10, 2014
28
0
10,530

No 2 NIC on one network adapter
one IP for Internet
one IP for InterAnet
 

Alireza_

Honorable
Jan 10, 2014
28
0
10,530

yes one for internet and one for intranet
ipconfig-all.jpg
 

Skippy27

Distinguished
Nov 23, 2009
366
0
18,860
Does your NIC card have software with it that you can make these settings? Did you even install the software or just the driver?

One way or another you need to modify some routing tables and put the entries you specifically want in there to route through that specific IP address. I do not believe you are going to find a quick and clean way to do this easily for many addresses.

The only other way I can think that it is going to work is for all internet traffic to be routed over the public IP and the the local traffic routed locally by giving an invalid gateway address on that NIC.
 

Alireza_

Honorable
Jan 10, 2014
28
0
10,530

No, it only has driver
If you can do some thing so all protocol 80 connections go through one IP and other protocols through the intranet IP , it will be helpful too.
can you explain your idea?
 

Skippy27

Distinguished
Nov 23, 2009
366
0
18,860
There is no way to direct just protocol 80 to a specific IP with a configuration change that I know of.

My idea would be to give the NIC that you do not want on the internet (at all, not just port 80) a gateway address that is not to a valid gateway. Then if internet traffic tries to go across it it would fail and I assume through the dual nic setup it would learn this and use the other automatically.
 
Solution

Alireza_

Honorable
Jan 10, 2014
28
0
10,530


By giving an invalid gateway all connections to internet fails even protocol 80 that is needed and try to use intranet, is this wrong?
 

Skippy27

Distinguished
Nov 23, 2009
366
0
18,860


I didnt think it would let you save the configuration like that but that can be tried.