Jump to content

Mikrotik - Router OS


witalit

Recommended Posts

So just grabbed one of the Mikrotik Hex, wow its pretty complicated.

 

So before on my old Asus R7000, I have all my dockers with custom IP's. DHCP IP range was from 20-50.. and all my dockers have IP starting 128,130,131 etc so outside of DHCP. 

 

Before they would show under LAN on DD-wrt as connected clients. Now I can't seem to see them on on the Mikrotik under DHCP, even if I set the docker to get its own IP from DHCP. They work OK and have IP's but its strange I am struggling to setup Pi-hole as my primary DNS.

 

Does anyone have a Mikrotik router and dockers with their static IP's?


Thanks

Link to comment

Docker custom network "DHCP" is totally independent of the LAN DHCP.

there's a reason the instructions asks you to define a "DHCP" range independent of the actual router DHCP range.

So none of the containers will show up in the routers connected clients

 You can still see them in Bridge | Hosts but only at as MAC addresses

image.png.c5c5bdcd9562588d61163bbdc096eb69.png

 

you can use Tools | IP Scan to check whats what on your network.

image.png.5aef6952f2425fe78f01ef10dceaa2d4.png

Link to comment

Ahhh I see thanks.

 

So do I create another DHCP Server and assign it to the network port my Unraid server is connected to on Mikrotik? Will I then need to update routing table on the Mikrotik to be able to communicate from one network to the other? Its strange you said the docker DHCP is separate to network DHCP but on my ASUS it worked fine. I guess with the Mikrotik being more advanced things work differently. 

 

Also I found if I change anything IP related for my server then its hard to get the server to get a new IP, I have to reboot it. Not very convenient as the server is headless sitting under my stairs :-).. pulling the network cable to get new IP don't seem to work. Guess its worth shutting down before making changes so when it boots it gets new IP range. 

 

Cheers

Link to comment

I think you are misunderstanding something.

When a custom network is defined in Docker, you assign it a subnet and DHCP range.

the Docker system then assigns IPs to connected containers from this DHCP range.

But all this is automatic and internal. There is no need to setup another DHCP server or what not.

Example:

my main network is 192.168.2.0/24

my Mikrotik router has a DHCP server for this network is handing out dynamic IPs from .192.168.2.201-192.168.2.249

so now I configure my docker custom network on br0 for the same subnet 192.168.2.0/24, but I set the DHCP range to be 192.168.2.51-192.168.2.99

 

With this setup, devices, PCs and VMs in unRAID can get assigned IPs from 192.168.2.201-192.168.2.249.

But any container on the br0 custom network I create gets assigned an IP from  192.168.2.51-192.168.2.99

 

And that's all there is to it.

Link to comment
39 minutes ago, ken-ji said:

But any container on the br0 custom network I create gets assigned an IP from  192.168.2.51-192.168.2.99


How do you set a specific docker DHCP range .51 to .99 ?

AFAIK docker allows only subnet assignments for a DHCP pool, e.g. 192.168.2.64/27

Link to comment
1 hour ago, ken-ji said:

I think you are misunderstanding something.

When a custom network is defined in Docker, you assign it a subnet and DHCP range.

the Docker system then assigns IPs to connected containers from this DHCP range.

But all this is automatic and internal. There is no need to setup another DHCP server or what not.

Example:

my main network is 192.168.2.0/24

my Mikrotik router has a DHCP server for this network is handing out dynamic IPs from .192.168.2.201-192.168.2.249

so now I configure my docker custom network on br0 for the same subnet 192.168.2.0/24, but I set the DHCP range to be 192.168.2.51-192.168.2.99

 

With this setup, devices, PCs and VMs in unRAID can get assigned IPs from 192.168.2.201-192.168.2.249.

But any container on the br0 custom network I create gets assigned an IP from  192.168.2.51-192.168.2.99

 

And that's all there is to it.

 

Ah I see thanks. So now have the following setup:

 

DHCP Subnet 10.10.66.0/26

Pool - 10.10.66.2-10.10.66.84

 

Docker Subnet 10.10.66.0/24

Pool - 10.10.66.128-10.10.66.256 (Can't seem to choose anything other than 128 IP's)

 

So that's fine, it was working OK before I was just a bit confused they didn't appear under DHCP leases, I see they are under Bridge - Hosts. The next step is trying to set PI-Hole as my DNS server so all traffic goes through the Pi-hole docker? My Pi-hole docker IP is 10.10.66.128. I have tried a few things but it breaks DNS and I have to change it back from a machine which still had the old DNS settings (Router IP). 

 

- If i set Pi-hole as DNS will the DNS cache available on my Mikrotik router be non-existent? 

- With Pi-hole IP being under hosts and not part of main DHCP range be a problem?

 

Thanks for your help Ken-ji, your tutorial for macvlan before this functionality was implemented into 6.4 (I think) was super helpful.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...