How to create a virtual network interface on a remote machine bridge to an interface on a local machine? - virtual-network

I have a local Linux machine (L), with a network interface (eth0) connected to (currently) only one device (D).
L/eth0 only has an ipv6 link local address.
D also only has an ipv6 link local address.
Client software on L discovers D's link local address by sending a custom multicast packet over eth0. The response contain the device link local address as well as some configuration information. From there it communicates with the device using various UDP or TCP port.
My goal is to be able to use the device from a remote machine (R). The remote machine being most likely a Linux docker container running on some host - although it could be a native macOS or other.
That means running both the discovery protocol and communicate with the device. I definitely cannot modify software on the device, and cannot modify most of the client software running on the local Linux or remote machine (Limited modification could possibly be requested)
My idea was to somehow create a virtual interface on the remote machine, that would remotely be bridged to the the local machine, so that the multicast discovery works from the remote, and so that I can just connect to D link local address from the remote.
I'm not sure which tool(s) I should be using.
I'm googling various things about VPN and tunnel, TUN/TAP interfaces, bridges, VETH, VLAN, etc... but I'm having trouble connecting the dots here... I have no budget for this, so I'm looking for open source tools, or just something I can cobble up together with common tools.
Thanks

Related

How to know which interface is connected to particular machine?

I have a server with a lot of interfaces, and only one interface is assigned IP address, this interface is kept for management.
but other interfaces are connected to the other server.
I want to know which interface is actually connected to the outside server.
Here, I tried to ping to the machine IP with particular interface ping -I eth1 x.x.x.x.
But not able to ping with the interface even though I know this is connected to the server.
All the packet is only going via the management eth0.
Is there a better way to find out which interface is connected to a particular machine?
I know the machine IP address
I am using ubuntu 18.04

TCP Server on Computer. No connection established

I have 2 devices on the same network and I want to communicate via TCP on the same network. Device 1 is a computer running a Debian OS on virtualbox, and another is an android tablet. Interesting enough, my tablet acts as a server no problem via an app. Any other device on the same network can connect to the tablet. The computer on the other hand is not so cooperative. Running netcat -l -p 6667 on my computer should allow incoming connections to communicate with my computer via TCP on port 6667, but this is not the case. Netcat opens a socket but I can't connect to it in anyway. Is there an underlying reason as to why this does not work? All device are under the same router. I have disabled firewall on my computer as well.
From your information, i would say your problem is you need to set up port forward.
VirtualBox and VMware both create virtual machines with the NAT network type by default. If you want to run server software inside a virtual machine, you’ll need to change its network type or forward ports through the virtual NAT.
here is a guide that will show you how to Forward ports to virtual machine

DNS problems with local hosts especially with Iphone/Ipad

I have some problems communicating with different devices each other in my local network. I suggest some DNS problems or incorrect DNS settings
First of all, a short overview of my devices:
Router: Speedport W 921V (latest Firmware 1.22.) using also dyndns for remote operation
File-/Web-Server: Debian Squeeze running samba and apache
Client1: Computer using Win 7 Pro
Client2: Iphone/Ipad
Internet works fine on all devices! All clients have set the DNS to the IP of my router. The router also has the settings for port forwarding from port 80 to port 80 of my Webserver as well for port 8080. To access to my Webserver outside my local networks also works fine, but....
Problem 1) Resolving public dyndns-address
When I ping my public address mysubdomain.dyndns-home.com inside my local network, the IP will be resolved correctly without any timeout problems on all devices, but when I use my public address in a browser (Chrome, Firefox, IE) there is a timeout error message or server down message. This is the same behavior on all devices. So why can I not use my public address in my local network? To change that, what do I have to change?
Problem 2) Resolving local devices on Iphone/Ipad
Because I can not use my public address in my local network I want to communicate by my local device names. So all my devices are registered by their mac-address in the router. When I log into my router I can see all devices and their IP-addresses which are currently running. So if the router is the DNS for my clients, the router should resolve the local device names. That works so far for the Computers running Windows or Linux. But on my Iphone or Ipad the names will not be resolved. I also tried to refresh the lease or to forget the network and reconnect again, but still I can not communicate with my Iphone/Ipad and my other devices. So what can I do to resolve the names on my Iphone/Ipad?
Thanks for your help
1) Because you are in your local network you have to use private ip (you can see private ip using ipconfig on windows or ifconfig command line on linux). The public ip is for all others computers on the network. If you want test that the server works correctly you can use a proxy (like www.anonymouse.org)

ZeroMQ (0MQ) basic issue re connecting or binding to sockets

I'm using ZeroMQ on Windows, using C#, and am confused by a very basic networking question. I set up simplistic sample programs, one to PUBlish messages, the others use a SUB socket to receive them (the SUBscriber programs).
Works fine when both are on the same box. I used endpoint tcp://127.0.0.1:5000
As the next step, I put the SUBscriber program on a separate virtual machine (VM), to simulate using separate computers. I ran ipconfig to get it's IP address (on the guest os), 192.168.92.136
The host os has several network interfaces, one of which is the VMware Network Adapter VMnet1, with IP 192.168.92.1
On the host os, I ran the PUB program and connected the socket to 192.168.92.136, the IP address of the guest os.
On the guest os, I ran the SUB program and connected the socket to the IP of the host os. Did not work.
Then I changed the SUB program on the guest os to make it connect it to it's own IP address, ie that of the guest os - 192.168.92.136. Now it works!
Question: Why? I'm confused. But in a way it sort of makes sense: if that socket is for a service that attends to various clients that dynamically come and go, it doesn't know the IP address of each client. Therefore what the heck do you specify as the IP address for the SUB socket?! So connecting it to it's own host IP address does solve that concern. But the ZeroMQ Guide doesn't say this anywhere!
A related question is: if your host has multiple network interfaces, and each has it's own IP address, then if you connect your socket to some other host using the IP address of that other host - do you not need to specify which of those network interfaces you want to connect through? If so, how?
Incidentally, only one subscriber program seems to be able to connect at a time. The 2nd program to attempt to connect to it's SUB socket to the local IP address always gets a "Address is in use" error-message. I'm trying to make progress in small steps and learn this as I go.
Thanks for any help or advice.
James Hurst, JamesH at Designforge dot com

How does communication occur in java through TCP sockets on the same machine

I have two servers, written in Java, that communicate through sockets and TCP. The servers are both on the same Linux machine. If the servers were on different machines then data would have to go through network adapters and network cables, but since the servers are on the same machine how does the OS actually move data efficiently form one server to the other.
Generally, the messages will be sent over the loopback interface:
In TCP/IP a loopback device is a virtual network interface implemented in software only and not connected to any hardware, but which is fully integrated into the computer system's internal network infrastructure. Any traffic that a computer program sends to the loopback interface is immediately received on the same interface.
However, you can manage to configure your situation so that, for example, the server is referred to via an external IP address so that messages actually go out over the network before being routed back to the same machine.
If two programs are using TCP/IP to communicate on the same machine, they are probably connected through the loopback interface