Community discussions

MikroTik App
 
AdaptiveGroup
just joined
Topic Author
Posts: 3
Joined: Tue Mar 03, 2015 11:05 pm

One ISP Modem, multiple dynamic IP addresses

Fri Sep 09, 2016 11:37 pm

Hello there folks,

Today I've stumbled with a problem I have no clue how to solve. We have moved to a new ISP at work, purchasing a several-IP-addresses-pack from them. They provided a single modem that works as a DHCP server.

The modem only has one network port. When plugging it to our router, how can we obtain more than one IP address from it? The only functional thing I've come up with is plugging the modem to a switch and then several interfaces of the router to the same switch, getting one IP on each one (eth0, eth1, eth2, ... ). This, of course, works, but I'd very much like to just connect the modem to the router directly and manage the different addressess from RouterOS.

Relevant info:
  • Here at work we have some RB1200 and a RB1100 routers.
    All are running v6.36.3.
Any help is appreciated!
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 3:03 am

Unfortunately, you may have already found your only solution. RouterOS doesn't have any way (currently) of assigning multiple MAC addresses to a single interface. Nor can it create virtual interfaces on a physical interface. So the only real solution to have multiple IP's on one interface is static addressing.
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 3:25 am

You can assign multiple IP addresses to an interface, would work if you were looking at having multiple public IPs on the WAN interface.

Depending on what you are trying to achieve, you can assign additional IPs to virtual interfaces on the router itself, such as a bridge interface. It really depends on what you plan to do with the IPs to determine what is the more appropriate step to take.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 3:27 am

the OP was looking to have IP's assigned by DHCP to a single interface.
 
Revelation
Member
Member
Posts: 336
Joined: Fri Dec 25, 2015 5:59 am

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 3:29 am

That's not how I read it. He wrote that it currently is assigned via DHCP, but he wants to manually assign the IPs from his router. At least that is what I understood his intentions were.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10237
Joined: Mon Jun 08, 2015 12:09 pm

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 10:15 am

That's not how I read it. He wrote that it currently is assigned via DHCP, but he wants to manually assign the IPs from his router. At least that is what I understood his intentions were.
I agree with IntrusDave about that.
The only question one could ask is if the IP addresses on that ISP are static and if the use of DHCP is mandatory or only an option.
When the addresses are static and DHCP is optional, you can just statically set the addresses on the ethernet interface connected to the modem.
Of course that still leaves the issue of actually using those addresses via forwarding/translation rules, but that is for later.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 10:24 am

You can always just try it.. write down the currently assigned IPs, netmasks, and gateways. Disable the current DHCP clients, disconnect all but one interfaces connected to the modem, and assign the IPs as static to the WAN interface. You can test it by enabling one address at a time and seeing if traffic passes.
 
magchiel
Member Candidate
Member Candidate
Posts: 131
Joined: Mon Jan 06, 2014 2:13 pm

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 9:22 pm

I haven't tried this, but couldn't you use multiple DHCP clients on the same interface with different values for the CLIENT_MAC option?
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Sat Sep 10, 2016 9:26 pm

you can set a "clientID" for each DHCP client, but very few DHCP servers will accept that for anything more than a cosmetic name. DHCP servers respond to MAC addresses at layer 2.
 
AdaptiveGroup
just joined
Topic Author
Posts: 3
Joined: Tue Mar 03, 2015 11:05 pm

Re: One ISP Modem, multiple dynamic IP addresses

Mon Sep 12, 2016 9:01 pm

First of all, thank you all for your input, this thing is driving me crazy. Something seemingly so simple becoming uberly complicated, I don't even get how the ISP intended this thing to be used if the only solution ends up being to plug it into a switch.
the OP was looking to have IP's assigned by DHCP to a single interface.
That's not how I read it. He wrote that it currently is assigned via DHCP, but he wants to manually assign the IPs from his router. At least that is what I understood his intentions were.
What I want is for the router to know these IP addresses that the ISP is assigning us. I want to be able to use them in scripts, mangle, etc., like a normal IP address obtained through DHCP. I don't have any restrictions about the method itself, maybe some weird script changing the interface MAC, asking for an address, storing the pair and cycling until all addresses have been exhausted?

Regarding the use of different clientIDs, WinBox doesn't allow me to add more than one DHCP Client on an interface, not sure how to follow up on this, afaik there are no virtual interfaces that would allow me to do so.

Further clarification of the situation:
  • The ISP only works with dynamic addresses.
    The only way to obtain those addresses is through DHCP requests to their modem.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Mon Sep 12, 2016 9:43 pm

Unfortunately, your ISP has designed their system for use with multiple PC's, not a single router.

There is no way for you to change the MAC on the interface and request another IP, that's just not how ethernet works. The IP address is more for human use, not the network. The router and modem will communicate solely with MAC addresses. and there is no way for RouterOS on a RouterBoard to have more than one address on an interface. Unfortunately, as long as you are forced to use DHCP, you have no options for using a single interface on any MikroTik hardware. Or for just about ANY hardware router at all.

You really have 3 options..
1) Exactly what you have been doing - a switch with multiple interfaces connected to it. Not ideal in anyway at all - but functional.
2) Ask the ISP to assign static IP's so you can use one router. This shouldn't be a big issue for them. Unless you are being assigned private IP's - then it's pointless.
3) Move to an x86 box with VMWare or XenServer. By doing that, you can install a CHR (cloud hosted router) and give it as many virtual interfaces as you want. Each will have a different MAC address, and each can have a dhcp client running.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: One ISP Modem, multiple dynamic IP addresses

Mon Sep 12, 2016 10:28 pm

4) Be the first person brave enough to use VRRP hack in production. It's not pretty, but it seems to work.

But the right way is definitely option 2. ISP should give you static addresses. Preferably routed subnet, to give you maximum freedom in how you can use them.
 
IntrusDave
Forum Guru
Forum Guru
Posts: 1286
Joined: Fri May 09, 2014 4:36 am
Location: Rancho Cucamonga, CA

Re: One ISP Modem, multiple dynamic IP addresses

Mon Sep 12, 2016 10:49 pm

Interesting idea. That may well work for you. I'd be afraid that it may stop working with an update.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: One ISP Modem, multiple dynamic IP addresses

Mon Sep 12, 2016 11:42 pm

That makes two of us. I'd generally not recommend it, but a person willing to use "some weird script changing the interface MAC, asking for an address, storing the pair and cycling until all addresses have been exhausted" might give it a go. :)
 
AdaptiveGroup
just joined
Topic Author
Posts: 3
Joined: Tue Mar 03, 2015 11:05 pm

Re: One ISP Modem, multiple dynamic IP addresses

Tue Sep 13, 2016 9:34 pm

4) Be the first person brave enough to use VRRP hack in production. It's not pretty, but it seems to work.
But the right way is definitely option 2. ISP should give you static addresses. Preferably routed subnet, to give you maximum freedom in how you can use them.
Interesting. I didn't find that thread when searching the forums, will investigate further. Most of the ISPs available in my country offer only dynamic addresses. Static addresses are quite expensive, and most of them don't even offer these outside the capital.
That makes two of us.k I'd generally not recommend it, but a person willing to use "some weird script changing the interface MAC, asking for an address, storing the pair and cycling until all addresses have been exhausted" might give it a go. :)
Yup, that definitely sounds like something I'd do. I'll delve into this possible solution then.

Thank you all for your help!

Edit: The proposed solution indeed works as intended and was easy to setup. I'll do some research on the subject to better understand possible side effects and implications of using it.

Edit #2: One year later, still working in v6.40.3.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], pe1chl, stef70, Techsystem and 122 guests