Community discussions

MikroTik App
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

multiple dns using mac-address reservation

Sat Dec 03, 2011 9:06 am

I have a small business network with a single windows server and the computers are all set up on a domain. I also have a pbxtra phone system. The phones all require the phone server be the primary dns, while the domain requires the windows server be the primary dns. I was told that I can set mac-address reservation in windows so that the phones would all be using the pbxtra server as it's primary, and everything else on the network would be using the windows server.

Right now, the mikrotik is my dhcp server, and I would like to keep it that way. Is there a way to, on the same network, assign a different primary dns server based on mac address?
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: multiple dns using mac-address reservation

Sat Dec 03, 2011 10:07 am

You could create two subnets and assign them to the same interface. That would allow you to use different DHCP paameters bust keep all stil on the same physical network.
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Sat Dec 03, 2011 10:31 am

How would I tie one subnet to the phones and the other subnet to everything else?
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: multiple dns using mac-address reservation

Sat Dec 03, 2011 9:53 pm

Assign static IP addresses to phones. You may use DHCP for that.
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Sun Dec 04, 2011 2:23 am

I figured out how to assign a static ip through the mikrotik so I don't have to touch every phone. I then set that subnet to use the phone server as the dns, but I'm still missing something because the phones still do not work. I have a single dhcp server set up in the mikrotik with a gateway of 172.16.0.1 and the computers are using 172.16.0.0/24 range, the phones are set static using 172.16.5.0/24 range. I had the phones using the same 172.16.0.1 gateway. Is there something else I need to do, or do I have something screwed up?
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: multiple dns using mac-address reservation

Sun Dec 04, 2011 7:38 am

Gateway must be address within the same ip range as network.
Assign 172.16.5.1 to mikrotik on the same interface, use it as gateway for 172.16.5.0/24 and that should work.
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Sun Dec 04, 2011 8:58 am

Thanks for the help, I will try that Monday.
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Mon Dec 05, 2011 9:42 pm

OK, so I have my pc network set up as:
address:172.16.0.0/24 gateway:172.16.0.1 dns:172.16.0.2 - 172.16.0.1

phone system is:
address:172.16.5.0/24 gateway:172.16.5.1 dns:172.16.0.254 - 172.16.0.

I have ether2-local-master setup with the name dhcp1 using the pc network as it's address pool. The phones are set up static through the DHCP Lease using dhcp1 as the server. When I set my laptop up on the 172.16.5.x network I can ping the phones, but I cannot ping the gateway or dns.

I'm new to using mikrotiks and I don't work on these advanced networks often. Any help you can give would be appreciated.

Thanks
 
pedja
Long time Member
Long time Member
Posts: 684
Joined: Sat Feb 26, 2005 5:37 am

Re: multiple dns using mac-address reservation

Mon Dec 05, 2011 11:38 pm

Have you set 172.16.5.1 to mikrotik interface?
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Thu Feb 02, 2012 9:55 pm

With holidays and everything, this sat idle for a few months. I am now back banging my head against a wall. I will go through what I have so far, then feel free to tell me how much of an idiot I am for screwing this up. BTW, I am using Winbox.

I have 3 interfaces:
ether1-gateway
ether2-local-master
ether3-local-slave

The address list:
address - network - broadcast - interface
172.16.0.1/24 - 172.16.0.0 - 172.16.0.255 - ether2-local-master
172.16.5.1/24 - 172.16.5.0 - 172.16.5.255 - ether3-local-slave
192.168.1.65/24 - 192.168.1.0 - 192.168.1.255 - ether1-gateway

DHCP Server:
dhcp1 - ether2-local-master - address pool:dhcp_pool2
phones1 - ether3-local-slave - address pool:static-only

Networks:
address - gateway- dns
172.16.0.0/24 - 172.16.0.1 - 172.16.0.2,172.16.0.1
172.16.5.0/24 - 172.16.5.1 - 172.16.0.254,172.16.0.1

Through Leases I can assign the phones a static IP by mac address to ensure they are on the 172.16.5.x network. DHCP is working fine, I just need the phones to point to a different DNS server than the computers so the phones will continue to work if the internet connection goes down, which happens often where this company is located.

Let me know if I need to post any additional information. Thanks for any help that can be given.
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: multiple dns using mac-address reservation

Fri Feb 03, 2012 4:49 am

Why not point everything at the router as your primary DNS and let the router cache/proxy the requests from there?

This makes the DHCP server tell it's clients that the router is their primary (and only) DNS and NTP server.
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.1 gateway=192.168.1.1 ntp-server=192.168.1.1
This sets up a caching server backed by opendns.com (your ISPs name servers might (or might not) be a better choice), and with some locally defined entries:
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB \
    max-udp-packet-size=512 servers=208.67.222.222,208.67.220.220
#
# Some sample static entries
#
/ip dns static
add address=192.168.1.1 name=router ttl=1d
add address=8.8.8.8 name=google-public-dns-a.google.com
add address=8.8.4.4 name=google-public-dns-b.google.com
add address=208.67.222.222 name=resolver1.opendns.com
add address=208.67.220.220 name=resolver2.opendns.com
You may also need to make sure that your firewall accepts LAN connections on port 53, and you may even want to use NAT to redirect all DNS requests to the router:
# This sends all DNS requests to the router
add chain=dstnat protocol=udp dst-port=53 action=redirect
add chain=dstnat protocol=tcp dst-port=53 action=redirect
 
insomnix
just joined
Topic Author
Posts: 7
Joined: Sat Dec 03, 2011 8:57 am

Re: multiple dns using mac-address reservation

Fri Feb 03, 2012 6:03 am

The network is set up on a domain. From my understanding of networks, which is not as much as I wish, this means the server must be the dns server for the PC's. The phone system is fine with this as long as there is an internet connection, but if the internet goes down, the phones loose there connection. The solution is to make the phone server the dns for the phones so the phones will work when the internet goes down. The phone servers dns is not pointed at the isp, it points to the company that built and maintains the phone server.

With all that said, will what you suggest work in this situation? Wouldn't the phones have the same problem if the internet goes down?
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: multiple dns using mac-address reservation

Sat Feb 04, 2012 6:12 am

With all that said, will what you suggest work in this situation? Wouldn't the phones have the same problem if the internet goes down?
Sure why not? Let's draw a simplified network diagram:

clients --- subnet routers --- external router

The subnet router here controls the clients view of the world. Inside the domain foo.com there can be many subnets and possibly (although not necessarily) subdomains (e.g. boston.foo.com, new-york.foo.com, palo-alto.foo.com) We can even take this further:

clients --- work-group-routers --- subnet-routers --- external-router --- backbone-router --- ...

Any of the routers in that chain can act as a name server for anything behind them, and they can depend on upstream routers or peers or ... to answer anything they don't know (caching DNS). Most nameservers act as both servers to machines downstream of them and clients of either machines upstream or master name servers. The point is that the only thing the clients care about is when they ask "what is the IP for joesmith.paris.foo.com" that they get an answer. Obviously not all nameservers are routers nor are all routers nameservers, but for a small to medium office combining them is quite common.

In your case you can configure the router as the local name server, it will answer any DNS requests from it's cache or by asking the next nameserver up the chain. It will also have local entries for the phones and possibly other local machines. When the internet link goes down (or even just your upstream DNS) it can still provide answers for anything in it's cache including the local entries.

Who is online

Users browsing this forum: godel0914, GoogleOther [Bot] and 85 guests