Saturday 21 September 2013

Refer Cyberz Tab for updates


Networking in Virtual Box █████
Networking in Virtual Box is extremly funn and powerful. Today in this articles we are studying about How to perform networking in VirtualBox.
According to official website of Oracle we can configure around 8 virtual NIC’s(Network interface Controllers),but on GUI mode you will find only 4 to configure.
VirtualBox can virtualize the following six types of networking hardware(Adapter Type):
1.  AMD PCNet PCI II (Am79C970A)
2.  AMD PCNet FAST III (Am79C973) <===(the default)
3. Intel PRO/1000 MT Desktop (82540EM)
4.  Intel PRO/1000 T Server (82543GC)
5.  Intel PRO/1000 MT Server (82545EM)
6.  Paravirtualized network adapter (virtio-net)
The PCNet FAST III is the default because it is supported by nearly all operating systems out of the box, as well as the GNU GRUB boot manager
=>There are around roughly four type of modes through which NIC operates with respect to your host physical networking.
1.NAT(Network Address Translation)
2.Bridged networking
3.Internal networking
4.Host-only networking
let us discuss each one of them :)
 ██████  1.  NAT(Network Address Translation)
nat
It is a default mode of your VirtualMachine. In this mode every Guest Operating System(1,2,3) assigned same IP address (10.0.0.7) because they thinks they are on their own isolated network. And when they send their traffic via the gateway (10.0.0.1) VirtualBox rewrites the packets to make them appear as though they originated from the Host, rather than the Guest (running inside the Host).The outside world will never be able to send or receive packets with Guest machine directly. Logically it looks like above in the picture.
You can configure NAT setting by clicking on Virtualmachine “setting” ->”Network”->” Check Mark onEnable Network adapter”->”Attach to NAT” for example here in below picture
2=> NAT limitation.
 1.ICMP protocol limitations (You can’t ping or tracerouting)
 2.You can’t configure Client efficiently.
3.Receiving of UDP broadcasts is not reliable.
4.Forwarding host ports less then 1024 impossible
██████ 2.Bridged networking
bridgeWhen you connected with Bridged networking with your virtualmachine then it will act like a physical machine in your network.In this mode every Guest Operating system(1,2,3) assigned IP address(192.168.56.2),(192.168.56.3),(192.168.56.4) which is equivalent to host Operating system IP(192.168.56.1).It can access any services on the network such as external DHCP services,name lookup services, and routing iformation just like your Host operating system does. Logically it looks like above in the picture.
A virtual NIC’s is bridged to a physical NIC’s on you host like this by clicking on Virtual Machine “setting” ->”Network”->” Check Mark on Enable Network adapter”->”Attach to “Bridged adapter”  and in Name give “eth0″ or what ever your card name is, right now i am connected with ethernet card for example here in below picture
bridgesetting
Bridged network limitation
Currently, VirtualBox supports only IPv4 over wireless.(On Linux Host)
██████ 3. Internal Networking
internalnetworking
It is similar to your bridged network but in this mode Guest operating system are communicated internally. As you can see in this picture All Guest operating system (1,2,3) are internally connected with each others(The whole network is under vboxnet0). when you configure one or more Guest Operating system to sit on internal network stays within the host and is only visible to Virtual Machine or virtual network. You can configure all  Guest operating system via Host Operating System(Linux) Terminal via following commands. This will assigne the IP range to each individual Guest Operating system.
1
sudo <a class="zem_slink" title="VirtualBox" href="http://www.virtualbox.org" target="_blank" rel="homepage">VBoxManage</a> dhcpserver add --netname intnet --ip 0.0.0.0 --netmask 255.255.255.0 --lowerip 0.0.0.100 --upperip 0.0.0.199
Note: If you do not specify a network name, the network card will be attached to the network intnetby default.
You can configure Ineternal networking setting by clicking on Virtualmachine “setting” ->”Network”->” Check Mark on Enable Network adapter”->”Attach to “Internal Network” and in Name “intnet”
internal-networking
██████ 4.Host-only networking
host-only-networkingWhen you are connected with Host-only networking. Then let me tell you,It is a hybrid of Bridged networking + Internal networking. In this mode, the Guest machine can talk to each other and also with the Host machine. It will look like, all machine including Host and Guest Machines , are connected to a physical network .which is a dedicated network device, called vboxnet0.But you will not find “Vboxnet” as by default it is empty.
To Create vboxnet0 for host only adapter you need to type the following command in your host operating system terminal.
1
VBoxManage hostonlyif create
Then after You can configure Host only networking setting by clicking on Virtualmachine “setting” ->”Network”->” Check Mark on Enable Network adapter”->”Attach to “Host-onlyl Network” and in Name “vboxnet0″ <= By default  you will see. :)
host-only

No comments:

Post a Comment