Author Topic: Seeing device from network B in network A  (Read 7721 times)

0 Members and 2 Guests are viewing this topic.

Offline CloudTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Seeing device from network B in network A
« on: January 21, 2021, 07:58:36 am »
Networking is something that I don't know a lot about so I don't know how to properly search for this.
So I have a device in network B that I need to be able to see in network A.
Config that I have is:
Modem
Switch
Router A Router B

So if I understand correctly I have set port forwarding for IP of my device on router B but what do I have to set up on ruter A?
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #1 on: January 22, 2021, 01:20:17 pm »
Networking is something that I don't know a lot about so I don't know how to properly search for this.
So I have a device in network B that I need to be able to see in network A.
Config that I have is:
Modem
Switch
Router A Router B

So if I understand correctly I have set port forwarding for IP of my device on router B but what do I have to set up on ruter A?


No responses...   2 cents of some...

NO you definitively  will not need port forwarding for this.

You need to configure your routers in the same network - that simple

*UNLESS* obviously you can not do so (they are already in different networks)
and in that case you need  a third router which will be configured doing
the proper routing table among your targets *OR* a way to do that
in one of the 2.. (unlikely)

First solution is trivial... and recommended
second one requires minimal routing skills - not trivial

There are indeed a list of other methods and alternatives..
will not go that deep.

Try the first one.. put all your eqip, inside the same network
with a single one WAN external IP

Paul
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #2 on: January 22, 2021, 01:45:41 pm »
Please draw a diagram of your network, note port types (LAN/WAN/...), IP addresses/networks and things like NAT, and explain what you are trying to achieve in more detail. It's impossible to give a proper answer based on your very brief overview.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Seeing device from network B in network A
« Reply #3 on: January 22, 2021, 01:56:56 pm »
You probably have your network configured incorrectly to begin with.

Typical small scale LAN networks should always have only one router in it (unless you have a good reason for needing more)

Unless you are connecting multiple premises together the whole network should just be a sea of switches talking to each other, all of the devices connecting to switches (including access points that provide distributed wifi) and then at one point there should be a single router that connects to the modem in order to connect the LAN to the internet.

The router is the single authority that gives out IP addresses and does the routing for any traffic that goes outside into the internet where you are most likely represented as a single WAN IP. Internally to the network the switches are smart enough to find paths between all the devices.

When you have two routers doing NAT translation for separate areas of the network this makes one network treat the other network as if it is some random network somewhere on the internet and hence you can't just directly connect to devices on it, the router serves as a gate keeper to those devices and so needs to be specifically told to expose devices to the outside. In 95% of LAN use cases this is not desired and just causes the problems you are having.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #4 on: January 22, 2021, 02:28:00 pm »
Unless you are connecting multiple premises together the whole network should just be a sea of switches talking to each other, all of the devices connecting to switches (including access points that provide distributed wifi)

Sorry, without knowing anything about a network that could be a quite bad advice. Or would you, for example, place all PCs, IoTs, VoIP devices and the WiFi for guests in one LAN segment?
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4955
  • Country: si
Re: Seeing device from network B in network A
« Reply #5 on: January 22, 2021, 03:25:00 pm »
Unless you are connecting multiple premises together the whole network should just be a sea of switches talking to each other, all of the devices connecting to switches (including access points that provide distributed wifi)

Sorry, without knowing anything about a network that could be a quite bad advice. Or would you, for example, place all PCs, IoTs, VoIP devices and the WiFi for guests in one LAN segment?

For this reason large switches support VLANs and trunking to slice up the network as needed without having to have multiple completely physically separate networks, yet still simple dumb switches can be used in sections on the network that only belong to one VLAN.

High end routers also understand VLANs so they can route traffic from those network segments accordingly, even if it all comes through one ethernet or fiber cable.

And if they require networks physically air-gapped due to security then they would have probably also found the money to hire an IT professional that knows how it's done properly.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #6 on: January 22, 2021, 04:03:32 pm »
Most SOHO routers support VLANs too (SoC and switch chip). Unfortunately not all web interfaces allow the configuration of VLANs but you could install an alternative firmware like OpenWrt (if available for your router) to get full control.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #7 on: January 22, 2021, 04:08:42 pm »
I am guessing ...

that he is mostly calling a "router"  actually  operating solely as a layer 2 switch...

But *UNLIKE* mentioned above.. I have seen more and more cases
where  end users are having MORE THAN ONE PROVIDER

and so more than one WAN IP which requires a proper segmented
trunk in which both networks can be routing traffic.. example.
- an air  FIBER  that uses data sharing per channel and thus some
 hours of day is really bad or really expensive.
- the user also signs a private operator (GSM or other) in which
he can use the signed device as a routing target..

so in these cases both networks would be part of the routing table
and a minimal setup of "real router" is required.

That is all OSI 3 layer despite those "switches" spawned in his home/office
whatever..

This last case scenario is increasing with the advent of AIR FIBER..
and shared antennas  MIMOs  setups..

YES THE SCHEMA WILL HELP to answer..

Paul
 

Offline CloudTopic starter

  • Regular Contributor
  • *
  • Posts: 194
  • Country: si
Re: Seeing device from network B in network A
« Reply #8 on: January 27, 2021, 12:56:44 pm »
Sorry for not knowing correct terms since I don't have a lot of experience with networking.

Please see attached network diagram I have included just devices that are relevant.

I have sonoff flashed with ravencore on one network but other smart devices and homekit hub on other network and for that sonoff to work properly it needs to be seen in network with homekit hub.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #9 on: January 27, 2021, 01:35:34 pm »
Are the WAN interfaces of the two WRT54GLs connected to the switch? Is the modem a router with integrated modem and does it perform NAT for the attached LAN?
« Last Edit: January 27, 2021, 01:57:49 pm by madires »
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6203
  • Country: ro
Re: Seeing device from network B in network A
« Reply #10 on: January 27, 2021, 01:41:57 pm »
You need a bridge between network A and B.

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #11 on: January 27, 2021, 02:46:41 pm »
You need a bridge between network A and B.

Yes .. possible...  but more complicated setup..

He actually just need to  put both "routers" (which are
operating as switches only) into the same subnet.

ASSIGN AS THE MAIN "GATEWAY" :  192.168.1.1

ASSIGN your first "router" (switch) the IP:  192.168.1.10
   CLIENT:  ABOVE 192.168.1.100  via  Dynamic IP starting 100~200

ASSIGN your second "router" (switch) the IP:  192.168.1.20
   CLIENT:  ABOVE 192.168.1.100  via  Dynamic IP starting 100~200


SINGLE DNS SERVER on the gateway 192.168.1.1 (IMPERATIVE just one DNS)

this works fine. Done that with several devices... actually
more than 10 switches with dozen clients each..


Your devices need to allow their IP config.

SMART TRICK:  YOUR GATEWAY  DNS allows you
to define the "Dynamic range" -  define as 100~200.

Use the MAC  addr of each router to impose the IP
this way WRT54GL-ETH  XX:XX:XX:XX:XX:XX    192.168.0.10   
on the MAC  association table.

the MAC of your device is printed on the case
use the right numbers instead of those XXX above


This way your device will receive the assigned  **STATIC** IP
while CLIENTS  will receive dynamic IPs

Paul

PS:  BTW..  DISABLE  DNS in all devices EXCEPT  192.168.1.1
« Last Edit: January 27, 2021, 03:06:15 pm by PKTKS »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #12 on: January 27, 2021, 03:08:49 pm »
Maybe there's a reason for the separate networks. You first have to figure out the intention of the current design before being able to give an advice. So let's ask about the details step by step since the OP isn't a network expert.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #13 on: January 27, 2021, 04:04:37 pm »
Maybe there's a reason for the separate networks. You first have to figure out the intention of the current design before being able to give an advice. So let's ask about the details step by step since the OP isn't a network expert.

There is none in this case.

It seems that some  autoconfig just picked those odd subnets.

Anyone can and should put all the internal devices in the same subnet
like I said above... quite simple.

ONE SINGLE DHCP - config range of dynamic in 192.168.1.100 to 192.168.1.200
(ALL OTHER DHCP SHOULD BE OFF)

ASSIGN STATIC IPs  based on  MAC of each device to the DNS server.
below 100.

Let all clients pick a dynamic IP

done..   all devices are automagic seen by each other
Subnet mask is 192.168.1.0/255.255.255.0

Paul
« Last Edit: January 31, 2021, 04:10:52 pm by PKTKS »
 

Offline gmb42

  • Frequent Contributor
  • **
  • Posts: 294
  • Country: gb
Re: Seeing device from network B in network A
« Reply #14 on: January 28, 2021, 11:23:53 am »
Maybe there's a reason for the separate networks. You first have to figure out the intention of the current design before being able to give an advice. So let's ask about the details step by step since the OP isn't a network expert.
There is none in this case.

There are many possible reasons for multiple subnets, just ignoring them because you may not know how to configure routing isn't really the answer the OP is looking for.

Anyway, the diagram doesn't show the IP's assigned to the "WAN" side of the WRT54GL devices, I'll assume they are connected to the switch and have addresses in the 192.168.1.0/24 subnet.  These addresses should be statically assigned and NOT obtained via DHPC from the ISP modem as you need to add a route between these devices to allow packets to travel between their respective subnets.

Assume the L.H. device (call it Router A) has a "WAN" IP of 192.168.1.10 and the R.H. device (Router B) has a "WAN" IP of 192.168.1.20, these are the routers for their subnets (192.168.5.0/24 & 192.168.6.0/24) respectively.

Router A needs to have a route added that sends packets for the "other" subnet to Router B:

dest 192.168.6.0/24
gateway 192.168.1.20
interface "WAN"

Similarly Router B needs a route that sends packets back to the router A subnet:

dest 192.168.5.0/24
gateway 192.168.1.10
interface "WAN"

Depending on the software running on router A & B you may also need to add ingress and egress rules to allow the traffic to flow over the new route.  You may also want to restrict that traffic to certain protocols and ports, or even restrict which side can initiate connections.  All this is "medium" level network knowledge but unfortunately can be given different names in different contexts.
 

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: au
Re: Seeing device from network B in network A
« Reply #15 on: January 31, 2021, 11:58:44 am »
ONE SINGLE DNS - config range of dynamic in 192.168.1.100 to 192.168.1.200
(ALL OTHER DNS SHOULD BE OFF)
Do you mean DHCP when you say DNS?
DNS is domain name server, and it doesn't really matter if there's more than one on a network as long as they work. But it is unusual for a home network to have one. Usually there's none and use the ISP DNS.
DHCP is (I think) dynamic host control protocol and you can have more than one as long as they offer different ranges. I have two, one in a router, one in a Linux server, never had a problem. client machines sometimes change their IP address because they swap from one to the other, but that's no problem. The protocol is designed to allow multiple DHCP servers. I have the same MAC->IP mapping in both for things I want to stay with one IP address.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #16 on: January 31, 2021, 12:57:00 pm »
Different names for almost same thing...

While DHCP is mostly a protocol which runs offering part of DNS services...

bottom line is that the DHCP server will answer for local request
assigning IP to local clients...

while the DNS server (I run mine alone inside the intranet and extranet..)
will resolve all the  requests that are not local forwarding them to
proper uplevel domain authority


BOTH ARE REQUIRED .. if you don't  have your own DNS server...
your   setup requires a "forward"  to some DNS server outside your domain..

Paul


PS  What  matters here is that  WE ARE REQUIRED TO HAVE A SINGLE ONE DHCP SERVICE
...e..g.   inside our domain just a single DHCP server is allowed to answer...

while multiple DNS servers not only CAN but SHOULD be running
for proper safety reasons.. 

I RUN A TOTAL of 4 DNS servers ... and ONE SINGLE  DHCP  SERVER...

« Last Edit: January 31, 2021, 01:01:48 pm by PKTKS »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #17 on: January 31, 2021, 01:15:42 pm »
DHCP is (I think) dynamic host control protocol and you can have more than one as long as they offer different ranges.

You don't want to have multiple DHCP servers in one LAN segment competing with each other. Just one active DHCP server or proxy per LAN segment!

PS: Dynamic Host Configuration Protocol
« Last Edit: January 31, 2021, 01:19:09 pm by madires »
 

Offline gmb42

  • Frequent Contributor
  • **
  • Posts: 294
  • Country: gb
Re: Seeing device from network B in network A
« Reply #18 on: January 31, 2021, 01:20:45 pm »
DHCP is (I think) dynamic host control protocol and you can have more than one as long as they offer different ranges.

You don't want to have multiple DHCP servers in one LAN segment competing with each other. Just one active DHCP server or proxy per LAN segment!
Not normally required for home networks, but larger networks will have multiple DHCP servers for failover scenarios.  Supported by Windows Server since 2012 and by the various DHCP servers on other OS's.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #19 on: January 31, 2021, 01:25:57 pm »
Not normally required for home networks, but larger networks will have multiple DHCP servers for failover scenarios.  Supported by Windows Server since 2012 and by the various DHCP servers on other OS's.

Well that will certainly require a SEGMENTED LAN (VLAN)
where each segment will run a single DHCP server...

Personally I prefer to assign in that cases  a fully functional named record
<host.domain>  IN A  <IP>

for each of fixed clients segmenting the VLAN properly by domain name...
that  results in  isolated LAN trunks (better routing firewalling..)

Each VLAN trunk will just run a single DHCP server..

<domain>  IN NS <mydns>

records will do the rest...

Paul
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #20 on: January 31, 2021, 01:42:01 pm »
Different names for almost same thing...

DNS is for resolving names into IP addresses and vice versa, plus some additional information for various purposes. DHCP is for auto-configuration of a client's network settings. Completely different protocols.
 
The following users thanked this post: MIS42N

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #21 on: January 31, 2021, 01:50:13 pm »
Not normally required for home networks, but larger networks will have multiple DHCP servers for failover scenarios.

That's what I've meant with "active". One is active and the optional other ones are in stand-by mode.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7765
  • Country: de
  • A qualified hobbyist ;)
Re: Seeing device from network B in network A
« Reply #22 on: January 31, 2021, 02:36:37 pm »
Not normally required for home networks, but larger networks will have multiple DHCP servers for failover scenarios.  Supported by Windows Server since 2012 and by the various DHCP servers on other OS's.

Well that will certainly require a SEGMENTED LAN (VLAN)
where each segment will run a single DHCP server...

Nope! For example:
- Windows Server 2012 https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn338983(v=ws.11)
- ISC DHCP https://kb.isc.org/docs/aa-00502
- ISC Kea https://kb.isc.org/docs/aa-01617

And it's not just about fail-over, you can also have load-balancing.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1766
  • Country: br
Re: Seeing device from network B in network A
« Reply #23 on: January 31, 2021, 04:12:45 pm »
ONE SINGLE DNS - config range of dynamic in 192.168.1.100 to 192.168.1.200
(ALL OTHER DNS SHOULD BE OFF)
Do you mean DHCP when you say DNS?.

yes misplaced terms.. fixed... Thanks
 

Offline MIS42N

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: au
Re: Seeing device from network B in network A
« Reply #24 on: February 01, 2021, 12:05:45 am »
DHCP is (I think) dynamic host control protocol and you can have more than one as long as they offer different ranges.

You don't want to have multiple DHCP servers in one LAN segment competing with each other. Just one active DHCP server or proxy per LAN segment!

PS: Dynamic Host Configuration Protocol
Yes. I haven't had to think what DHCP actually stood for, for quite a while. So I just guessed.

DHCP servers do not 'compete with each other' if they offer different address ranges. So there can be more than one on an unsegmented LAN, they will happily coexist (as mine do). There is a situation where a DHCP server thinks it is authoritative, and a client asks for a previously allocated address the server isn't able to give.  The client response to a server refusal should be "you didn't give me the IP address I asked for. Give me one of yours" and things go on without a problem. If the server is non-authorative and the issuing DHCP server is not available, the client does not get any joy and should conclude after some timeout that it it isn't getting its old address back and ask for a new one anyway. Any server will respond to that unless its address range is full.

Failover is a different thing. It requires DHCP servers to interact. One of my DHCP servers is the router and it doesn't have that sort of configuration option.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf