Ping specific route through network back to same computer on different interface - linux

I have a topology setup in GNS3 running a number of virtual machines (pictured below.) R1, R2, and R3 are routers (built in Ubuntu) that I am running tests on. 'Test' is another Ubuntu virtual machine that is controlling my tests.
I would like to be able to ping from the interface on 'Test' with address 10.0.4.3, through R2, then through R1, then back to 'Test' at the interface with IP 10.0.5.2
Ideally I would like to be able to treat each network interface on 'Test' as a separate logical computer, so I could simply say ping 10.0.5.2 from 10.0.4.3 and let the routing protocols forward the message through the route of their choosing.
The tests are automated, so splitting 'Test' into four separate virtual machines would be less than ideal.
Any ideas?

Well, in this particular scenario, i think the solution for what you want would be to virtualize machines over the "test" machine, with this approach each machine would be in a different subnet. BUT, i'm not sure how better it would be when comparing to multiple "test" machines...
Another option, since it's a simple scenario and you only showed interest in testing routing protocols is to build this scenario in a simulator called Packet Tracer, by Cisco. In this scenario, you would still need more "test" machines but you wouldn't have to worry about you computer processor. The downside is that you'd need to use Cisco devices instead of Linux Machines to configure your routing topology.
Arthur Passos.

Related

Connection and/or config problems when running OVS (Open vSwitch) and ONOS (Open Network Operating System) in Azure

We are building a proof of concept piece that uses ONOS to update the flow tables on an OVS switch to either block or allow traffic connected to the OVS switch. We have got a piece working on a local machine using using virtual machines on virtual box. We're trying to see if we can get it working using virtual machines in Azure. Here's the setup:
I have three Linux virtual machines running in Azure.
One virtual machine has ONOS installed on it. Ley's call this ONOS-1.
The second virtual machine has OVS installed on it. Let's call this OVS-1.
And the third virtual machine is just a standard Linux virtual machine that is being used by a user. Let's call this HOST-1.
The OVS-1 has two network interface cards, one for management access and another used by OVS for bridging. In OVS there are multiple vPorts configured on the single NIC that is on the data network.
The idea is that ONOS-1 is connected to OVS-1, and the OVS-1 is connected to HOST-1via one of the OVS vPorts. ONOS-1 should be able to control OVS-1. Currently, ONOS-1 can see OVS-1, but any vPorts created on OVS-1 show as enabled=False in ONOS-1. What is the problem or what are we missing? Any help, guidance, or direction would be greatly appreciated.
Network diagram
We've tried adding additional NIC for each OVS vPort. This did not work either.

Which kind of network should i choose to setup a Satndalone Spark Cluster

I have 2 PC (with Windows as default OS), let's say PC_master and PC_slave. Since it is recommended to work with Linux to manage a spark Cluster i created one Virtual Machines with Linux on each of theses PC: VM_master on PC_master and VM_slave on PC_slave.
I would like to setup a Standalone Spark Cluster, so which Networking configuration should i use (NAT, Bridge, HostOnly?) for theses 2VM in order that they own their private IP adress letting me ssh from one to another without the need of port forwarding ?
Edit: My two laptop are linked to the same box, so they have private IP and supposed to be linked to the same router.
Finally it seems that if i want to give each VM its own Ip adress to create a private Network i have to choose Bridge Network which will assign a unique Ip for each VM!

How to simulate OSPF routing table in Macintosh or Linux?

I am trying to make a OSPF protocol simulation in Mac or Linux. So, basically I want to run many binary OSPF binaries and they should be able to speak to each other and should be able to use pseudo interface to run OSPF on it. So, if they share the pseudointerface I should be able to assign the same subnet interface on different interfaces.
For example, R1 - OSPF Sim1 has 3 pseudo networking interface. The pseudo networking interface IP is en0 - 192.168.2.1/24 and en1 is 111.111.10.1/24.
The loopback is 1.1.1.1
now, I have R2 - OSPF sim2 has two pseudo networking interface. The pseudo networking interface is en0 - 192.168.2.1/24 and loopback is 2.2.2.2
Now, I have R3 - OSPF sim3 has two pseudo networking interface. The pseudo networking interface is en1 - 111.111.10.2/24 and loopback is 3.3.3.3
I want to simulate in such a way that those are in the subnet can ping each other and rest not. Any idea? Also, I want them to install routes so that kernel is aware of it.
I would suggest to use VirtualBox to create three identical linux virtual machines, each one running its own quagga packages.
To do so, I would use Alpine Linux as base (it is a extremely compact and functional linux distribution, which has quagga packages available). To create Alpine-based VM, there is a detailed instruction here
There are several examples of OSPF testbeds, this one seems particularly relevant to what you want to achieve.
Hope it help!

Receive realtime data from phone

I am using an android app that streams real-time accelerometer data to the specified ip address of a server. I have written a "server" in C running on Linux which is running in VMware.
I am connected to the hotspot created by the Windows7(Host machine) running the VMware Workstation.
So my question is how do I connect the virtual-machine to same network as the hotspot so that I can get the phone and the "server" program on the same network and stream data to the server program?
I use VirtualBox, but I'm guessing the settings are very similar in VMWare Workstation.
You probably need to do one or both of these things:
1) Port Forwarding. If your app is hitting port 80 (or whatever port), you'll need to tell VMWare that any hits coming in to the host machine on that port get forwarded to the VM. Of course, your VM will have to be listening on that port. I'd suggest using a high port number (over 1024) to minimize conflicts, and avoid annoying root/admin issues using a low port number.
2) Hopefully that gets you there. If not, you may need to change the virtual adapter settings on the VM. NAT mode is a good first try. If not, there are other modes (bridged, internal, host-only) you can tinker with. (Not sure if VMWare uses different names)
That's probably all you need for the topology you describe -- Android device connected directly to the same subnet as the host machine. If not, perhaps your hotspot routes all client traffic to the gateway (i.e. out to the Internet), without allowing direct access to localhost. If so, maybe there are settings for that. If not, ngrok is your new best friend.
It is SUPER easy and allows you to tunnel traffic from anywhere on the Internet to a specific service running on your machine. This would sidestep some of the issues above.
If you want to take your Android device to another network (e.g. cell network), then ngrok is absolutely the way to go, particularly for development and prototyping. This lets you avoid issues with DNS, routing, firewalls, etc.

How can I develop using a local VM server without using URLs with ports in them?

I'm setting up a linux server in a VM for my development.
Previously I've had PHP, MySQL etc etc all installed locally on my Mac. Apart from being a security risk, it's a drag to maintain and keep up to date, and there's a risk that an OS upgrade will wipe part of your setup out as the changes you make are fairly non-standard.
Having the entire server contained within a VM makes it easily upgradable and portable between machines. It means I can have the same configuration as the destination server and with shared folders even if the VM gets corrupted my work is safe on the host machine.
Previously with the local installation I was able to develop on convenient URLs like http://site.dev. I'd quite like to carry this over to the VM way of development but I'm struggling to figure out how, if it's possible at all.
Here's the problem:
In Bridged mode, the VM is part of the same network as the host. This is great but I can't choose a fixed IP address as I may be joining other networks and that address may be taken already. I'd like a consistent way of addressing my VM.
In NAT mode I can't directly address the VM without using port forwarding. I can use http://site.dev if I use the hosts file to forward that to localhost and then localhost:8080 forwards to the vm:80. The trouble is I have to access http://site.dev:8080 which is inconvenient for URL construction.
Does anyone know a way around this? I'm using ubuntu server and virtualbox.
Thanks!
The answer is to define a separate host-only network adapter and use that for host->guest communication.
You can do this by powering down the guest and adding the adapter in the VM settings. Once that's done you can boot the guest again and configure the new network interface however suits you best. I chose a fixed IP address in an unused range.

Resources