LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to make remote desktop browse VM (https://www.linuxquestions.org/questions/linux-general-1/how-to-make-remote-desktop-browse-vm-772592/)

satimis 12-01-2009 12:32 AM

How to make remote desktop browse VM
 
Hi folks,


KVM - virtualization software
SugarCRM
host OS - Debian 5.0
VMs (guest) OS - Ubutun 9.04
Single(one) external IP


This is an experiment.

There are 4 VMs, each running SugarCRM which is a web-base CRM. Each VM has its own host name and internal IP. Desktops on local network(Intranet) can browse each VM on;
Code:

local_ip/sugarcrm
without problem.

Now my further test is how can remote-desktops connect/browse the VMs? Because there is only ONE external IP. Suggestion and pointer would be appreciated. TIA

B.R.
satimis

ddaemonunics 12-01-2009 03:38 AM

I think that by using iptables DNAT on the debian host you should resolve the problem
for example:

external client ---ext IP:8000 (iptables DNAT)---internal clienta:80
external client ---ext IP:8001 (iptables DNAT)---internal clientb:80
external client ---ext IP:8002 (iptables DNAT)---internal clientc:80
external client ---ext IP:8003 (iptables DNAT)---internal clientd:80

a dnat rule looks like this:
iptables -t nat -A PREROUTING -i eth2 -p tcp -m tcp --dport 8000 -j DNAT --to-destination 192.168.0.210:80

where eth2 is the external interface configured with the external IP
192.168.0.210 could by the IP of one of your SugarCRM hosts

satimis 12-01-2009 09:18 AM

Quote:

Originally Posted by ddaemonunics (Post 3775441)
I think that by using iptables DNAT on the debian host you should resolve the problem
for example:

external client ---ext IP:8000 (iptables DNAT)---internal clienta:80
external client ---ext IP:8001 (iptables DNAT)---internal clientb:80
external client ---ext IP:8002 (iptables DNAT)---internal clientc:80
external client ---ext IP:8003 (iptables DNAT)---internal clientd:80

a dnat rule looks like this:
iptables -t nat -A PREROUTING -i eth2 -p tcp -m tcp --dport 8000 -j DNAT --to-destination 192.168.0.210:80

where eth2 is the external interface configured with the external IP
192.168.0.210 could by the IP of one of your SugarCRM hosts

Hi ddaemonunics,

Thanks for your advice.

Could you please explain in more detail? Which config file of iptables I have to edit?

The ethernet card connected to external IP is eth0.

Intranet IP
Code:


host 192.168.0.100
VM1  192.168.0.101
VM2  192.168.0.102
etc.

TIA

B.R.
satimis

ddaemonunics 12-01-2009 11:39 AM

debian doesn't have a default iptables file to edit...you have to make one, put your iptables commands in this file and the put the file in /etc/init.d/ chmod +x it and then enable it for the runlevels you need.
The command from my first post is self explanatory ..I think...but if not please take a look here http://linux-ip.net/html/nat-dnat.html
it does explain everything you need to know to solve your problem
also this http://www.frozentux.net/iptables-tu...tml/x4033.html for more theory on dnat with iptables


All times are GMT -5. The time now is 12:10 AM.