networking for virtual machines

Upload: rajat-singhal

Post on 04-Apr-2018

240 views

Category:

Documents


1 download

TRANSCRIPT

  • 7/30/2019 Networking for Virtual Machines

    1/8

    Networking for Virtual Machines

    Hi friends..!!!First of all Happy new year to all of you.. !! J

    Today Ill try to clear your doubts about networking in virtual machines Many of my friends

    asked me about some networking problem in virtual machine. They got problems like in virtual

    machine they are unable to share files or they cant make connections between their virtualmachines. So let me clear some doubts about this issue with a simple tutorial.

    For any of your installed virtual machines, click on Settings > Network. Here the fun begins.

    This is the default view. Any virtual machine can have up to four network adapters. You can

    enable them selectively as you see fit. Most people will require just one.

  • 7/30/2019 Networking for Virtual Machines

    2/8

    The most interesting part is Network Connection section. This category defines how your network

    adapter will interface with existing physical hardware. Different setups will result in markedly different

    results.

    Network types :

    We have four options here: NAT (default), Bridged, Custom, and Host Only. Of course, Notattached is also a type, but not one we can really use, per se.

    Network Address Translation (NAT)

    NAT means the virtual machines will have private IP addresses that are not routable fromoutside.

    Example: Your host is 192.168.1.1. The Virtual machine NAT device will be marked as

    192.168.189.138. Therefore, the virtual machines will be given any address in the 192.168.189.xrange. Since there is nothing to route access to machines in the 192.168.189.x/24 subnet, they

    will be inaccessible from your host.

    http://blog.hicubes.com/2013/01/networking-for-virtual-machines.html/vrt3
  • 7/30/2019 Networking for Virtual Machines

    3/8

    Advantage: Simplicity & seclusion.

    Disadvantage: No route to virtual machines, no network sharing.

    Bridged Adapter

    Bridged Adapter means that any virtual machine running will try to obtain an IP address from thesame source your currently active, default network address got its IP address. Hence the term

    bridged, as the two are connected.

  • 7/30/2019 Networking for Virtual Machines

    4/8

    Example: Your host has leased an address of 192.168.1.4 from the router. The virtual machine

    leases an address of 192.168.1.5 from the router. The two machines now share the same network

    and all standard rules apply. For all practical purposes, the virtual machine is another IP address

    on your LAN.

    For the host

  • 7/30/2019 Networking for Virtual Machines

    5/8

    This setup cannot work if your device (switch, router, ISP, etc) does not permit you to lease more

    than one IP address. Therefore, computers with direct Internet access may not be able to use

    Bridged networking.

    Advantage: Allows flexible management of the network with port forwarding and services

    enabled. Allows network sharing in the classic way.

    Disadvantage: Might not work with direct Internet access (requires router), more difficult to

    understand for new users, exposes machines to network with possible security implications.

    Host-only Adapter

    Host-only Adapter is very interesting. Its very similar to Bridged Adapter, except that it uses a

    dedicated network device, called VMnet1, to lease IP addresses.

  • 7/30/2019 Networking for Virtual Machines

    6/8

    Your host machine is the de-facto Virtual Machine router, with the IP address of 192.168.19.1.The adapter is not in use if there are no virtual machines running with Host-only setup. However,

    once they come up, this adapter serves IP addresses to the virtual machines, creating an internal

    LAN, within your own network.

    Example: Your host has the IP address of 192.168.19.1. Your virtual machine has the IP address

    of 192.168.19.128.

    For Host :

  • 7/30/2019 Networking for Virtual Machines

    7/8

    For Guest :

    VMware Server has its two virtual adapters called vmnet1 and vmnet8, which are used assign

    NAT and host-only IP addresses to guests. However, unlike the VirtualBox NAT adapter,

    VMware Server always bridges the default network device on your hosts and therefore you have

    direct network access to NAT-ed machines. You dont have this luxury on VirtualBox (yet).

    But the addition of vboxnet0 in VirtualBox 3 has significantly simplified network usage in this

    phenomenal product. If you wish to recall the trouble Ive had to deal with in earlier release of

    VirtualBox, do take a look at myVMGLtutorial. I had to manually configure everything. BTW,

    you can change the default IP address allocation, if you want.

    Very importantly, please note that using the Host-only adapter does not mean your guests will

    have Internet access. In fact, they wont. vboxnet0 does not have a default gateway. To make

    vboxnet0 also serve queries outside the local network, you will have to configure it to use

    another adapter for that, enable forwarding and possible reconfigure your firewall rules.

    Host-only Adapter is useful for creating private networks, where machines need access to one

    another, but not necessarily outside this subnet.

    Advantages: Useful for noisy software testing, penetration testing. Allows classic network

    sharing via IP address.

    http://www.dedoimedo.com/computers/virtualization-3d-support-vmgl.htmlhttp://www.dedoimedo.com/computers/virtualization-3d-support-vmgl.htmlhttp://www.dedoimedo.com/computers/virtualization-3d-support-vmgl.htmlhttp://www.dedoimedo.com/computers/virtualization-3d-support-vmgl.html
  • 7/30/2019 Networking for Virtual Machines

    8/8

    Disadvantages: As difficult to understand as Bridged networking for new users, no Internet

    access in the virtual machines. May introduce a security risk to other machines on the private

    network.

    I hope this tutorial will help you to configure your virtual machine..