0

I have a virtual machine with a static IP (I can't login to change it) with a different subnet compared to my entire network and I need to communicate with it. In particular, this is my setup:

  • Gateway (192.168.1.1)
  • Kali Linux (192.168.1.14)
  • Windows (192.168.1.254)
  • Virtual Machine (192.168.110.151)

The VM is running with Virtual Box on Windows machine while Kali is on my laptop. Both Windows and Kali are connected via ethernet to the router (192.168.1.1).

Is there a way to communicate from Kali to the VM with two different subnets?

  • Is your VM on bridged to the physical network? Does it have to access the Internet? – Daniel B Aug 18 '16 at 11:30
  • I used host-only interface, but I can't check if it has Internet connection because I don't have login credentials – Cricco95 Aug 18 '16 at 11:33
  • I’m not asking if it has Internet access (it doesn’t), but whether it wants Internet access. :D Without bridging the VM, you won’t be able to access it from other machines. – Daniel B Aug 18 '16 at 11:35
  • Ok, so I will use a bridge connection and I will retry to add the secondary IP – Cricco95 Aug 18 '16 at 11:36
  • Now I am able to ping 192.168.110.151 but if I try to scan the open services with nmap there is only rpcbind while I should see a port 80 open – Cricco95 Aug 18 '16 at 11:54
2

You can assign your Kali laptop a secondary IP address in the 192.168.110.x range with ifconfig:

ifconfig [nic]:0 [IP-Address] netmask [mask] up

Make it permanent by modifying /etc/network/interfaces add adding an iface [nic]:0 inet static stanza which contains the address and mask you require.

| improve this answer | |
  • I used this command: sudo ifconfig eth0:0 192.168.110.2 netmask 255.255.255.255 up, but I can't ping the VM – Cricco95 Aug 18 '16 at 9:39
0

Well, if you made the firewall/router's inside interface 192.168.1.17 and 192.168.110.151 with a subnet mask of 255.252.0.0, it would be able to talk to both subnets without a problem.

additionally, I would probably be more a proponent of getting an additional interface for the router/firewall.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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