Problem assigning an IP address to a VM in VMware Esxi 6.7

Hello There ,

I’m very new to Mikrotik and recently I have purchased a dedicated server and I’m trying to run a VM with RouterOS .

The issue I’m facing is that when assigning an IP address to Mikrotik , I can’t ping 8.8.8.8 and I get no routes to host .

Here is what the data center has provided me :

IP address I’m trying to set on Mikrotik : 185.X.X.65
Gateway : 172.27.7.229
Netmask : 255.255.255.252

Here are the commands I entered to get the job done :

ip address add address=185.X.X.65 netmask=255.255.255.252 network=172.27.7.229 interface=ether1

and :

ip route add gateway=172.27.7.229

after running those 2 commands , when I ping 8.8.8.8 , I get no routes to host message . Seems I don’t have internet access .

Can you please help me get it working ?

Regards ,

No, something is clearly wrong, what you say you got from data center doesn’t make sense.

If you’re supposed to have 185.X.X.65 with mask 255.255.255.252 (/30), then only other available address in that subnet is 185.x.x.66 and that could be gateway. But if gateway is really 172.27.7.229, then it would have to be point to point config, which would have /32 mask:

/ip address
add address=185.X.X.65/32 network=172.27.7.229 interface=ether1

Thank you for the response . As soon as I removed netmask from my IP assigning command , it worked !

You may still want to ask your hosting for clarification. I assume they had some reason for giving you that mask.