Port forwarding OSX Guest/CentOS 7 Guests host only

Discussions about using Linux guests in VirtualBox.
Post Reply
gianis6
Posts: 3
Joined: 13. Feb 2014, 22:50

Port forwarding OSX Guest/CentOS 7 Guests host only

Post by gianis6 »

I have CentOS 7 guest machine running on my OSx host system.
The CentOS machine has two network adapters, one is NAT and the other is host-only.
I assigned a static IP to the CentOS on the host-only adapter, 192.168.30.201 and I can easily reach it from the host machine, both connecting via SSH and navigating to the IP (CentOS 7 has Apache web server installed) 192.168.30.201:8030 (8030 is the port on which Apache listen to connection).
Now, I would like to navigate my IP also from outside my host machine. I correctly configured my router port forwarding, the port 8030 is forwarded to my static IP host machine. Then, from the VM settings, in the network section, NAT tab, I set the port forwarding: Protocol: TCP, Host IP: blank, Host Port: 8033, Guest IP: blank, Guest Port: 8033. If I try to navigate teh virtual machine from outside my host machine, typing my public IP (1.2.3.4:8033), I am not able to reach the apache server.
Is there any further setting I need to do?
BelJoost
Posts: 37
Joined: 12. Nov 2016, 18:35

Re: Port forwarding OSX Guest/CentOS 7 Guests host only

Post by BelJoost »

gianis6 wrote:I would like to navigate my IP also from outside my host machine. [...] Is there any further setting I need to do?
Why not try "bridged" mode first? And if that works try things like port-forwarding if you still need it.
gianis6
Posts: 3
Joined: 13. Feb 2014, 22:50

Re: Port forwarding OSX Guest/CentOS 7 Guests host only

Post by gianis6 »

Thanks! It did work!
Post Reply