0

enter image description here

I am connected to a switch. This switch is connected to a router. My PC gets its IP address from this router. I connected a second router (Router C in the image) to the switch. "Device A" is connected to this router.

I can not request any information with "Device A". How can I get a connection from PC to "Device A"? How can I get the IP-address of "Router C". I would like to login from PC to "Device A" with SSH.

Are there any resources or similar questions where I can look it up?

2
  • 1
    Apparently router C is redundant? I assume it's to provide WiFi? In that you should make it work in access point mode if possible, or disable NAT and add static route for its network to the "main" router. You may also enable "DMZ" or port forwarding on C for A instead.
    – Tom Yan
    Commented Nov 8, 2019 at 10:49
  • Are they all on the same subnet? If so, having a router there seems weird
    – JensV
    Commented Nov 8, 2019 at 12:04

2 Answers 2

0

So in normal cases (when the routers act as routers) You have at least 6 IP addresses and 3 networks involved.
Assuming You want the logical structure same as the physical one.
Network 1: internet. Address 1a: public / outside IP address of Your router reachable from internet.
Network 2: internal network between PC, Router C and Internetrouter. Main network.
Address 2a: private / internal address of Your Internetrouter.
Address 2b: Your PC.
Address 2c: One of the network interfaces of Router C connected to the switch.
Network 3: internal network between Router C and Device A.
Address 3a: Router C's others interface connected to Device A.
Address 3b: Device A.

So given Your address 2b is dynamically assigned by DHCP server on Address 2a, You would configure DHCP server to not dynamically assign all available addresses of the network. One (2a) it needs statically assigned to it's own interface and one (2c) needs to be statically assigned to router (whether via DHCP or manually does not really matter in the end).
Now You configure routing table of PC to use address 2c as gateway/router for Network 3 or Address 3b. Also You may want to configure Your internet routers routing table for this route (if Device A should access Internet and You want to avoid duplicate NAT).

There are alternative setups of course. Most common clean alternative if Your internet router is a real router supporting more then one internal network:
You have 7 addresses and 4 networks involved.
Network 1: internet. Address 1a: public / outside IP address of Your router reachable from internet.
Network 2: internal network between PC and Internetrouter. Main network.
Address 2a: private / internal address of Your Internetrouter.
Address 2b: Your PC.
Network 3: internal transfer/backbone network between Your both routers. Address 3a: another private / internal address of Your Internetrouter.
Address 3b: One of the network interfaces of Router C connected to the switch.
Network 4: internal network between Router C and Device A.
Address 4a: Router C's others interface connected to Device A.
Address 4b: Device A.

In this case You would set the route to Network 4 or Address 4b to go via Address 3b on Internetrouter and the route to Network 2 to go via Address 3a on Router C.

Where the 2nd being the default way if setting up networks but it may not be possible with consumer equipment.

It's technically not necessary that the addresses within one of the above networks are in a common IP subnet as You can define point to point routes but it is advisable and You would do it whenever possible.

But maybe You do not want to use Your router C as IP router but for example only as access point for WiFi or as Firewall between Device A and PC/Internetrouter while using the same IP network (so from IP point of view have only 2 networks in the picture, the outside Internet and the inside LAN)?

At all You need to know at least the address of router C reachable from switch and the address of device A to be able to connect from PC to Device A. So regarding question how You can get the address of Router C (which would have more then one if it acts as a IP network router) the answer is: You have to. (Check device documentation, labels, User interfaces). Or if it shall take an address from DHCP on Internet router, it depends on how You get the information from the internet router. (Check its documentation, User interfaces or dynamic internal DNS features.)

0

You do it the same way as if "PC" was on the Internet and "Device A" was in a LAN. You need to open ports on the router and setup port forwarding.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .