I have the next scenario: a physical server with X cores (CentOS). In it, I am running 3 virtual machines using virtualBox (vm1, vm2 and vm3, each one with CentOS too).
Now in the physical machine, I have an internet socket binded in an specific port (says 1111). Is it possible for each vm to have access to that socket and read data from it? Maybe using a kind of port forwarding or changing the network configuration?
The idea is that each vm could access to the socket created for the physical machine for a kind of load distribution.
Is it possible?
Thanks!
Related
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.
I have a windows PC installed VMware Workstation and Linux run on it. I want When windows communicate with Internet I can capture packets in Linux, how can I do that?
The vmware network is Bridge, and I set eth0 use command "ifconfig eth0 procmisc".
linux IP is 192.168.0.103, windows IP is 192.168.0.102
Run "tcpdump not host 192.168.0.103" with no result.
Thank you for you time and please help me
While I haven't used VMWare workstation before, I have used Oracle VirtualBox in a similar setup as you describe.
I suspect that the problem is that your network adaptor on the Linux VM is not actually accessing the physical network adaptor directly. You will be using one of the network mapping types described in http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006480 instead.
As such, you are not getting all the traffic that is going to your physical network adaptor. Instead you are getting the reduced set of traffic that VMWare is passing on to your guest.
The only way to get that is to do the snoop on your Windows host, using something like https://www.wireshark.org/
i have on my machine windows 7.
I installed vmware player and created a virtual machine running centos.
I installed Transmission on the centos.
Now i want to access it via web, like http://111.111.111.111:9091
9091 is the port of Transmission.
This port is showing closed.
So, how can i open that port so Transmission can conect?
where do i need to open it? On windows? On linux? On router?
How i do that?
Thank you.
Your router may be configured to route packets from the public network to the local machine in the private network. It needs 9091 port to be opened and routed to the private IP.
Moreover, you need to ensure that your router can ping your centos guest before.
If it can't ping, take care of the network settings of VmWare host, AKA (bridge|nat|private|...) network mode.
How does one set up ossec to have the host work as a server, and the guests have agents in them? Specifically, at least one point in the installation confuses me as to how this would work-how do you set the sever IP, if you are running ossec on a laptop, the IP address will change. How do you resolve the host that is running the guests ip dynamically?
Maybe the question should in that case be retitled to that, but the base cause for asking this question is for an ossec setup, and I will likely have more questions later, I'd rather them all be related to this.
Perhaps there is a guide to explain how to do what I want, which is to set up a mac os X lion host running ossec as the server, and have several vm guests with agent setups on them that talk to the host.
One deployment scenario is to create one OSSEC server and then to install OSSEC agents on everything you would like to watch for security events.
Regarding DHCP configured OSSEC agents, you can check out "Agent systems behind NAT or with dynamic IPs (DHCP)" http://www.ossec.net/doc/manual/agent/agent-dhcp-nat.html
If you have a specific DHCP or network range you would like any OSSEC agent to be able use and to be able to connect to the OSSEC server, then you can modify the following lines in the ossec.conf file (snippet borrowed from the OSSEC book):
We can also use the <allowed-ips></allowed-ips> tag to explicitly state which IP address
we allow connections from. In the following example, we used the <allowed-ips></allowed-ips>
tag in conjunction with the <connection></connection> tag to indicate that we expect OSSEC
HIDS agent connections from the 192.168.10.0/24 network
<ossec_config>
<remote>
<connection>secure</connection>
<allowed-ips>192.168.10.0/24</allowed-ips>
</remote>
</ossec_config>
I found out from vmware that the host VM's that are using a NAT configuration have a static IP address that corresponds to the host: 192.168.231.1 will reach the host from within the guest VM. This way, when you set up agents within the guest VM's you can use this address, and it will work.
I'm running a piece of software listening on a particular port inside an Ubuntu VM using VMWare fusion on OS X.
I can connect to the port from OS X but I can't get to it via other, separate machines. I suspect that the OS X firewall is blocking access but I'm not sure how to verify that or really what port to open. I can't imagine there's a one to one port mapping from the actual machine to the VM.
Anyone have any suggestions?
To answer my own question: Switch to bridged networking on the VM and it works :( It's always the small things that get overlooked.