Seite 1 von 1

NAT mit VMWARE-Workstation und portforwarding

Verfasst: 16.10.2008, 16:33
von stoepsn
Hallo Jungens und Mädels,

ich bin rel. unbeleckt, was die Konfiguration eines NAt mit VM angeht.

Konstellation ist folgende:

Hostsystem ist ein Win2k3, auf diesem läuft VMware und darin ein Win2k3SB.

Nun ist es so, dass das Gastsystem die Netzadresse 192.168.2.0 /24 hat, das Hostnetz aber 192.168.1.0 /24. Um jetzt vom Gastnetz ins Internet etc zu kommen nutze ich NAT. Soweit so gut.
Jetzt sollen aber Ports, wie RDP, SSL, etc per forwarding aus dem Inernet erreichbar sein. An welche IP gebe ich denn das Portforwarding von der Firewall im ADSL-Router weiter?

praktisches Szenario:

Router: 192.168.1.1
Host: 192.168.1.100 (VMNET8 = 192.168.2.1)
Gast 192.168.2.100 (Gateway = VMNET8)

Am Beispiel http wäre nett wenn mir wer erklären könnt, was ich bei NAT in VMware eintrage und was in die Firewall des Routers, damit ich port 80 des Gastsystems aus dem Internet erreichen kann.

Viele Danke im Voraus :)

Verfasst: 16.10.2008, 20:37
von continuum
Poste mal deine vmnetnat.conf

Verfasst: 17.10.2008, 09:42
von stoepsn
# Windows NAT configuration file

[host]

# NAT gateway address
ip = 192.168.2.1/24
hostMAC = 00:50:56:C0:00:08

# enable configuration; disabled by default for security reasons
#configport = 33445

# VMnet device if not specified on command line
device = vmnet8

# Allow PORT/EPRT FTP commands (they need incoming TCP stream...)
activeFTP = 1

# Allows the source to have any OUI. Turn this one if you change the OUI
# in the MAC address of your virtual machines.
allowAnyOUI = 1

[udp]
# Timeout in seconds, 0 = no timeout, default = 30; real value might
# be up to 100% longer
timeout = 30

[dns]
# This section applies only to Windows.
#
# Policy to use for DNS forwarding. Accepted values include order,
# rotate, burst.
#
# order: send one DNS request at a time in order of the name servers
# rotate: send one DNS request at a time, rotate through the DNS servers
# burst: send to three servers and wait for the first one to respond
policy = order

# Timeout in seconds before retrying DNS request.
timeout = 2

# Retries before giving up on DNS request
retries = 3

# Automatically detect the DNS servers (not supported in Windows NT)
autodetect = 1

# List of DNS servers to use. Up to three may be specified
#nameserver1 = 198.41.0.4
#nameserver2 = 192.36.148.17
#nameserver3 = 202.12.27.33

[netbios]
# This section applies only to Windows.

# Timeout for NBNS queries.
nbnsTimeout = 2

# Number of retries for each NBNS query.
nbnsRetries = 3

# Timeout for NBDS queries.
nbdsTimeout = 3

[incomingtcp]
# Use these with care - anyone can enter into your virtual machine through these...

# FTP (both active and passive FTP is always enabled)
# ftp localhost 8887
#8887 = 192.168.27.128:21

# WEB (make sure that if you are using named webhosting, names point to
# your host, not to guest... And if you are forwarding port other
# than 80 make sure that your server copes with mismatched port
# number in Host: header)
# lynx http://localhost:8888
#8888 = 192.168.27.128:80

# SSH
# ssh -p 8889 root@localhost
#8889 = 192.168.27.128:22

[incomingudp]
# UDP port forwarding example
#6000 = 192.168.27.128:6001

[PrivilegedTCP]
autodetect = 1

[PrivilegedUDP]
autodetect = 1

Verfasst: 17.10.2008, 16:02
von continuum

Code: Alles auswählen

# Windows NAT configuration file


# WEB (make sure that if you are using named webhosting, names point to
#     your host, not to guest... And if you are forwarding port other
#     than 80 make sure that your server copes with mismatched port
#     number in Host: header)
#      lynx http://localhost:8888
#8888 = 192.168.27.128:80


8888 = 192.168.2.100:80

Anfragen auf Port 8888 des Host werden weitergeleitet zum Webserver des Gasts

Verfasst: 20.10.2008, 15:40
von stoepsn
ok,

das dachte ich mir schon. Welches portforwarding gebe ich aber im Router ein?

Zur Erinnerung:

Netz1 Router(gateway): 192.168.1.1 /24
Host Netz1: 192.168.1.100 /24
Host Netz2 (Vmnet8: 192.168.2.1 /24 (gateway für den Gast)
Gast: 192.168.2.33 /24

also wie dann einrichten von Außen (internet) auf Gast port 80 ?


ich kann ja schwer im router ein portforwarding auf 192.168.2.1 machen, wenn das netz des Routers auf 192.168.1.0 /24 steht, oder?!

Verfasst: 20.10.2008, 16:57
von continuum
Ne - du richtest ein portforwarding auf den Host ein - entweder auf den selben port wie du an den Gast weiterleiten willst oder an einen anderen.

Falls du denselben nimmst saehe die Zeile so aus:

80 = 192.168.1.100:80

nimmst du einen anderen sieht es so aus:

8888 = 192.168.1.100:80

Verfasst: 20.10.2008, 18:59
von stoepsn
das wird dann aber schwierig, weil auch der Host 80 geforwarded braucht...

Wie soll das denn funktionieren mit 192.168.1.100? Der Host hat doch auch eigene dienste, die doch dann primär bedient werden?!

Demnach port 21 wenn ich auf dem host einen FTP laufen haben will. ist das tatsächlich sinn der sache?

da macht es ja eher sinn den Gast in den gleich Adressraum in ein anderes VLAN zu packen (sofern vorhanden) und dann zu bridgen.

Verfasst: 24.10.2008, 10:46
von stoepsn
keine Idee mehr zu meinem Einwand?

Verfasst: 24.10.2008, 21:14
von continuum
keine Idee mehr zu meinem Einwand?


Wonach fragst du ?

Das du ein problem bekommst wenn du zwei Webserver ueber eine IP erreichen willlst liegt doch auf der Hand.
In so einem Fall musst du halt einen der webserver auf einem anderen Port laufen lassen - wie zB den Standard-alternativ-port 8080 oder was auch immer