Lab2 Part 2: No internet connection

Lab2 Part 2: No internet connection

by Bastien Favre -
Number of replies: 14

Hello,

I was trying to do part 2 of the second lab and was stuck straight away as I couldn't ping google (8.8.8.8) from inside mininet. I did the steps mentionned at the beginning , but couldn't make it work on both of my computers.

Do you know where the problem might be?

Thank you!

In reply to Bastien Favre

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -
Hello,

Can you elaborate more on the error you are getting? One thing we have noticed is that some people ping google.com instead of 8.8.8.8 which fails due to a lack of domain name resolution.

Regards,
Joseph
In reply to Joseph Abboud

Re: Lab2 Part 2: No internet connection

by Bastien Favre -
I'm pinging 8.8.8.8. I looked at my ip address on r1 after the dhclient command and I am in the 10.0.2.0/24 range as expected.
This is the result of the ping:
ping
In reply to Bastien Favre

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -
It seems from your attempt that everything is set up correctly for the ping to work. I know it can be tedious to debug from a distance, but can you retry this part of the lab to make sure that you haven't forgotten any step or done a step in the wrong place? If this still does not work, you can try this part of the lab on a Minix machine in INF019
In reply to Joseph Abboud

Re: Lab2 Part 2: No internet connection

by Bastien Favre -
Thanks for the quick reply. I've already done it 6 times on different machines, but still the same result occurs.
I finally achieved to make the ping work in mininet. To do that I changed the network in the parameters of the virtual machine to "NAT" instead of "NAT network" that we did during Lab 0.
I don't think it's normal, but that will do for now.
In reply to Bastien Favre

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -

One of the steps at the beggining was to change the settings to NAT: "Note that in the network setting of the VM, there should be one Network Adapter that is set to ”NAT”
Anyway, good that it was sorted out :)
In reply to Joseph Abboud

Re: Lab2 Part 2: No internet connection

by Nadezhda Ilieva -
I seem to have the same problem as Bastien here, but I have changed the Network Adapter to NAT. Also, regarding the part where we flush the IP configuration of the interface connected to the NAT, is that the Ethernet interface of MininetVM? Because after that the virtual machine can not connect to the Internet..
In reply to Bastien Favre

Re: Lab2 Part 2: No internet connection

by Sounak Kar -
Hi,

Could you please try to clear mininet (sudo mn -c) and see if you can connect to the internet? Additionally, do not forget to shut down MininetVM properly every time (instead of forcing a power off which was seen to cause inconsistent behaviours). Let us know if you still face the issue.

Regards
In reply to Sounak Kar

Re: Lab2 Part 2: No internet connection

by Nadezhda Ilieva -
Hello,

Thank you for your reply. I tried multiple times but unfortunately I still have the same issue.
In reply to Nadezhda Ilieva

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -
Hello,

It is normal that MininetVM cannot connect to the internet after you flush the interface of the VM connected to NAT. The point of the exercise is to restore that connection back. If I'm not mistaken, the interface to flush should be enp0s3. Also, make sure to run the flush command in a regular terminal on the VM (not on Mininet), and before you run topo4.py

I you still encounter issues, you can try to solve this part of the lab on a Minix machine in room INF019, you should have acces to it with your camipro.

Regards.
In reply to Joseph Abboud

Re: Lab2 Part 2: No internet connection

by Nadezhda Ilieva -
Hi,

Yes, the interface that I flushed is indeed enp0s3. I also ran it on a regular terminal before running topo4.py.

In the python script there's this line: r1.cmd('ip route add default via 10.0.1.3'). However when I do ip route on r1 there is no "default via ... ". When I tried setting it up it gives me "Error: Nexthop has invalid gateway."
Does this make any sense and could it be the problem?

If this is how it's supposed to be, I will go and try to do the exercise on a Minix machine. Thank you in advance!!
In reply to Nadezhda Ilieva

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -
The script should not be the source of the problem.

When you added a "NAT" network adapter, did you keep the original adapter as "NAT Network"? Can you go to the Network settings of your VM on VirtualBox and check that only Adapter 1 is set to "NAT", and also check that the other 3 adapters are disabled?
In reply to Joseph Abboud

Re: Lab2 Part 2: No internet connection

by Nadezhda Ilieva -
Yes, I only have Adapter 1 enabled and it is set to NAT.
In reply to Nadezhda Ilieva

Re: Lab2 Part 2: No internet connection

by Joseph Abboud -
Oh, then I don't see why this part shouldn't work, unfortunately.

Try doing this part on a Minix and let me know if this still fails.
In reply to Sounak Kar

Re: Lab2 Part 2: No internet connection

by Sounak Kar -
Just to clarify, I assumed that you followed the steps in the problem to restore internet connection and could successfully ping 8.8.8.8 from h1/h2, but could not reach internet from the VM (e.g., pinging 8.8.8.8 from the VM's terminal). Otherwise, I do not know of any other solution: trying on a minix machine seems a good alternative as you and Joseph already thought.