Connecting to a local IP (not in Network) from a computer without connecting to other networked computer sharing same IP - tcp

I am sorry, I dont know if this question is already asked (afaik this wasnt asked based on my search results). I have a computer running a software that needs license from a server in my company's domain. For pulling the license, I need to connect to the company network. Also there is a hardware setup in our company which is not integrated to the network. And I need to process some data from the hardware, and the data has to be shared with the software. So, I make two connections, one ethernet connection to the hardware and other wireless for using the software's license. I tried accessing the data from the hardware in the software through hardware's IP address. The problem is, there is another computer in our company from another location sharing the same IP as the Hardware, and the software tries retrieving the data from that computer and fails. I am sorry, if this is priliminary and I am not a networking person.

Simply put, one of the two systems need to change its IP address.
The alternatives are usually too complex and error prone, and their viability depends on the particularity of your environment:
Use arp command to force your PC IP-Mac mapping
Put a router in front of your hardware that does port forwarding
Use VLANs

Related

How to use Vim to edit files using SCP but across different Subnets?

I'm learning about Networks and recently found out that the SCP protocol is used to edit files on some other computer. Now the thing is that the other computer should be on the same network. So I was curious about how to edit files across different networks?
Additional information: In my college we have computer labs. Each lab has exactly one switch. All the computers in a particular lab are connected to the switch. Also all of the labs have Internet connection. So if I want to edit a file using VIM on a computer that my friend is on but he is on a different lab, then how can I do it?
Application-level protocols like SSH and HTTP use an underlying TCP/IP connection; they work regardless of the subnet (barring extended networking features like firewalls, packet filters, network proxies, etc.)
So, if your friend's computer is reachable via the Internet, or just the local lab network, and you have the IP address / DNS name of his computer, and the corresponding port (22 for SSH / SCP) is not blocked, and you have a login on his computer, you can remotely edit files there.
If your end goal is remote editing, I would approach this via these steps, each building on top of the previous one:
ping othercomputer
ssh user#othercomputer
In Vim: :edit scp://user#othercomputer/path/to/file

How to access an IP in a subnet of another NC card?

I searched and could not find an answer for this.. not even a discussion about it...
I need to develop an application to talk to a robot in our shop floor... no big deal about the code... The issue is as follows:
This robot is connected to an industrial PC that is connected to our production network. This industrial PC has two NICs, NIC #1 has TCP/IP settings set to connect to our production network (IP something like 10.9.100.100), and the NIC #2 is configured to have its IP on a subnet address (Something like 192.168.127.10).
The robot has an IP address too, which is in the subnet of the NIC #2 of the industrial PC. The robot´s IP is something like 192.168.127.20
There´s an application running on the industrial PC that keeps polling data from the robot, like its status, cycle time, etc. This application then sends the data collected from the robot to a server in our production network.
Simply put, it´s like grab data via NIC #2 and send it to a server in the production network via NIC #1.
In order to test my application from within the IDE and debug it, I´d like to connect to the robot from my desktop (Which is in the production network (10.9.100.200)...), to that IP in the subnet the robot is, that is, the IP subnet set in the NIC #2 from the industrial PC.
I have access to the industrial PC and I could install Visual Studio on it and code via remote desktop. Then for sure I could access that robot. But that would not be cool...
Is there any way, setting or application that allows me to reach that robot from my production network?
What you're looking for is port forwarding. You can set up the industrial PC to listen on a certain port number x on NIC 1 and forward all connections to the robot's IP address on port number y (where y may be equal to x if port x is not used by another application on the industrial PC, otherwise you set it to a different value).
This would be trivial to set up on most Unixes, but since you're running Windows it's a bit more complicated. If your traffic is TCP, Windows supports port forwarding via netsh. If your traffic is UDP, you need to use some third-party application. With some Googling I found this one
(look for "Simple UDP proxy/pipe"). Note that I have no experience with this program and you should be careful when downloading executables from unknown sources; but AFAICT the source code is also provided, so you could compile it yourself if needed.
On the same page you can also find a TCP forwarder if the native Windows one doesn't work for you.

Tunneling a network connection into a VMWare guest without network

I'm trying to establish a TCP connection between a client machine and a guest VM running inside an ESXi server. The trick is that the guest VM has no network configured (intentionally). However the ESX server is on the network, so in theory it might be possible to bridge the gap with software.
Concretely, I'd like to eventually create a direct TCP connection from python code running on the client machine (I want to create an RPyC connection). However anything that results in ssh-like port tunneling would be breakthrough enough.
I'm theorizing that some combination of VMWare Tools, pysphere and obscure network adapters could be possible. But so far, my searches don't yield any result and my only ideas are either ugly (something like tunneling over file operations) and/or very error prone (basically, if I have to build a TCP stack, I know I'll be writing lots of bugs).
It's for a testing environment setup, not production; but I prefer stability over speed. I currently don't see much need for high throughput.
To summarize the setup:
Client machine (Windows/Linux, whatever works) with vmware tools installed
ESXi server (network accessible from client machine)
VMWare guest which has no NICs at all, but is accessible using vmware tools (must be Windows in my case, but a Linux solution is welcome for the sake completeness)
Any ideas and further reading suggestions would be awesome.
Thank you Internet, you are the best!
It is not clear the meaning of 'no NICs at all on guest'. If I can assume that, there is no physical NICs assigned for the guest is what is meant here. The solution is easy as a vmWare soft NIC can be provisioned for the guest VM and that will serve as the entry point to the guest netstack.
But if the soft NIC is also not available, i really wonder how and what can serve as the entry point to the netstack of guest, be it Linux/Windows. To my understanding, if thats what you meant, then you might need to make guest OS modifications to use a different door to access the guest netstack and to post/drain pkts from it. But again, when you do a proper implementation of this backdoor, it will become just another implementation of softNIC which vmware by default support. So, why not use that?
It's a bit late but a virtual serial port may be your friend. You can pick the serial port on the outer end via network or locally depending on your options. Than you can have some ppp stuff or your custom script on both ends to communicate. You could also run some tool to create a single socket from the serial link on the guest end if you want to avoid having a ppp interface but still need to tunnel a TCP connection for some application.
This should keep you safe when analyzing malicious code as long as it's not skynet :-) You still should do it with the permission of the sysadmin as you may be violating your company's rules by working around some security measurements.
If the VM 'intentionally' has no network configured, you can't connect to it over a network.
Your question embodies a contradiction in terms.

what's needed to make hostname resolution work on a lan?

I am developing a networked application that runs on a few different computers on a LAN. One of the core needs is for the app to maintain a list of peers on the LAN with which it has communicated in the past, so that it can restore previous sessions. The naive solution would be to just remember the IP and store it in a table, but what happens when the IP of a peer changes?
Instead, I thought I'd store the hostname of the peers so even if the IP changes they will still be reachable via their hostname. (I know hostnames can change as well but that is good enough).
So my question is what exactly is needed to make hostname resolution work on a LAN with mixed Windows/Mac/Linux clients?
Without the use of a central authority the only reliable way to achieve this is through the use of zerconfiguration name resolution. This means that without a multicast router you will only be able to dynamically resolve peers on the same subnet as the resolving host. You could use something like bonjour for mac, netbios or ssdp for windows or avahi for linux but you can't assume that these are enabled. I may be overlooking some more popular protocols that perform this function well but I would personally throw together a quick udp broadcast name resolution protocol for your application. Take a look at these for some more ideas:
Zeroconf Name resolution
Universal local network name resolution method without DNS?
http://en.wikipedia.org/wiki/Zero_configuration_networking#Name_resolution
http://en.wikipedia.org/wiki/Broadcast_address#IP_networking
I would pick a specific udp port to listen on (lets say 12000) and then when you're ready to resolve hosts send a "hello" udp packet out to 255.255.255.255 on port 12000 and all of the other hosts on your network running your app should reply with a packet containing their hostname, possibly other information.

Completing a socket connection across an intranet or internet

I am writing a peer-to-peer binary socket program. There are only two endpoints. One socket is listening on my laptop system. The other socket is broadcasting from my desktop system. I have a third program running on a hosted server, that is available to broker the connection between the two. My problem is that when the laptop and desktop are on the same network, they both have the same internet IP address but different intranet IPs, but when the laptop is on the road, then the IP addresses are different. In order to be truly peer-to-peer, I have to write it so that after the connection is established, that the two computers communicate directly between one another. How is this generally accomplished, when the two computers could potentially share the same IP address, if they are running on the same network?
Your question is really: how do I deal with network address translation in a P2P system?
One possibility is to require holes poked in the NAT/firewall systems--that will ensure that requests to a given port are sent to a given computer. Allowing multiple clients inside the network would require poking multiple holes and configuring each client with the corresponding port.
Another possibility involving UDP is here--I haven't reviewed it enough to know if it really removes the broker from the equation after a handshake.
As always, Google can be your friend.

Resources