0

I have a Windows Server 2012, in a data center, with Virtualbox to host a linux CentOS 6.4 server.

The data center has provided me 5 IPs, and they are all on the same subnet.

Windows is accessible from outside, IIS is working properly, as well as FTP and other services.

CentOShas a LAMP configuration, and running a curl command from the console I can see the apache test page, and the login page of phpmyadmin. If I ping or curl from CentOS I correctly get responses from external website. If I ping the IP address from outside I've assigned to CentOS, I can see responses.

I have configured the gateway in /etc/sysconfig/network-scripts/ifcfg-eth0 with the following parameters:

# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=06:01:78:a7:00:33
NETMASK=255.255.248.0
IPADDR=95.110.xxx.xxx
TYPE=Ethernet

and I've defined the default gateway here (/etc/sysconfig/network)

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=myhostname
GATEWAY=95.110.xxx.xxx

In Windows I have two network adapter visible:

  1. Ethernet, with specified the IPv4 of the windows server
  2. VirtualBox Host-only Network, where I have set one of the additional IP available

Then in the Virtualbox control panel I've tried to set both Bridged Network and host-only, but the CentOS server is never accessible from outside, and by outside I mean also from the Windows host server.

I always receive a "Site not reachable", timeout response if I try to browse the IP or http://95.110.xxx.xxx/phpmyadmin. But If I try to ping it I get responses. Which is the right way to configure virtualbox and network adapters to make the guest accessible from outside?

Please note:

  1. I don't want to use NAT and port forwarding as I own a dedicated IP for guest server and I don't want to configure port fwd.
  2. I've tried to disable iptables and ip6tables, but still not accessible.
  3. I've tried also to temporary disable windows firewall.
  4. Don't tell me to use Vagrant or other software.
  5. The physical server is directly connected to internet, without any hard firewall or proxy that could cause issues.

1 Answer 1

0

If your server has only one "real" adapter and is connected and exposed to Internet, every virtual machine you set as "bridged" is going to be exposed too. So if only one vm is needed to be accessed, you can set up only that vm as bridged and the rest as NAT (I mean Virtualbox NAT, not a NAT with your router or firewall). So you can consume only two public ips, one for your host and another one for your vm which want to be accessed from Internet. You can set up this exposed vm with static ip using one of the public ip addresses in the same way as the real machine (each one must have one public ip but different between them).

Anyway, doing this, all you vm is going to be exposed, not only the ports you want to expose, keep in mind that.

So, summarizing:

  • Your host (real machine) will have a fixed public ip address
  • One or your vm will have bridged interface with a fixed public ip address
  • The rest of your vms will have their interfaces as NAT.
1
  • Still not working... the host has its public IP x.x.x.239. The current only one VM (CentOS) has its own IP, x.x.x.242 defined on eth0, and I've configured on virtualbox only one network interface, as Bridged connection, trying PCnet FAST III and Intel. Nothing, connecting from Host or outside browser, always timeout. Tried also NAT with only port 80 open, same result.
    – Giox
    Commented Dec 29, 2016 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .