How to use the RJ45 tool in the CORE network emulator? - networking

I have recently installed the CORE Network Emulator, and have already read the relevant parts of the the docs. CORE promises to be able to connect the virtual networks you create in it with physical once. However, I am having trouble connecting my virtual network to the physical one, which the RJ45 tool promises to do. From what I have read, in the CORE NetEm you can assign a network interface to the RJ45 tool, which then bridges your physical device to the network.
I have tried creating a basic topology, with one virtual host, a router, and then my computer with the RJ45 tool and I am trying to see if I can reach my computer from the host or vice versa with a ping command, but all I get is "network is unreachable."
Unfortunately, the CORE docs don't go into detail in how to use this tool and I wasn't able to find any other sources on the internet which have to do anything with it.
Here you can find the documenation: http://coreemu.github.io/core/usage.html#connecting-with-physical-networks
Does anyone have any experience with CORE and can help me out with this?
Many thanks!

The CORE RJ45 tool creates a Linux bridge between a virtual interface and a physical one.
Example: if you have node n1 linked to an RJ45 node assigned to eth0, after pressing "Start", on the underlying host you'll have a bridge with the n1:eth0 veth0 pair device and your host's eth0 device enslaved.
You'll need to configure routing between your virtual and physical networks. In the above example, suppose n1:eth0 is 10.0.0.1/24. When you plug a physical device into eth0, that device needs a route back to 10.0.0.1. That device may be on the same subnet, for example if it has the address 10.0.0.2/24. If your physical device has an address on a different subnet, you'll need to manually add a route to reach the 10.0.0.0/24 network, via the connecting interface.

I had the same problem. My CORE version is v.5.3.0 (20190615) on Ubuntu 18.04 LTS w/ Linux 5.0.0-37 generic on x86_64. Have OSPF v2, v3, Zegra, and IPForward correctly configured at r1, so that vpc1 can send and receive data successfully.
The RJ45 port of a built-in physical interface on the CORE host was mapped to a virtual endpoint for connecting the 2nd real computer, rpc 192.168.10.10/24 with a virtual switch sw1. Another virtual PC, vpc1 192.168.10.20/24 and a router r1 with 192.168.10.1/24 and 10.0.10.1/24 two interfaces.
Can ping from rpc to vpc1 and to r1 at 192.168.10.1 but not 10.0.10.1 or beyond. However, using the two-node tool or virtual terminal of vpc1, I can also traceroute and ping r1 and beyond.
The reason why the traffic of the real remote PC rpc could not be routed by r1 from 192.168.10.1 to 10.0.10.1 and back was because its WiFi was left on with the gateway configured to a FiOS router. You cannot have two gateways. Once the WiFi got turned off, the traceroute and ping can reach r1 and beyond.
This could also be the root cause of your problem.

Related

How find correct Ip for connection Client/Server Qt?

I created two Qt apps: one client and one server.
I use them to send some data for handle a remote device.
If I am in localhost I haven't issues about them, but when i search to connect them by internet i don't know how to find correct Ip server to connect Socket Client.
How i can find this ip node?
Is there a class to find It?
you cannot find it automatically, if this is what you're asking about.
In real life you would deploy your server on some publicly accessible host, give it a domain name (important part as your host can change the IP address at any time) and connect the client via the DNS domain.
However if you're just playing around and you want to show to the world that your app works, specifying the IP address of the server in your client code would be perfectly fine (assuming you're running both the server and the client in the same network).
In that case, if you're running mac/linux run the command ifconfig (or just ip depending on the distribution). On Windows you can run the command ipconfig. Both windows and linux will give you a similar output resembling this:
Pay attention to the network adapters. There can potentially be many of them. You may have some emulated adapters if you have docker or VMWare, you may have the wireless adapters if you have a WiFi card, and then the ethernet adapters if your computer can connect to the the internet with an ethernet cable. Each of these adapters specifies a different IPv4 address. You want to pick the one that is connected to the same network as your client. So for instance if both your server machine and your client running machine are connected to the same wifi, you pick the address from the Wireless LAN adapter

port forwarding to a virtual machine using Virtualbox

I want to forward a port to a VM. However i dont want the VM to be behind my host PC, i want it to be connected directly to the router so that packets coming on that port go directly to the VM without passing through my host PC.
In other words, i want the VM to look like any other machine on the network.
EDIT: i used bridged adapter, but i couldnt make it connect to the network.
Thank you
The VM will use the Ethernet port in all cases and the OS in it.
Typically if you have Windows and a VM with a bridged port, you will see the traffic flow when you take a capture on the Windows machine. IP won't be the one from the Windows machine but the traffic, like said, will flow through the same physical interface.
Secondly, you need to use a bridged adapter. For the details you can find help here: Bridged networking not working in Virtualbox under Windows 10

How are Hosts and Virtual machines connected?

I'm struggling to understand if the reason for a host and virtual machines connection is through the internet, if it communicates with the host as an application would communicate with the PC it is installed on or if it uses a protocol like TCP (As it purpose is to connect 2 devices so they can exchange streams of data, so it would make sense that the VM and Host were connected by this protocol).
All answers are greatly appreciated :)
As by the definition of virtual machines, they run on a hosts hardware in virtually separate areas, so the host and Virtual machines do not share virtual memory and both systems can have completely different operating systems.
This means, that those two systems are completely separate and can be connected through a variance of interfaces - for example via a network connection (TCP/IP or UDP), if host and vm are connected directly to the network.
See here an article of VMWare about Host-only-Networking without the need of the WWW.

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.

VMWare Player on laptop - maintaining connection when wireless disconnected

I'm a complete newbie to VMWare and troubleshooting networking issues.
I'm running the buildix app through VMWare Player on my laptop. Things work fine when I'm connected to my home wireless network.
However, when I'm not connected to a network, my wireless card is turned off (eg., to save power) or when I'm connected to another wireless network, the Buildix appliance / VMWare player fails to get an ip address.
I only want the appliance to be able to communicate with my laptop.
I've tried this in all 3 networking modes : Host-Only (which is what I believe I want), NAT and Bridged, all with no success.
I've also taken a look at the settings by running vmnetcfg.exe in the VMWare Player install dir, but can't see anything obvious here.
Can someone please assist?
Regards
Marty
Host-Only mode is probably the way to go in your case. The problem is NAT and Bridged mode are relying on some third-party DHCP server to provide an IP address, and that server is not available when you are running disconnected.
VMware Workstation (not sure about Player) provides a built-in DHCP server if your machine is configured onto the right virtual network switch. You can also adjust which virtual switch has the DHCP server, what IP addresses it gives out, etc.
If Player does not support this feature, you may be forced into setting the IP address of the virtual machine manually. This is dependent on what OS you are running.

Resources