0

Maybe you can help me a bit. I am new to VM player.. I have Host - win 7 and two Guests on VM player. Kali Linux and Windows xp. I have troubles with setting network connections. Task is to create firewall on Linux machine for windows xp machine. So I cannot understand how to get internet working on Windows XP through Linux machine. I have selected for Linux VM NAT connection for first adapter and host-only as second. (Internet works fine on Linux). On windows VM I have selected only one adaptor as host-only. And… stopped on this step.. What should be done next? I am I doing this right? As I understand host-only is just for internal network between two guests.. Thank you a lot

1 Answer 1

0

You are correct in your assumption as to the "host only" network, but this network is also viewable to your host pc. However if you create a custom network for the adapters on all three machines, facing inwards, you will be able to control it more thoroughly. But you will of course have to set up either a DHCP server or set the IP addresses manually.

Now what you need to do is to get the IP of the inward interface on the linux box, and set that as the gateway for the two windows machines.

After this you want enable IP forwarding on your linux box and then set up a NAT firewall on your linux box.

Once all of this is done, set the NAT interface you chose on the linux box to bridged instead, this will make it pull an actual IP address and make it less prone to messing up.

6
  • Thank you a lot for your answer. It seems not be so hard. Can you explain a bit about Now what you need to do is to get the IP of the inward interface on the linux box, and set that as the gateway for the two windows machines.
    – sa_nikuz
    Apr 28, 2015 at 10:44
  • You mean, if my Linux machine has 192.168.0.111 IP, then second interface should be 192.168.0.113, 255.255.255.0 Mask, 192.168.0.111 Gateway, 192.168.0.111 DNS? And Guest Windows Xp like 192.168.0.114, 255.255.255.0 Mask, 192.168.0.111 Gateway, 192.168.0.111 DNS?
    – sa_nikuz
    Apr 28, 2015 at 11:28
  • Sorry forgot to mention one main thing- My external network should be configured to B class IP address and internal to C class IP. I hope that won't be a problem..
    – sa_nikuz
    Apr 28, 2015 at 13:14
  • It is no problem at all and yes exactly that setup. But you might want to set the DNS to an external one, unless you plan on running a DNS service on the Linux machine. Yes it is quite simple stuff, IF you know where to look. Missing the ipv4_forwarding stuff, means absolutely nothing works no matter how hard you try. :P
    – user38331
    Apr 28, 2015 at 18:51
  • Thanks mate:) Yesterday i've installed red Hat 6.5- because it is closer to me. eth0 is set to 172.168.0.10 /netmask 255.255.0.0/gateway 172.168.0.2 - internet work fine. eth1 is configured to 192.168.0.10/netmask 255.255.255.0/ dont know about gateway? forwarding is done using like: echo 1 > /proc/sys/net/ipv4/ip_forward after that i've ran: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT, but i still cannot ping via ping -I eth1 ... any advice?:)
    – sa_nikuz
    Apr 29, 2015 at 7:02

You must log in to answer this question.

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