5

Because I do not find the correct question that I can ask google, due to the lack of terminology. I'm trying to ask it here. Please have patience.

My Question is similar to the questions asked here and here .

How to connect to devices that have a the same ip address 192.168.1.1. Clearly this is not possible because a IP address needs to be unique.

Which setup do I need, in order to access multiple devices that have the same id.

The idea that I have so far is to use a managed switch that maps the IP address 192.168.2.n to 192.168.1.1

Image of Routing Overview: Image of Routing Overview

enter image description here

If a setup like the image above suggests could be achived, then could you please guide me to how to set it up. Also I'm very thankful if you could provide me with the right terminology of what I'm trying to achive.

Like: Connect two Vlan from port 1 to Port2 with a bridge ....

The Author of the post above suggested: The managed switch is setup so that each port is vlan'd into its own untagged vlan and all of those vlans are tagged on the port connected to the PC. What does it mean, can you explain further?

Your help is highly appreciated.

PS: What I really trying to achieve is to automate the installment of software on a Linux device that by default comes with a default IP address of 192.168.1.1. Detect the connected device on the network ssh into it and install & configure the software.

7
  • Switches are layer-2 devices that know nothing about layer-3 protocols, e.g. IP. If you want to change an IP address on packets, that is known as NAT (Network Address Translation), and you need to use NAT on a layer-3 device, such as a router.
    – Ron Maupin
    Feb 1, 2017 at 17:27
  • You can't change the linux IP before you try to install software? It would be the easiest solution.
    – John K.
    Feb 1, 2017 at 18:15
  • Thank's @RonMaupin with your helpful comment. I'm intending now to use a Raspberry Pi and setup NAT.
    – chrisber
    Feb 1, 2017 at 18:21
  • It's AndyPipkin2011, masquerading as Karl. Feb 3, 2017 at 4:05
  • :), Yes I know.
    – chrisber
    Feb 21, 2017 at 22:08

4 Answers 4

1

Here is how I would do it.

Get a linux box and fit enough network interfaces that each device you want to talk to can have it's own port.

Put each of the device ports in it's own network namespace. Connect the network namespaces back to a bridge in the main network namespace using veth pairs.

Now in each network namespace you can use NAT to translate a unique PC-side destination address to a non-unique device-side destination address.

2
  • Actually, you don't necessarily need more than one network interface. Just get a $100 managed 8-port switch supporting VLAN, and then configure a trunk port seeing VLANs 2 and 3, and associate another port to VLAN 2 and a third port to VLAN 3. However, I'm not sure how well VLANs interact with network namespaces.
    – juhist
    Feb 2, 2017 at 18:47
  • I think you can create a bridge for each VLAN in the main network namespace, then use veths to connect the secondary network namespaces to those bridges. I haven't actually tested this though. Feb 2, 2017 at 18:49
2

Your drawing and idea have some problems:

  • Your router has multiple interfaces in the same network, but that will not work. Routers route between networks, not from a network back to the same network, so router interfaces must be in the different networks.
  • Switches are layer-2 devices, and they are ignorant of layer-3, e.g. IP. Layer-2 can carry any number of layer-3 protocols (IPv4, IPX, IPv6, AppleTalk, etc.) because they do not know or care about layer-3.

The idea of changing IP addresses on packets is NAT (Network Address Translation).

A real problem for you is that on whatever network a PC connected, changing the address on the PC to a different network address will stop the PC from communicating after you change the address.

3
  • A router can have multiple interfaces on the same network. It's called bridging. Also, is IOS SLB not a fit here? Feb 2, 2017 at 22:42
  • Those would not be router interfaces, those would be bridge or switch interfaces. You certainly would not assign them layer-3 addresses as depicted in the drawing. I don't know about SLB, I have not rendered any opinion on that, although it doesn't seem to fit with the question where the goal is to reconfigure hosts that have the same default address configured on them.
    – Ron Maupin
    Feb 3, 2017 at 0:24
  • They would be bridged interfaces on a router. Technologies such as DLSw+ and RSRB for SNA, CRB, while never known by most, still exist in everything and the kitchen sink ks/enterprise versions of IOS, Feb 3, 2017 at 3:58
0

The managed switch, when configured to only switch those port pairs, is basically doing nothing. I will assume that you have two devices in each identical network, such as at least 192.168.1.1 and 192.168.1.2 on port 1, the same on port 3, the same on port 5, etc.

In this case, you need to set up "static NAT" on the router, to map the addresses in your "naughty" networks into some global space. For example:
192.168.1.N on port 1 maps to 10.0.1.N
192.168.1.N on port 3 maps to 10.0.2.N, etc.

(I used 10. addresses to avoid confusion, but of course you could fit them in 192.168.x range)

If there are in fact a lot of devices on each network, your switch supports VLAN tagging, and your router supports link aggregation, you could, instead of "bridging", tag the VLAN of each switch port going to a "naughty" network, and use that to NAT them on the router. This way the bandwidth to and from the router can be spent on different networks dynamically. (Note that this will usually not improve the speed of any one stream, but is very useful in the presence of multiple streams.)

1
  • 1
    Thank you for your contribution. I fixed it years ago, like Peter Green suggested. Was the simplest solution.
    – chrisber
    Mar 30, 2022 at 11:27
-2

Your question says "How to connect to devices that have a the same ip address 192.168.1.1. Clearly this is not possible because a IP address needs to be unique." However, that is exactly what Cisco's IOS SLB Feature indicates. See below.

Configuring IOS Server Load Balancing with HTTP Probes in the Dispatched Mode

The Cisco IOS® Server Load Balancing (SLB) feature is a Cisco IOS-based solution that provides server load balancing. This feature allows you to define a virtual server that represents a cluster of real servers, known as a server farm. When a client initiates a connection to the virtual server, the IOS SLB load balances the connection to a chosen real server, depending on the configured load-balance algorithm or predictor.

IOS SLB can be configured to operate in the following two modes.

dispatched mode—In this mode, the virtual server address is known to the real servers. You must configure each of the real servers with loopback addresses for their unique loopback interface. This is necessary to give each machine in the server farm the same IP address as the actual virtual server. The destination real server will then be allowed to respond directly to clients using the loopback address, just as it would for its own IP address. IOS SLB redirect packets to the real server at Layer 2 at the media access control (MAC) layer. Since the virtual server IP address is not modified in dispatched mode, the real servers must be Layer 2-adjacent to IOS SLB, or intervening routers might not be able to route to the chosen real server.

1
  • "The virtual server IP address is configured as a loopback address on each of the real servers." Is SLB not a fitting solution here? Feb 2, 2017 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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