Options for connecting one host to two hosts on separate networks with the same network address?

1

Here is a diagram of my situation.

/-(Network cloud)- Host B (192.168.1.2) Host A -NIC 1 (192.168.1.50) - <-- Connected via patch panel to either B or C \-(Network cloud)- Host C (192.168.1.2) - NIC 2 (currently unused)

All hosts are running Linux Redhat variants. This configuration has previously been two completely separated networks for the purpose of testing software deployments. Both Host B and Host C are on identical networks in that they both are configured with the same host and network addresses. In addition, the connection between Host A and the two networks goes through a series of switches and routers that for testing reasons cannot be modified.

I have all of my development tools installed on Host A. I have one NIC on host A configured for an ip on the 192.168.1.0 network such that I can connect to either Host B or Host C's network. I have one additional NIC on host A that can be used as well.

My question is, what options, if any, do I have to connect to both Host B and Host C at the same time? Given that I am only allowed to change the configuration on Host A and must not change the configuration on Host B, Host C, or any hop along the way.

My first thought was that I could solve this problem using NAT translation on Host A. But I wasn't sure how that would have to be configured, or if that is even going to work for my situation.

kenen

Posted 2014-03-13T22:00:10.390

Reputation: 11

Are you sure these are routers? If Hosts A and B both have IP addresses in 192.168.1.0/24, then the router should return an error when you try to assign an address to the 2nd interface. Do you know the IPs of the four router interfaces? (I assume you can't change these either, but you'll at least need them to set the gateways on host A's NICs) – Spamwich – 2014-03-13T22:14:26.143

If I was in your shoes I would be setting up NAT on each of the routers using different IP addresses for each. Then from host A I would simply use the two different addresses. @user3050461: That's simply incorrect. If it was the same network then some device (which may be the router) would send an arp reply that should cause an error as the second system is brought up. If they are not the same network then it's perfectly acceptable. Anycasting is a bit similar. With that you typically rely on BGP to route the packets to the for you however.

– yoonix – 2014-03-13T22:37:15.537

@user3050461 I may not understand the question. Right now I'm not using the second NIC in Host A. I'm just configuring the first NIC for an open address on the 192.168.1.0/24 network and physically plugging it into one of the two routers. – kenen – 2014-03-13T22:40:17.320

@yoonix I phrased that poorly. What I meant was that the router won't like having two of its own interfaces assigned addresses in the same subnet. – Spamwich – 2014-03-13T22:49:49.853

@user3050461 Ah, I understand. This is my fault for not completely understanding the network before asking the question. I believe there are switches and VLANS involved as well. I was attempting to limit the diagram to the only devices that I thought were relevent to the question. I have been plugging Host A into a patch panel which goes to one of two racks that contain Host B or C, routers, switches and a bunch of devices that are external to the path from Host A and B/C. I'll update the question to make it more clear, especially since I can't really modify anything outside of Host A. – kenen – 2014-03-13T23:03:36.603

1@kenen Ok I too am starting to get a better picture. If you have identical configuration and addressing on both NICs then your development tools on host A need to be able to specify which interface to use. I would probably just disable one eth interface at a time for the sake of simplicity, but I'm no dev :) – Spamwich – 2014-03-13T23:20:56.693

The translation can't be done on host A because what are you going to use as the NATed address? If you had an address that could reach one host and a separate for the other you probably would just use those addresses to begin with. ;). @user3050461: gotcha. I figured that's what you meant after I wrote that. Sorry for the confusion. – yoonix – 2014-03-13T23:55:33.050

Answers

0

Answer depends on network service acessibility/requirments. But in general you may to use NAT on one of two networks (B or C). For example you must hide Network B behind NAT and on router with NAT configure port forwarding for required services.

This can do even cheap soho router - it's better way than configuring NAT directly on Host A - more independent on Host A hardware renewal (upgrades, malfunctions...).

See example diagram:

Host A NIC 1 (192.168.2.1) --> || router WAN -- router LAN || --> Host B (192.168.1.2)

Host A NIC 2 (192.168.1.50) --> Host C (192.168.1.2)

RAD-X

Posted 2014-03-13T22:00:10.390

Reputation: 1

0

Wow. Someone put you in a really crummy position. You should have serious words with them. Also, this is why IP address planning and avoiding IP address reuse is important, even on internal networks with unrouted IP subnets.

I think you could use static ARP entries on host A. How exactly that works may be a more challenging question, given that they are on different "network cloud"s. If you can connect one of these network clouds to your second adapter, then my suggestion (and this is an EVIL EVIL HACK THAT WILL BREAK) is:

Adapter 1:

  • IP: 192.168.1.50/25
  • Connected to network cloud for host B

Adapter 2:

  • IP: 192.168.1.178/25
  • Connected to network cloud for host C

Static ARP entry:

  • 192.168.1.130 -> MAC address of host C

Now you can access host B as 192.168.1.2, and host C as 192.168.1.130, and packets will travel the correct interface to get there. So it might work. At least until you can get the network problem solved.

Caveats (oh, boy are there caveats):

  • Host A can't get to hosts in the upper half of 192.168.1.0/24 on the network with host B, and the lower half of 192.168.1.0/24 on the network with host C.
  • Host C sees host A as 192.168.1.178 instead of .50. (you can use an unused IP address in the upper half of that network if 178 is taken).
  • You need to configure the routes and static ARP entry to be established on boot.
  • You need to place your default route out of the computer carefully based on the gateway's IP address; you may need to change which network contains your default route.
  • In order to prevent this from breaking at _every_subsequent_network_change_, you will have to enforce really really strict network change control that, if you could enforce, would mean you could have resolved this problem correctly or prevented it.

Note to future editors, please don't be shy about adding reasons this answer is a horrible hack or ways it can go wrong.

Slartibartfast

Posted 2014-03-13T22:00:10.390

Reputation: 6 899