Choosing from two IPs on a single machine

1

I have a server running on Windows Web Server 2008 R2. The server has two IPs that can be used to reach this server from the outside of the network. I need to connect to a game from two different IPs (I can explain why if needed) from this server. For this purpose I'm planning to install a second Network Adapter on the server and configuring it using "route" in Windows.

What I don't know is how do I force outgoing connection to run through the first or the second IP? How do i "switch" them? Right now, with a single Network Adapter, the first IP address is always used.

Yekoor

Posted 2014-02-08T21:56:05.080

Reputation: 27

You don't give us any information. What control do you have over the game? Can you specify the IP it connects to? Does it use TCP? UDP? – David Schwartz – 2014-02-10T13:36:00.093

It is a flash-based game. Either a browser or a stand-alone flash player can be used to play it. The game uses TCP. There are about 30 servers one can connect to by entering the appropriate server name into the browser or flash player. I'm not aware of any other ways of controlling the game. – Yekoor – 2014-02-10T16:26:17.130

Ahh, then you have your answer below. – David Schwartz – 2014-02-10T16:27:11.650

Answers

2

I know of no browsers that allow the user to select an interface to bind to, although there might be. Most browsers let the operating system decide. The OS then consults the routing table, which you can configure to associate destination IPs with a particular interface. However, it seems like you want to use different interfaces for the same destination, for which the routing table does not suffice.

Third party software may do the trick though. I've found ForceBindIP to be an invaluable networking tool. It does exactly what it says on the tin: forcing programs to bind to a specific interface, allowing control over which source IP to use per process rather than per destination, even when the program itself does not have this feature.

As an example, I tried connecting to a web server 'Neon' using a machine with two IP addresses, 192.168.120.32 and 192.128.120.64. The first time, it used the former by default. Afterwards, I launched the browser using forcebindip.exe 192.168.120.64 firefox.exe and visited the same page. The access log below confirms both requests originated from different addresses:

192.168.120.32 neon - [10/Feb/2014:14:14:03 +0100] "GET / HTTP/1.1" 200 1568 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"
192.168.120.64 neon - [10/Feb/2014:14:15:02 +0100] "GET / HTTP/1.1" 200 1568 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"

Marcks Thomas

Posted 2014-02-08T21:56:05.080

Reputation: 5 749

0

Can't comment yet... But how is your connection set up? What's responsible for giving you an IP address on your network adapter? Is it a DHCP server? You could probably manually switch if you know all the details for the second address (IP address, subnet mask, default gateway, and your DNS servers). I assume all would be the same as your connection now except the IP address.

To manually set my IP address (I'm using Win7), it goes like this: 

Control Panel -> 
Network and Sharing Center -> 
Local Area Connection (click) -> 
Properties -> 
Internet Protocol Version 4 (TCP/IPv4) (select) -> 
Properties (click) -> 
fill in details of connection

pkSML

Posted 2014-02-08T21:56:05.080

Reputation: 352

Currently I have 1 Network Adapter and two IPs. DHCP is currently disabled. I rent the server, AFAIK both IPs are set in the advanced IP Settings of the TCP/IPv4 protocol. I have all the details for IP addresses, right now they have the same subnet mask, default gateway and DNS server. I just need any way to connect to the game server (can connect using any browser or flash player) from more than 1 IP address. – Yekoor – 2014-02-09T01:59:27.517

OK, so I assume you know how to have multiple IPs set up on one NIC. The necessary option is a browser that will bind to a specific IP address or interface. From a little bit of research online, I don't see this being possible with Windows. – pkSML – 2014-02-10T12:50:21.170

0

Your best bet is a proxy server to get a second IP because it can be configured on a per web-browser basis. See http://www.iprivacytools.com/change-ip-address-firefox/ Also check out http://litlurl.net/public_proxies and http://litlurl.net/proxy_list

pkSML

Posted 2014-02-08T21:56:05.080

Reputation: 352

An ordinary proxy server is out of question, because latency is vital. Since I have two IPs, is it possible to somehow use the second IP as a proxy server? – Yekoor – 2014-02-10T16:34:33.100