I have 2 sensors with the following IP addresses:

Sensor A IP:

Sensor B IP:

I am able to connect them to my laptop separately using for Sensor A and for Sensor B.

What IP address and network mask can I use to connect both at the same time?

  • Not quite. I just need an IP address that I can use. I don't want to learn the calculation methods, which the other post gives May 10, 2018 at 6:41
  • Yes, but that Q/A would tell you how you can fix your problem.
    – Zac67
    May 10, 2018 at 6:43

2 Answers 2


Both devices are required to be in the same subnet in order to communicate directly or use a router. As it is, they are in separate subnets and

You either needs to adjust one side's 3rd octet or reduce the netmask to /16.

If all else fails, you can statically assign IP addresses from both subnets to the laptop's NIC.

  • "You either needs to adjust one side's 3rd octet or reduce the netmask to /16." The "or" implies that I can somehow get away without modifying the sensors' configurations. Is that what you really meant? I cannot modify the devices' configuration. Given that, will the IP address / as the laptop's IP address work with them? May 10, 2018 at 6:49
  • With reducing the mask on the laptop only, it would be able to reach the device, but the device would still require a router to reply. I've added to option for dual IP bindings in my answer.
    – Zac67
    May 10, 2018 at 6:55
  • Could you please elaborate on the added option? How do I do that? I am using Ubuntu 16.04. Will that be done in the "Edit Connections" part? May 10, 2018 at 7:04
  • Sorry, host configurations are off-topic here. But maybe help.ubuntu.com/lts/serverguide/network-configuration.html can help you.
    – Zac67
    May 10, 2018 at 12:07

On the presumption this is a real life problem and you can't reconfigure anything on the two sensors nor are they configured to use a router. And also assuming the sensors are configured as /24 (you don't actually say this).

  • reduce the subnet mask on the host to /23 or smaller
  • Assign addresses on the host in both subnets.

Of course you end up with mismatched subnets: the host considers the network to be /23, while the two sensors consider themselves to be in two non-overlapping /24 networks. This situation is to be avoided if you can possibly help it: all kinds of trouble can ensue. But if you have a practical problem, sometimes you have to be pragmatic. I'd consider this to be okay if you're taking final backups from something you're taking out of service, but just to repeat, try hard to ensure it's temporary.

Sensor A IP: Sensor B IP:

Concretely for Unix-like systems including Ubuntu, assuming an ether interface eth0:

ifconfig eth0 netmask
ifconfig eth0:1 netmask

For a Cisco router to be in both subnets, assuming interface Ethernet0:

interface Ethernet0
  ip address
  ip address secondary

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