Networking and routing

Discussions about using Windows guests in VirtualBox.
Post Reply
Gregos
Posts: 3
Joined: 15. Feb 2011, 12:30
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: 7, 2008

Networking and routing

Post by Gregos »

Is it possible to route clients to the internet through an interface that set as NAT?
I got 3 server 2008 machines, and one of them have 3 NICs and routing service:
Router server with 3 NICs: 192.168.0.200 internal, 172.25.25.200 internal, 10.0.4.2 NAT
client1: 192.168.0.1, gateway: 192.168.0.200
client2: 172.25.25.1, gateway: 172.25.25.200

Client1 and client2 on different subnets and can ping each other, means routing works fine for the internal network.
The problem is that clients are not routed to the 10.0.4.2 NAT interface, means they don't have internet access.
The routing server does have internet, it can ping internet IPs and 10.0.4.2, though clients cant even ping 10.0.4.2

router's route table

Code: Select all

          0.0.0.0          0.0.0.0         10.0.4.2        10.0.4.15     10
         10.0.4.0    255.255.255.0         On-link         10.0.4.15    266
        10.0.4.15  255.255.255.255         On-link         10.0.4.15    266
       10.0.4.255  255.255.255.255         On-link         10.0.4.15    266
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      172.25.25.0    255.255.255.0         On-link     172.25.25.200    266
    172.25.25.200  255.255.255.255         On-link     172.25.25.200    266
    172.25.25.255  255.255.255.255         On-link     172.25.25.200    266
      192.168.0.0    255.255.255.0         On-link     192.168.0.200    266
    192.168.0.200  255.255.255.255         On-link     192.168.0.200    266
    192.168.0.255  255.255.255.255         On-link     192.168.0.200    266
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link     192.168.0.200    266
        224.0.0.0        240.0.0.0         On-link     172.25.25.200    266
        224.0.0.0        240.0.0.0         On-link         10.0.4.15    266
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link     192.168.0.200    266
  255.255.255.255  255.255.255.255         On-link     172.25.25.200    266
  255.255.255.255  255.255.255.255         On-link         10.0.4.15    266
Last edited by Gregos on 17. Feb 2011, 23:58, edited 1 time in total.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Networking and routing

Post by Sasquatch »

The routing table looks fine, but you have to make sure that the actual routing is also done properly. Check up on how you got the two networks to communicate with each other. Then you can do the same to redirect all other traffic to the NAT interface. Once you can ping 10.0.4.15, you're on the right way. Next is to try to ping your home router, that the Host uses. Your Host might block ping with it's firewall, which explains why you can't ping 10.0.4.2.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Gregos
Posts: 3
Joined: 15. Feb 2011, 12:30
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: 7, 2008

Re: Networking and routing

Post by Gregos »

Yes, 192 and 172 can ping 10.0.2.15 . They cant ping 10.0.4.2 though.
Only 10.0.4.15 can ping 10.0.4.2, because they're directly connected of course, and the only one that can access the internet.

Image
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Networking and routing

Post by BillG »

That really doesn't have anything to do with VirtualBox. That is a basic networking problem.

Routing will only be automatic if the server is running as a NAT router. NAT takes care of the routing because all of the traffic on the 10. network is using the NAT server's 10. IP address, so the replies come back to the NAT router (which then sends them on the original requester). If you only have LAN routing enabled on the server you need extra routing on the 10. network so that the 10. network machines know how to reach the 192. and 172. networks.

Routing is a two-way process. Getting a packet to a different network is only half the battle. The target machine needs to know how to reply. If it doesn't have a route, it sends the packet to its default router. if the default router doesn't have a route, it uses its default route (which is probably out to the Internet).
Bill
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Networking and routing

Post by Sasquatch »

What BillG said. This routing problem is outside the scope of this forum. You will have the same problem on bare metal where you have 3 interfaces and networks, trying to get the 192 and 172 access resources behind the 10 network. Since you know how to get traffic from 192 to 172 and back, you can apply the same for the 10 network.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Gregos
Posts: 3
Joined: 15. Feb 2011, 12:30
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: 7, 2008

Re: Networking and routing

Post by Gregos »

So the problem is that 10.0.4.2 doesn't know that 10.0.4.15 connected to 172. and 192.? If so, is it possible to configure NAT routing table or something? or make it learn automatically?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Networking and routing

Post by Sasquatch »

You're not getting the point. 10.0.4.2 has some data in it's packets for the 192 and 172 destination, but the router has no idea how to handle that. Really, dive into the routing you have now, read books, whatever it takes to get an idea of your problem. If I were to create your situation, I would not have any problem getting it fixed. But as I said before, this is not in the scope of this forum.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply