Community discussions

MikroTik App
 
Johannes33
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Mon Dec 26, 2016 1:26 am

linux-mikrotik static ip does not play nice.

Sat Oct 20, 2018 12:40 pm

Hi,
I have a linux machine (LM19) with the settings
ip 192.168.88.254
mask 255.255.255.0
gateway 198.168.88.1
dns 127.0.0.53 (linux dns cash) and my dns servers from isp.

winbox:
Before i had static ip setup on my linux machine I had a dhcp. In winbox the dhcp servers window in the leases tab I put the ip address to static. Then I changed the settings to the above on the linux machine. I did all this last night and it worked fine but I did not reboot. When I booted up this morning I have no internet connection. I can reach the router via ip address in winbox and in the leases tab my connection is marked as "waiting". I also tried to use chrome to reach google.se with the ip address 172.217.12.131 but it did not work. but traceroute / ping to the same ip worked but ping/traceroute google.se did not work. I pinged my dns servers and it worked. I disabled the firewall on the computer and that did not help either. I have no clue what to do so all suggestions are appreciated.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13022
Joined: Thu Mar 03, 2016 10:23 pm

Re: linux-mikrotik static ip does not play nice.

Sat Oct 20, 2018 1:01 pm

As soon as you configured linux with static address and settings, it will not use DHCP protocol to obtain settings from router regardless of settings on router. If you set lease static on RB, it is still dynamic from client's (linux) perspective, but DHCP server reserves that IP address for particular client and will serve it whenever client asks for a lease (without making it static it may happen that leased IP address changes sometimes).

Also, when configuring host (e.g. your linux machine), don't forget to set default route with router's LAN address as gateway. Seems like you have that or else you couldn't reach google using traceroute.

What's really suspicious is using 127.0.0.53 as IP address of DNS server. Usually loopback (lo interface in linux) is configured with IP address 127.0.0.1. In addition to that, 127.x.y.z addresses are only valid on the same host. So it's fine to use it on linux host that actually runs DNS caching server but not on other machines on your LAN (those have to use linux' LAN IP address if you want them use caching server). When you're configuring IP stack on linux, you probably want to set DNS server's address to 127.0.0.1 only and use your ISP's DNS servers addresses as forwarders in DNS server's config.

Who is online

Users browsing this forum: lukaszkruszka, mkx and 52 guests