NAT/Port Forward to Virtual IP Interfaces
Posted: 5. Mar 2012, 19:15
I have Windows 8 and Ubuntu 11.04 guests running on a OS X Lion Server host.
The host has multiple "virtual" IP devices on a single hardware device (en0) that happen to have LAN IP's assigned 10.1.1.87-90. I know the IP's work because they are mapped to the outside world on the firewall and, for instance, Tomcat containers are able to bind to the separate IP's to appear as 4 different "servers" to the outside.
What I am trying to do is use NAT and port forwarding (or, even better, a Bridged Adapter) to route all traffic to a given IP to a specific guest. For example, something like this:
10.1.1.87 routed directly to Windows 8 guest
10.1.1.88 routed directly to Ubuntu 11.04 guest
10.1.1.89-90 handled by the OS X Lion Server host as usual
In this way, I could access the guests from the outside world using the usual ports via the outside IP's that are being routed to these. I believe the Bridged Adapter is the usual way to do this, but when I select Bridged Adapter in the Network configuration for the guests, only the actual hardware interfaces are available to select, not the IP aliases.
I am guessing NAT with Port Forwarding should work (say, make rules for ports 22, 80, 443, etc. to route them directly for each host IP), but this also does not appear to work. I am testing using a simple Apache configuration on the Ubuntu guest that I know is open and available.
Any pointers for a configuration like this? Or is this actually not possible with IP aliases?
Here is what ifconfig says on the host:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
ether 00:24:36:f2:92:82
inet6 fe80::224
fef2:9282%en0 prefixlen 64 scopeid 0x4
inet 10.1.1.90 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.89 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.88 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.87 netmask 0xffffff00 broadcast 10.1.1.255
media: autoselect (1000baseT <full-duplex>)
status: active
The host has multiple "virtual" IP devices on a single hardware device (en0) that happen to have LAN IP's assigned 10.1.1.87-90. I know the IP's work because they are mapped to the outside world on the firewall and, for instance, Tomcat containers are able to bind to the separate IP's to appear as 4 different "servers" to the outside.
What I am trying to do is use NAT and port forwarding (or, even better, a Bridged Adapter) to route all traffic to a given IP to a specific guest. For example, something like this:
10.1.1.87 routed directly to Windows 8 guest
10.1.1.88 routed directly to Ubuntu 11.04 guest
10.1.1.89-90 handled by the OS X Lion Server host as usual
In this way, I could access the guests from the outside world using the usual ports via the outside IP's that are being routed to these. I believe the Bridged Adapter is the usual way to do this, but when I select Bridged Adapter in the Network configuration for the guests, only the actual hardware interfaces are available to select, not the IP aliases.
I am guessing NAT with Port Forwarding should work (say, make rules for ports 22, 80, 443, etc. to route them directly for each host IP), but this also does not appear to work. I am testing using a simple Apache configuration on the Ubuntu guest that I know is open and available.
Any pointers for a configuration like this? Or is this actually not possible with IP aliases?
Here is what ifconfig says on the host:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
ether 00:24:36:f2:92:82
inet6 fe80::224
inet 10.1.1.90 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.89 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.88 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.87 netmask 0xffffff00 broadcast 10.1.1.255
media: autoselect (1000baseT <full-duplex>)
status: active