VMware Communities
leidegre
Contributor
Contributor

NAT, port-forwarding and external access

I'm having trouble enabling some services through my VM. My current situation won't allow me do anything besides NAT and I know I've made this work before, I can't just remember how.

The problem has to do with accessing the services exposed by my VM from any external computer trying to communicate with the host.

I can't seem to make the host computer translate/forward the necessary traffic. I've tried using ipfw and forward to say that any attempt to connect to port 53557 should atually go to my VM's IP address.

I can access my VM's service through it's IP address and port number but I can't seem to just forward traffic to the host, to this VM.

I wan't localhost:53557 to map to my VM as well as any connection atempt made to the external IP map to the VM.

How would I go about setting this up?

0 Kudos
2 Replies
WoodyZ
Immortal
Immortal

For an example have a look at:

0 Kudos
leidegre
Contributor
Contributor

It's not enough. Below is ifconfig and lsof output.

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384

inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1

inet 127.0.0.1 netmask 0xff000000

inet6 ::1 prefixlen 128

gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280

stf0: flags=0<> mtu 1280

en0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500

ether 00:1b:63:b2:19:f7

media: autoselect status: inactive

supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control> none

fw0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 2030

lladdr 00:1d:4f:ff:fe:85:30:60

media: autoselect <full-duplex> status: inactive

supported media: autoselect <full-duplex>

en1: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500

ether 00:1d:4f:fc:aa:a5

media: autoselect (<unknown type>) status: inactive

supported media: autoselect

vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

inet 172.16.109.1 netmask 0xffffff00 broadcast 172.16.109.255

ether 00:50:56:c0:00:08

vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

inet 192.168.216.1 netmask 0xffffff00 broadcast 192.168.216.255

ether 00:50:56:c0:00:01

en5: flags=863<UP,BROADCAST,SMART,RUNNING,SIMPLEX> mtu 1500

inet 79.102.40.149 netmask 0xffffff00 broadcast 79.102.40.255

ether 00:03:04:05:06:07

media: 100baseTX <full-duplex> status: active

supported media: 100baseTX <full-duplex>

sudo lsof -i -P | grep -i "listen" | grep vmnet

vmnet-nat 70 root 6u IPv4 0x6b58a68 0t0 TCP *:53557 (LISTEN)

The problem is still, localhost:53557 or any atempt to connect to my external IP:53557 on en5 fails. The only thing which current works is connecting to 172.16.109.128:53557 directly (the gues VM from the host). I need to make the same thing possible from any external computer.

I appricate any help,

John

0 Kudos