0

VM2 connected to internet gateway (VM1) cannot access internet (VirtualBox)

I have installed VirtualBox VMs on my Linux (Ubuntu) which has wired internet connection. I want to connect my VM2 (Server linux) to internet through a VM1 (Gate Linux), I tried multiple approaches, please see the attached picture, but still no luck VM2 still cannot access internet via Gate Linux, when I am running traceroute from Server Linux its outputs that most of the internet requests stop on Gate Linux. Can you please assist me with configuring internet Gate Linux in virtualbox enviroment. enter image description here

7
  • Can you ping (gateway) 192.168.13.1 from VM2? Also you don't need ip_forward rule on vm2. Commented Dec 20, 2018 at 18:08
  • yes I can ping from VM2 -> VM1 machine. Commented Dec 20, 2018 at 18:29
  • Can you please provide complete traceroute from VM2 to 192.168.0.1? Commented Dec 20, 2018 at 18:32
  • output from VM2: server:corp13.un:~# tracertoute 192.168.0.1 traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 60 byte packets 1. proxy (192.168.13.1) 0.697 ms 0.778 ms 1.357 ms 2. * * * 3. * * * Commented Dec 20, 2018 at 18:38
  • Good, it looks like you can reach 192.168.0.1, but 192.168.0.1 cannot reply back as it has no idea that 192.168.0.5 has a route to 192.168.13.0/24 network. Try adding a static route on your 192.168.0.1 router specifying 192.168.0.1 as a route to 192.168.13.0/24 network. Commented Dec 20, 2018 at 18:41

1 Answer 1

0

I am pretty sure you also cannot ping 192.168.13.1 from your server as it has no route to 192.168.13.0/24. By default it would send requests uplink, and of course your internet provider wouldn't know where 192.168.13.0/24 is either. So you will have to add a static route on 192.168.0.1, specifying 192.168.0.1 as a route to 192.168.13.0/24 network.

Маршрутизация IPv4 is what you are looking for.

Сеть -> Маршрутизация(IPv4) Концигурация Роутера РосТелеком

18
  • but I can ping my VM1 from router: ibb.co/DGcBGNr Commented Dec 20, 2018 at 19:26
  • Can you ping 192.168.13.1 from 192.168.0.1? I am pretty sure you can only ping 192.168.0.5, which is going to be in the same network as your router (192.168.0.0/24). But you need to access 192.168.13.1, which is located in a separate network (192.168.13.0/24) Commented Dec 20, 2018 at 19:29
  • ok, so you can ping 192.168.13.1, and not 192.168.13.10? Commented Dec 20, 2018 at 19:31
  • well, I definitely can ping my virtual machine from my Wi-Fi Router :) ibb.co/FzmFwZ8 ibb.co/P5xs1nv please see attachments. Commented Dec 20, 2018 at 19:31
  • 1
    thank you, after saving rules in /etc/iptables/rules.v4 everything works fine :) Commented Dec 20, 2018 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .