Community discussions

MikroTik App
 
kipp
just joined
Topic Author
Posts: 4
Joined: Mon Jan 03, 2022 8:34 pm

multiple public IP with multiple DHPC servers

Mon Jan 03, 2022 10:05 pm

Hello,
new to RouterOS, my ISP gave me 8 public IPs, 5 of them being usable since 1 is for the ISP router, one is broadcast and the third one I don't remember exactly what's used for (it's an FWA service so it has an active antenna).
I want to connect 30 clients simultaneously through a managed switch, what I want to do is to create 5 DHCP servers, one per public IP, to have max 6 devices under a single public IP.
If possible I also want to use a single eth port and bind the public IP with the devices MAC addresses.
Finally all those devices need to be port forwarded.
Is this a hard task to do? Also can I somehow reuse the broadcast IP to have a total of 6 public IPs avaiable?
Some info of my network:
Public IPs:
xx.xxx.108.248 = ISP antenna
xx.xxx.108.249 = gateway
xx.xxx.108.250
xx.xxx.108.251
xx.xxx.108.252
xx.xxx.108.253
xx.xxx.108.254
xx.xxx.108.255 = broadcast
Subnet: xxx.xxx.255.248
 
Sob
Forum Guru
Forum Guru
Posts: 8179
Joined: Mon Apr 20, 2009 9:11 pm

Re: multiple public IP with multiple DHPC servers

Thu Jan 06, 2022 6:27 pm

If the subnet was routed to you, you'd be able to use all eight addresses. But if it's assigned to ISP's router (it has xx.xxx.108.249, which you use as gateway), then you can use only five (.248 is network address, i.e. wasted and not used by anything, and .255 is broadcast, so also unusable for you).

The rest doesn't sound too difficult, if you have at least basic knowledge about networking. Otherwise you have a lot to learn.
Come on people, do you really have to quote full posts? It's annoying and in most cases useless.
 
kipp
just joined
Topic Author
Posts: 4
Joined: Mon Jan 03, 2022 8:34 pm

Re: multiple public IP with multiple DHPC servers

Tue Jan 11, 2022 9:56 pm

If the subnet was routed to you, you'd be able to use all eight addresses. But if it's assigned to ISP's router (it has xx.xxx.108.249, which you use as gateway), then you can use only five (.248 is network address, i.e. wasted and not used by anything, and .255 is broadcast, so also unusable for you).

The rest doesn't sound too difficult, if you have at least basic knowledge about networking. Otherwise you have a lot to learn.
I've checked and only 5 IP are usable sub is /29.
A part from that, I know how to create DHCP servers but never played before with mikrotik routers. How do I assign a public IP for a set of MAC addresses?
 
kipp
just joined
Topic Author
Posts: 4
Joined: Mon Jan 03, 2022 8:34 pm

Re: multiple public IP with multiple DHPC servers

Sun Jan 16, 2022 12:26 am

I've managed to assign all 5 IPs to SFP1 interface and I've created a DHCP server but I don't understand how to assign multiple DHCP servers to a single bridge interface each exiting with a different public IP. Do I need to create NATs?
 
Sob
Forum Guru
Forum Guru
Posts: 8179
Joined: Mon Apr 20, 2009 9:11 pm

Re: multiple public IP with multiple DHPC servers  [SOLVED]

Sun Jan 16, 2022 12:59 am

Sorry, I missed this.

You don't assign multiple DHCP servers to single interface, be it bridge or any other type, it's not possible. But you don't need to. I don't know exact details about what you're doing, but if you have all clients connected to same bridge, even if you could have multiple DHCP servers, you'd need some way how to assign each client to correct server. That can be using MAC addresses, and you can do that with single DHCP server. So add static leases for their MAC addresses.

To organize them, you can either group them in subnet ranges, or you can use lease's address list option, to add them in address list. Then you can have srcnat for the former as e.g.:
/ip firewall nat
add chain=srcnat src-address=x.x.x.0/27 action=src-nat to-addresses=xx.xxx.108.250
add chain=srcnat src-address=x.x.x.32/27 action=src-nat to-addresses=xx.xxx.108.251
...
Or for the latter:
/ip firewall nat
add chain=srcnat src-address-list=clients1 action=src-nat to-addresses=xx.xxx.108.250
add chain=srcnat src-address-list=clients2 action=src-nat to-addresses=xx.xxx.108.251
...
Come on people, do you really have to quote full posts? It's annoying and in most cases useless.
 
kipp
just joined
Topic Author
Posts: 4
Joined: Mon Jan 03, 2022 8:34 pm

Re: multiple public IP with multiple DHPC servers

Sun Jan 16, 2022 9:27 pm

Thanks! Exactly what I needed!

Who is online

Users browsing this forum: No registered users and 9 guests