Transfer data between two devices on different routers on the same modem - networking

I have two devices, a PC and a RaspberryPi, that are connected to two different routers (one has VPN, one does not), that are connected to the same modem. (See diagram). The two routers are physically separated, so it would be difficult to connect them with a cable.
I am trying to access the RaspberryPi from my PC using SSH to run programs remotely on the Pi, and have the Pi send data that the program scrapes back to my PC for processing.
My question is, is this possible? And if so, how would I be able to implement it?
Thanks

I had this working (prior to my network reconfigure).
What I did was set router A as DHCP server.
Router B was configured as not to hand out IP Addresses.
Connect router A and router B on the LAN side.
All clients went through Router A, unless the devices' IP Settings were changed. I only changed gateway to router B to have the secondary connection.

Related

I have a screen sharing service hosted on one router and the target screen(a smart tv) connected to another router. What can I do to connect them?

The first router (Telekom something) which is connected to the cable from outside is the one which the smart tv is connected to. The second router (Asus something) is connected through the first one and hosts a separate wifi network from the first. My pc is connected to this router through a LAN cable. I'm trying to use a screen sharing program called Deskreen which hosts a website from the computer and can be reached by typing in the ip address of the computer into a browser. This only works on the same network that the pc connected to.
I tried searching online but I couldn't find anything about a similar situation. My main question would be if I can somehow reach the other router from the smart tv since the two routers are connected.
Yes, use more specific networks that are part of the block on the first router (if you have at least a /29 block), and enable proxy arp (should be on by default).

Separate LAN's using 2 Routers - Can ping devices on other LAN

so the setup I've got:
Main Router which receives the internet connection and is my primary WIFI network: 192.168.1.0/24
Secondary Router which I've connected via the following method to create a separate LAN: 10.3.3.0/24. Main Router's LAN port --> Secondary Router's WAN port.
I've got this setup fine and can get internet from the Secondary Router's LAN, no problem.
My question is: Is it normal behavior to be able to ping a device connected to the main router from the secondary router?
I would like to isolate devices on each LAN so that devices connected to the separate LAN's can't communicate and wondering if I'm able to achieve this using 2 consumer grade routers?
Cheers!
This is normal behavior because the secondary router knows that IPs in the 192.168.1.0/24 subnet should be forwarded to its WAN port, so it can access hosts connected to that network.
Sadly, you usually can't create 2 segregated subnets with 2 consumer-grade routers, as these only have 2 network interfaces (one for WAN and one for the built-in switch).
I also do not recommend doing this, as double NAT can have unexpected side effects. If you really want to separate devices on your local network, looking into VLANs is a better way. You can use your existing router but will need a compatible switch.
If your routers support vlan management you should use separate vlans for both subnets. Otherwise you cant devide your networks.

Same ip address for multiple devices?

I want to develop an Android app that connects with a Windows desktop application via TCP/IP.
However I have very little knowledge of networking and so please forgive me if this is a very basic doubt.
My Windows based laptop as well as Android phone are connected to the internet via the same WiFi router.
Now I checked the IP address for my laptop as well as phone using a website.
Both are same!
If both have the same IP address, then to achieve networking between these devices I will choose different set of port numbers.
Will this connection work?
Is the connection happening via the internet or just locally on my
router?
EDIT: After reading the answer from #Doon, I have broadened my question.
Let's say the local address of laptop is 192.168.1.10 and that of phone is 192.168.1.20.
If I code my application to use these IP addresses, it should work as it is a local network.
But what if I want my laptop to connect with another phone which is not connected to the WiFi router, rather by 3G network.
Then which IP address should be used for the laptop and the other phone?
Since I am not allowed to use any other server, I am going to use port forwarding i.e. the user will type in the IP address displayed on the other device. The connection could be initiated on either one of the devices.
If you could also show how to do this programmatically, it would be very helpful.
My Windows application is developed in C++ using Qt.
All of your devices are sharing 1 external or WAN IP address using NAPT (network address port translation). Internally on your LAN each device has its own address. So yes it will work but you are going to need to use internal addrss and the devices actual IP address not its perceived address via an external service.
As for the connection locally or via router that all depends on where you are connecting to. If both end points are on your lan or on the same Subnet then the router will not be involved. So in the average home network between your phone and desktop both connected to the same network say via wifi then they are most likely layer 2 adjacent (see the OSI 7 layer model for more info on layer 2 vs layer 3). But once they are not on the same network then routing will be involved and your router will be used. If the phone is connected to 3G or the cell data network and you want it to talk to your desktop on your home network you are going to need to deal with port forwarding on your router and other such fun things.
In regards to updates. Once you leave the local network it gets more complicated especially with IPv4 as address are running out so there is more and more use of nat or IPv6 with 6 to 4 gateways. Do you want the laptop to initiate connect to the phone or phone to the laptop? But normally you will need to iterate your address on your interfaces. Then connect with an external service to get your external IP address and compare and see if they are the same. if both endpoints are dynamically assigned you will need some sort of location mechanism could be dynamic DNS could be locator service etc.

Sniff Packets on Local Network

I have a network, consisting 4 PCs. All PCs are connected to a hub.
One of these PCs has two network interfaces which one of them is connected to the hub. and the other one in connected to the internet.
How can i configure this PC to sniff in the internal hub network, and capture all pockets and send them to the specific destination on internet? (I do not what this PC to change the source address of packets just destination address to the remote machine on the internet! so that when the packet arrived at the remote machine, it contains the address of one of other 3 PCs as the source)
IS it possible at all?
I'm not sure to understand exactly what you want, but if you want to access an external network from your 3 pc, you should set the pc with two cards as the default gateway. On the pc with two cards you should also setup some kind of masquerading. However, at the destination point you'll never have the exact source address, but the addres of the pc doing the nat/pat translation.
Do I understand correctly you want to "spy" the other computer? If you're on the same network, you can try to use Wireshark to capture all traffic going over a router.

IOS4 - Send data using UDP socket on Wifi

I am trying to send data using the AsyncUDPSocket class. And I can send data using the iPhone simulator over the wire to another machine that is running a simple C-coded listening server. I can also receive data over the wire using a client connected to the simulator(server). However, when I tried the same over Wifi, using the simulator, I could only send data but not receive any data.
I read on another post, that unicast data makes this possible. How can I acheive this using AsyncUDPSocket?
Thanks,
Angelo.
Ok, I figured this out. A newbie kind of thing, really.
When I set my Mac network preferences to Ethernet, I get an IP for me to communicate. However, when I turn Airport(Wi-Fi for more newbies) ON, and ethernet cable disconnected, I checked my network preferences, and sure enough my IP address was a different one.
Spoke to a friend (an ace in networking) and the thing clicked immediately: On WiFi networks a DHCP server allocates an IP address. This IP address has to be reserved, at the very least, at the DHCP server. Since my IP was not reserved, I had to change the IP address, in my udp_client.c file, recompile and run the client to connect.
BTW, I can now communicate between my iPhone and my PC using my local WiFi (office) network.
For any who might face the same problem, do not be assured that the IP address of your mchine is the same, when you switch from LAN to Wifi, and use the device mostly for WiFi reated testing. :)

Resources