VirtualBox/Networking: Difference between revisions
From charlesreid1
(Created page with "==Types of Networks== ==Internal Network== An internal network is a VM-to-VM network. Good if you have a Kali VBox and you're attacking a Metasploitable VBox, and you want t...") |
|||
| (4 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
==Internal Network== | ==Internal Network== | ||
An internal network is a VM-to-VM network. Good if you have a Kali | An internal network is a VM-to-VM network. Good if you have a [[Kali]] VirtualBox and you're attacking a [[Metasploitable]] VirtualBox, and you want to run it all on top of a Mac while you are, say, on a public wifi network and therefore don't want to expose either machine to the outside world. | ||
Start by setting up internal networking on the virtual machine image: use a VM's "Settings" box in the GUI. Click "Networking", then pick "Internal Networking." This will use an internal network with the default name of "intnet". | Start by setting up internal networking on the virtual machine image: use a VM's "Settings" box in the GUI. Click "Networking", then pick "Internal Networking." This will use an internal network with the default name of "intnet". | ||
Next, set up the DHCP server that will allow machines on the internal network to talk to each other and be assigned IP addresses. | Next, set up the DHCP server that will allow machines on the internal network to talk to each other and be assigned IP addresses. To do this, use the VBoxManager command line utility: | ||
<pre> | |||
VBoxManage dhcpserver add \ | |||
--netname intnet \ | |||
--ip 10.2.0.1 \ | |||
--netmask 255.255.0.0 \ | |||
--lowerip 10.2.0.1 --upperip 10.2.0.255 \ | |||
--enable | |||
</pre> | |||
If the DHCP server already exists, you can use the modify argument: | |||
<pre> | |||
VBoxManage dhcpserver modify \ | |||
--netname intnet \ | |||
--ip 10.3.0.1 \ | |||
--netmask 255.255.0.0 \ | |||
--lowerip 10.3.0.1 --upperip 10.3.0.255 \ | |||
--enable | |||
</pre> | |||
Finally, if you want to remove an existing DHCP server: | |||
<pre> | |||
VBoxManage dhcpserver remove --netname intnet | |||
</pre> | |||
Also see my answer here: https://superuser.com/a/1262469/322279 | |||
Documentation for creating dhcp serer: https://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver | |||
=Flags= | |||
[[Category:VirtualBox]] | |||
Latest revision as of 01:47, 26 October 2017
Types of Networks
Internal Network
An internal network is a VM-to-VM network. Good if you have a Kali VirtualBox and you're attacking a Metasploitable VirtualBox, and you want to run it all on top of a Mac while you are, say, on a public wifi network and therefore don't want to expose either machine to the outside world.
Start by setting up internal networking on the virtual machine image: use a VM's "Settings" box in the GUI. Click "Networking", then pick "Internal Networking." This will use an internal network with the default name of "intnet".
Next, set up the DHCP server that will allow machines on the internal network to talk to each other and be assigned IP addresses. To do this, use the VBoxManager command line utility:
VBoxManage dhcpserver add \ --netname intnet \ --ip 10.2.0.1 \ --netmask 255.255.0.0 \ --lowerip 10.2.0.1 --upperip 10.2.0.255 \ --enable
If the DHCP server already exists, you can use the modify argument:
VBoxManage dhcpserver modify \ --netname intnet \ --ip 10.3.0.1 \ --netmask 255.255.0.0 \ --lowerip 10.3.0.1 --upperip 10.3.0.255 \ --enable
Finally, if you want to remove an existing DHCP server:
VBoxManage dhcpserver remove --netname intnet
Also see my answer here: https://superuser.com/a/1262469/322279
Documentation for creating dhcp serer: https://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver