Hi,
tldr; I am having trouble getting DNS to work from a device with a static IP, attached to a MikroTik router set up for DHCP.
I am new to MikroTik and RouterOS, but have some experience configuring networks.
I need to configure a small network using a few industrial devices that do not support DHCP, and are set to static IPs in the range 192.168.0.1 - 192.168.0.100.
These devices are all connected to a RB760iGS. and can talk to eachother by IP. I also have a laptop on the network that I use to configure the devices.
The laptop is set up to use DHCP and can use the internet without issues. The devices can ping outside, (8.8.8.8) but cannot resolve any names.
I have a RB760iGS set up as a router starting with the default configuration. I used the quick set web config to set a new IP (192.168.0.1) and DHCP range (192.168.0.100-254).
Internet from another router is connected to Port1, the laptop to 2. In my current configuration there is only one device, on port 4 that I use to debug this problem.
The other router is also providing NAT, on 192.168.4.x; I do not have control over that router, just a wire from it.
Reading through this forum I looked at NAT and Firewall settings. There are a lot of recommendations and videos suggesting using the DHCP server to set a static DHCP lease, but my devices do not support DHCP, so a static IP must be set on the client. I tried adding a static DHCP lease for the devices MAC to no avail.
Since they can ping google, it appears to be a DNS configuration setting:
ping:
had@som:~$ ping 8.8.4.4
PING 8.8.4.4 (8.8.4.4) 56(84) bytes of data.
64 bytes from 8.8.4.4: icmp_seq=1 ttl=119 time=19.1 ms
64 bytes from 8.8.4.4: icmp_seq=2 ttl=119 time=19.3 ms
64 bytes from 8.8.4.4: icmp_seq=3 ttl=119 time=20.6 ms
^C
--- 8.8.4.4 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 19.101/19.640/20.553/0.648 ms
wget of a google IP:
had@som:~$ wget 216.58.193.68
--2020-09-22 00:17:06-- http://216.58.193.68/
Connecting to 216.58.193.68:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2020-09-22 00:17:06-- http://www.google.com/
Resolving www.google.com (www.google.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘www.google.com’
If someone could give me a pointer to what setting to try to get my static IP clients to resolve addresses, that would be much appreciated.
My config:
[admin@MikroTik] > /export
# sep/21/2020 23:58:17 by RouterOS 6.46.6
# software id = Z48L-LHSM
#
# model = RB760iGS
/interface bridge
add admin-mac=48:8F:5A:6A:35:D9 auto-mac=no comment=defconf name=bridge
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.0.100-192.168.0.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=sfp1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=192.168.0.1/24 comment=defconf interface=ether2 network=192.168.0.0
/ip dhcp-client
add comment=defconf disabled=no interface=ether1
/ip dhcp-server lease
add address=192.168.0.24 mac-address=4C:38:D5:11:AD:74
/ip dhcp-server network
add address=192.168.0.0/24 comment=defconf gateway=192.168.0.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.0.1 comment=defconf name=router.lan
/ip firewall filter
add action=accept chain=input comment="defconf: accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
/system clock
set time-zone-name=America/Boise
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN