Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got two VMs, i want VM-2 to be an isolated host, forced to route it's traffic through VM-1. So for example if i use a VPN on VM-1 this will affect VM-2.

VM-1: 
Windows 7, 2 NICs
192.168.1.80 255.255.255.0 Bridged networking
192.168.50.2 255.255.255.0 VLAN1

VM-2: 
Debian 7, 1 NIC
192.168.50.3 255.255.255.0 VLAN1

Is this possible? Thanks in advance for any help.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

If you set VM-1 to share it's internet and VM-2 to route all it's traffic through VM-1 this should work. You can set this setting either with ip route or route command.

I guess this should be the configuration needed on VM-2:

ifconfig eth0 192.168.50.3/24 
route add default gw 192.168.50.2

Note: that as far as I remember, vmplayer/vmware workstation creates a few virtual network cards, one is for the host private network, one is for the nat network. If both VM-1 and VM-2 use host private network, they should be ok.

share|improve this answer
    
Ah, that was simpler than i expected. Was messing around with routing. But simply sharing the connection with the VLAN network and then setting the correct gateway in VM-2 was enough. Thanks! –  John wess Jun 21 '13 at 4:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.