We are still in the same LAB scenario. R1 is fully connected to the internet. I want now that my PC get connected to the internet. To do this, we require to do couple things on the router and on the PC to make it work.
1st thing let’s check if the PC is able to ping to the router IP 192.168.88.1 because this is going to be his gateway to go to the internet.
The ping to the router IP is working successfully.
The 2nd step is to check whether we have put on the PC the right gateway and DNS. We need to put on the PC the gateway as 192.168.88.1 because the router is the way for the PC to go to the internet.
Also, we need to put the DNS server IPs so we are able to open websites (DNS maps the domain names to IP addresses).
I think we have already added the right gateway and DNS on the TCP/IP configuration of the PC, but let’s double check:
Indeed, all information are there.
As all information are there, and the PC has the router as his gateway, let’s try to ping to an IP on the internet. I will ping google DNS which is 220.127.116.11 and see the result.
It is not working. But why? What is the problem?
Well let’s think of it. The PC can reach to the router, so Layer 3 connectivity is working. The PC has a gateway, so it can send all its internet traffic to the router which in turn will send it to the internet. Then I assume that the problem is on the router itself.
The exact problem is that we did not configure the Network Address Translation (NAT) on the router.
The PC has a private IP from the range of 192.168.88.0/24. This IP is not routed to the internet. It should be translated to the IP that is provided from the ISP to the WAN interface on the router which is Ether1.
Someone can say that the WAN IP on Ehter1 is also a private IP, so how it is going to the internet. Well actually, it is also NAT to a public IP from the ISP router. But for us we need to have the NAT configured on the router. On MikroTik, this is called “masquerade”.
Let me show you how to do it.
With this NAT rule, I am saying that any IP going out of the interface Ether1, then the action is to masquerade, that means to be natted.
Let’s try now if the PC can ping to 18.104.22.168:
Excellent!!! It is reaching google DNS now.
What if I ping google.com from the PC to check if the DNS is working?
Also it is working. So now my PC is fully connected to the internet via the MikroTik router.
I will do some changes on the router and PC settings, so we can learn how to do the troubleshooting in case we fall into connectivity problems.