Is it possible without virtual machines to do the following on RPi (raspbian image) via console only?
I'll have 5 open vpn connections. I have a program that will be started in 5 instances too. Can I specify somehow what connection should each instance use? First of all I thought about 'screen' command, but I think that I'll have no luck.
The program is a client, which connects to a server with specified IP:port and sending USB hardware parameters.
For example:
openvpn --config "1"
start1.sh
openvpn --config "2"
start2.sh
...
openvpn --config "5"
start5.sh
I would like to have something like this. But I think that every started process will use only last established connection.
Thank you.
Well, it seems that I should use network namespaces. Here are the links, that may be helpfull to visitors of this question. I didn't find another ways how to do it.
link one
link two
link three
Related
I am trying to connect two external laptops to two different Mininet hosts in order to transfer a "hello" message from one laptop to another. Could you please assist me with the proper steps to accomplish this task?
Thank you for your time and expertise.
I use mininet in a Linux virtual machine and open daylight controller on another VM
I made some researches but they all fail
I am a developer of ROS projects. Recently I am trying using ROS(melodic) on WSL2(Windows Subsystem for Linux), and all things works just great. But I got some trouble when I want to use another PC which also in the same local area network(LAN) to communicate with. Before setting the environment variables like "ROS_MASTER_URI, ROS_IP", I know that since WSL 2 work on Hyper-V so the IP show on WSL2 is not the one in the real LAN. I have to do some command like below in order to make everyone in LAN communicate with the specific host:PORT on WSL2.
netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr
But here comes a new question:
The nodes which use TCPROS to communicate with each other have a random PORT every time I launch the file.
How can I handle this kind of problem?
Or is there any information on the internet that I can have a look?
Thank you.
The root problem is described in WSL issue #4150. To quote from that thread,
WSL 2 seems to NAT it's virtual network, instead of making it bridged
to the host NIC.
Option 1 - Port forwarding script on login
Note: From #kraego's comment (and the edited question, which I'm just seeing based on the comment), this is probably not a good option for ROS, since the port numbers are randomly assigned. This makes port forwarding something that would have to be dynamically done.
There are a number of workarounds described in that issue, for which you've already figured out the first part (the port forwarding). The primary technique seems to be to create a PowerShell script to detect the IP address and create the port forwarding rules that runs upon Windows login. This particular comment near the top of the thread seems to be the canonical go-to answer, although many people have posted their tweaks or alternatives throughout the very long thread.
One downside - I believe the script that is mentioned there needs to be run at logon since the WSL subsystem seems to only want to run when a user is logged in. I've found that attempting to run a WSL service or instance through Windows OpenSSH results in that instance/service shutting down soon after the SSH session is closed, unless the user is already logged into Windows with a WSL instance opened.
Option 2 - WSL1
I would also propose that, assuming it fits your workflow and if the ROS works on it (it may not, given the device access you need, but not sure), you can simply use WSL1 instead of WSL2 to avoid this. You can try this out by:
Backing up your existing distro (from PowerShell or cmd, use wsl --export <DistroName> <FileName>
Import the backup into a new WSL1 instance with wsl --import <NewDistroName> <InstallLocation> <FileNameOfBackup> --version 1
It's possible to simply change versions in place, but I tend to like to have a backup anyway before doing it, and as long as you are backing up, you may as well leave the original in place.
I have build custom network topology in mininet 105 switches connected with each other by speficied logic, and every switch has a node connected with that.
the problem is when i ping s2 --> s94 packet reaches to the destination but when i invoke ping from h2 --> h94 it shows total packet loss.
can anyone guide me why is that? its important since i have to generate traffic over network.
i am using Mininet Vm http://mininet.org/download/
For Mininet 2.0.0, the default controller for the mn command is ovs-controller (which can be installed automatically in Ubuntu.) Unfortunately ovs-controller only supports up to 16 switches. If you want to use more than 16 switches, you should use a controller that supports more than 16 switches .
Solution: Try POX controller!
GITHUB download link
Documentation
Use a pox controller. In the controller terminal,
$cd pox
$./pox.py openflow.discovery forwarding.l2_learning
Now try a pingall
If the topology contains loops I'm not sure if pox will do the job. Previously had a similar issue when I basically needed STP or similar. The Onos controller can do this for you.
What could be mentioned here is that switches in mininet are running in the host net namespace (as apposed to hosts that are running in their own namespaces). So pinging from s2 is likely to give you weird results anyway. If you for example would do s2 ifconfig you would see all interfaces of all switches. My point is, testing connectivity by using the switches can be misleading.
Also, as the other posts tell you, you obviously need a OF controller.
Is there a better tool than WireShark to sniff out where given application is trying to connect and at which port. (So that I could easily overwrite it with my HOSTS file). Being able to log packet data is helpful too.
Ultimately I would prefer an application that I could just throw a running process at and start logging the network activities of the given app
Of course the application and sniffer will be running on the same PC. Preferably I would love a Windows sniffer. Since running that app on Linux will be .... difficult.
Answering myself: http://www.sysprobs.com/monitor-network-traffic-windows-7-microsoft-network-monitor-34
This article helped me big time. The tool in there is really great.
Have you tried socket sniff?
It should let you monitor specific applications:
socket sniff
How can I do inter-process communication between two remote process on unix C/C++? Currently, popen works for two process on same host? Product need to be capability to call remote process and send /receive the data.
As you mentioned popen you may not realize this already allows you to use ssh to remotely execute a process and treat exactly the same as a locally spawned one.
popen ("ssh user#remotehost /usr/bin/cal", "r")
And a pre-emptive link for further questions on ssh:
https://serverfault.com/questions/117007/ssh-key-questions
why would you nut just open the wild card % in the IP so that they could access the host.. remorely..
192.168.1.% something like that...:D