Getting different IP addresses for two connected VMs

Discussions about using Linux guests in VirtualBox.
Post Reply
blindchicken11
Posts: 6
Joined: 2. Oct 2014, 00:08

Getting different IP addresses for two connected VMs

Post by blindchicken11 »

Hello. I'm trying to configure two Kali Linux machines to work with SSLstrip. What I want to do is have one of the machines forward all it's packets to the other machine. However, I'm having trouble doing this because both machines have the same ip address. One machine needs access to the outside as well as the second VM, while the second VM just needs access to the first VM and not the outside. I've tried various adapter combinations but to no-avail, the machines always have the same ip address so I can't forward packets to the other. Does anyone have any tips on changing the ip address of one?

Thanks in advance!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Getting different IP addresses for two connected VMs

Post by Perryg »

Not without knowing what you are using ( network type ) and what the addresses are and where they are coming from.
blindchicken11
Posts: 6
Joined: 2. Oct 2014, 00:08

Re: Getting different IP addresses for two connected VMs

Post by blindchicken11 »

Do you mean the type of adapter being used on the VMs? Here's some info:

Host: Windows 10, connecting via wifi
Guests: Two Kali Linux VM's, both networks set up as "bridged adapter" using my host's wireless network adapter. The MAC addresses are different in the settings, and they are both "cable connected". However, they are unable to connect to anything when running.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Getting different IP addresses for two connected VMs

Post by Perryg »

First what you stated as wanting to do probably will not happen using bridged on both guests. You failed to post the ip address so I can't help much but *if they are getting an address from your wireless router they couldn't possibly be the same. Did you install and set these two machine up yourself?
blindchicken11
Posts: 6
Joined: 2. Oct 2014, 00:08

Re: Getting different IP addresses for two connected VMs

Post by blindchicken11 »

These were pre-built machines for Virtual Box.

For my "victim" machine, I just have host-only network. The inet addr is 192.168.56.102 and I cannot connect to the outside or ping my other virtual machine.
For my "attacking" machine, I'm using NAT and my inet addr is 10.0.2.15 and I can reach the outside internet and can ping the "victim" machine.

I switch both to NAT and they have the same ip address: 10.0.2.15
My host computer's IP is 130.85.251.172
Last edited by blindchicken11 on 6. Nov 2015, 02:23, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Getting different IP addresses for two connected VMs

Post by Perryg »

Host-only will not get to the Internet. Thus the name host-only. NAT will allow the Internet but it isolates you from all LAN activity.

I would set the first guest to NAT and add a second adapter set to internal, then on the second guest use a single adapter set to the same internal adapter.
If the second guest needs the Internet directly you would need to set the first guest to do the routing since these addresses will be on a different subnet.
blindchicken11
Posts: 6
Joined: 2. Oct 2014, 00:08

Re: Getting different IP addresses for two connected VMs

Post by blindchicken11 »

Okay I did as you said. So the first machine w/ NAT and the internal adapter can connect to the internet ("eth0"), but it's stuck on "connecting" for the other connection which is listed as "eth1".
The second machine w/ just an internal adapter is stuck on "connecting" as well which is listed as "wired".

I can't ping between the two machines.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Getting different IP addresses for two connected VMs

Post by Perryg »

Unless you setup dhcp on the internal adapter ( see the manual on how ) you would manually assign the address using a private number scheme.
blindchicken11
Posts: 6
Joined: 2. Oct 2014, 00:08

Re: Getting different IP addresses for two connected VMs

Post by blindchicken11 »

Ohhhhhhhh, okay I completely forgot about assigning them manually. Everything seems to be working now. Thank you for your help!
Post Reply