Results 1 to 8 of 8

Thread: [virtualbox] Routing Between Two Ubuntu Guests

  1. #1
    Join Date
    Jun 2013
    Beans
    6

    [virtualbox] Routing Between Two Ubuntu Guests

    Greetings,

    I hope I put this question in correct forum since I am working with Ubuntu in my VirtualBox. I am new in configuring Virtual Machines (VMs), and I have a problem in routing between two guests with Ubuntu 12.04 run on both.

    Here is my system :
    My Host : Windows 7 64-bit
    VirtualBox version : 4.2.12
    All of my 3 guests : Ubuntu 12.04

    My VM configuration is as the following :
    VM1 - As a Host 1
    Adapter 1 : NAT
    Adapter 2 : Host-Only, the IP address is 192.168.56.101

    VM2 - As a Router
    Adapter 1 : NAT
    Adapter 2 : Host-Only, the IP address is 192.168.56.102
    Adapter 3 : Host-Only, the IP address is 192.168.194.101

    VM3 - As a Host 2
    Adapter 1 : NAT
    Adapter 2 : Host-Only, the IP address is 192.168.194.102

    I want it to make it like this : VM1 <---> VM2 <---> VM3.
    But the ping result that I got :
    from VM1 to VM2 : Success
    from VM1 to VM3 : Failed!
    from VM2 to VM1 : Success
    from VM2 to VM3 : Success
    from VM3 to VM1 : Failed!
    from VM3 to VM2 : Success

    It seems like the VM2 does not work as a router, it can connect to each host, but i can not make the hosts connected with each other. Can someone please help me?
    Thank you.

  2. #2
    Join Date
    Jun 2013
    Beans
    18

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    Hi,

    if I'm not totally wrong to make this happen your VM2 would need to have two NICs. Otherwise it cannot communicate between the two networks.

    Regards,
    Michael

  3. #3
    Join Date
    Jun 2013
    Beans
    6

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    Quote Originally Posted by mlu17 View Post
    Hi,

    if I'm not totally wrong to make this happen your VM2 would need to have two NICs. Otherwise it cannot communicate between the two networks.

    Regards,
    Michael
    I did, I already added that two interfaces in the VM2, this is the ifconfig of VM2. But still it did not work. Any other suggestion? Thanks

    Code:
    eth0      Link encap:Ethernet  HWaddr 08:00:27:46:07:61  
              inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
              inet6 addr: fe80::a00:27ff:fe46:761/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:189 errors:0 dropped:0 overruns:0 frame:0
              TX packets:231 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:136572 (136.5  KB)  TX bytes:24391 (24.3 KB)
    
    eth1      Link encap:Ethernet  HWaddr 08:00:27:5c:e5:a2  
              inet addr:192.168.56.102  Bcast:192.168.56.255  Mask:255.255.255.0
              inet6 addr: fe80::a00:27ff:fe5c:e5a2/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:116 errors:0 dropped:0 overruns:0 frame:0
              TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:15996 (15.9 KB)  TX bytes:11062 (11.0 KB)
    
    eth2       Link encap:Ethernet  HWaddr 08:00:27:67:82:eb  
              inet addr:192.168.194.101  Bcast:192.168.194.255  Mask:255.255.255.0
              inet6 addr: fe80::a00:27ff:fe67:82eb/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:81 errors:0 dropped:0 overruns:0 frame:0
              TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:14697 (14.6 KB)  TX bytes:10527 (10.5 KB)
    
    lo        Link encap:Local Loopback   
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:86 errors:0 dropped:0 overruns:0 frame:0
              TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:10202 (10.2 KB)  TX bytes:10202 (10.2 KB)

  4. #4
    Join Date
    Jan 2008
    Beans
    Hidden!
    Distro
    Kubuntu 13.04 Raring Ringtail

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    benynug,

    On VM2 did you enable forwarding and setup NAT rules? VM2 will not automatically start routing between VM1 and VM3.

    Try this:
    http://how-to.wikia.com/wiki/How_to_...based_computer

  5. #5
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    29,807
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    Moved to virtualization.

  6. #6
    Rebelli0us is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Feb 2008
    Beans
    722

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    For VBox Guests to see each other (and your network) set Network to "Bridged Adapter".

  7. #7
    Join Date
    Jun 2006
    Location
    Brisbane Australia
    Beans
    713

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    This seems a routing question, not specifically anything to do with virtual machines. To ping/route from VM1 to VM3 you need to configure a route on VM1 to 192.168.194.* via adaptor 2, and vice versa for VM3. You also need to enable ip forwarding on VM2 - see Google for that.

  8. #8
    Join Date
    Jun 2013
    Beans
    6

    Re: [virtualbox] Routing Between Two Ubuntu Guests

    Quote Originally Posted by markbl View Post
    This seems a routing question, not specifically anything to do with virtual machines. To ping/route from VM1 to VM3 you need to configure a route on VM1 to 192.168.194.* via adaptor 2, and vice versa for VM3. You also need to enable ip forwarding on VM2 - see Google for that.
    Finally it's working

    what I did :
    1. enabling ip forwarding on VM2
    2. adding default gateway on VM1 and VM3
    3. adding route on VM1 to VM2 via adaptor 2, and on VM3 to VM1 via adaptor 2

    Thank you all

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •