Page 1 of 1

Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 2:47 pm
by ega2002
Hi, guys, this is my first post in this forum. I'm quite new to ROS, so I need your advice.
My RB is connected to the provider via managed switch (see scheme below), I also have STB for IPTV, IPoE is used to connect RB to Internet. So, when I physically attach the prov's cable, my RB, STP and the switch get the IP addresses via DHCP. In this state I can manage my switch and STB from the computer PC1 behind the RB with no problem. But, when I get through WEB authorization to connect to Internet, WAN gets another IP address in different subnet, so I loose the ability to manage my other devices.
Of course, I can manually assign to WAN the second IP address from the first subnet, but it is static, and I have to check if it is not occupied every time before doing this. I'm afraid to let it assigned all the time because of possible conflicts with provider's DHCP server.
Can you guys suggest any simple solution how to get another DHCP address for WAN (maybe some kind of virtual interface or so). Any other idea how to manage my devices are also welcome. I hope I clearly described my problem (English is not my native language). Thank you.
my_net.png

Re: Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 4:49 pm
by haik01
Why not put the STB tot he LAN side of Mikrotik. Same as you did with the PC? I assume there is a DHCP server on the Mikrotik which hands out local IP addresses to you PC and other devices.

Re: Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 8:40 pm
by ega2002
haik01,
yes, moving STB to LAN could be a solution, but I don't want to waste the RB's resources for routing IPTV traffic. Another reason is, that there likely will be another neighboring RB (with its own Internet account), which is planned to be connected to the same switch. So, the problem of managing this switch from behind the RB still remains.
Anyway, thank you for answering.

Re: Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 8:56 pm
by sup5
Actually this is possible.


example:
1) create a new bridge1
2) add ether1 (WAN) to bridge1
3) change the admin-mac of bridge1 to a different mac-address than ether1
4) add two ip-dhcp-clients, one each on ether1 and bridge1
that's it.

Re: Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 10:11 pm
by jarda
That is not it at all. Mikrotik doesn't support multiple dhcp clients on one interface. By making ether1 to be a bridge member you are disconnecting ether1 from cpu and putting there the bridge instead. So you have still only one interface. But you can do another thing. You can connect the stb or other devices to the wan bridge and let them use their dhcp clients to obtain ip config on their own from the isp...

Re: Two DHCP addresses for WAN possible?

Posted: Thu Oct 06, 2016 11:37 pm
by ega2002
You can connect the stb or other devices to the wan bridge and let them use their dhcp clients to obtain ip config on their own from the isp...
That was one of the first things I've thought about. But, if the other devices get their IPs from the provider, they will still be from the subnet, different from that of WAN bridge (if RB is connected to Internet via IPoE). So they are inaccessible from the RB itself and PC1 behind RB. Please correct me if I'm not right.
The other idea was to separately connect to the switch one more interface, e.g. ether2, not bridged with any other interface in the RB, and let it get the IP from ISP (like two WAN interfaces configuration). In this case the RB will be able to communicate with all other devices connected to the switch because they will be in the same subnet. But the switch is rather far from RB and to put another cable is not so convenient for me. I hoped that this could be done with some kind of virtual ethernet interface or something.
If there are no other ideas, I will prefer to stay with temporary second static IP for WAN, whenever I want to manage the switch.

Re: Two DHCP addresses for WAN possible?

Posted: Fri Oct 07, 2016 12:49 am
by sup5
as a last way one could setup a metarouter with a least three interfaces.
these three interfaces needs to be bridged within the metarouter.

then one can use the metarouter as virtual cable/switch. this will remove the need for an external switch.

I've tried this before. it works.

Re: Two DHCP addresses for WAN possible?

Posted: Fri Oct 07, 2016 7:45 am
by cutedrummerboy
I have some similar situation.
i manage couple of managed switch at my routers wan side. so what I did, assign each switch a management vlan with dhcp client, change their port type as necessary with trunk or access or hybrid. then create the same vlan at mikrotiks wan interface without bridge and assign a new subnet with dhcp server. that's it, so easy.
because of direct connection that subnet will be automatically reachable from your lan without any special route.

Re: Two DHCP addresses for WAN possible?

Posted: Fri Oct 07, 2016 11:16 am
by ega2002
so what I did, assign each switch a management vlan with dhcp client, change their port type as necessary with trunk or access or hybrid. then create the same vlan at mikrotiks wan interface without bridge and assign a new subnet with dhcp server. that's it, so easy.
Hmm, looks very attractive... Thank you, cutedrummerboy, I have to dig in this direction. I'm quite new to VLANs, it would be great if you post your RB VLAN config, so I can use it as an example.

Re: Two DHCP addresses for WAN possible?

Posted: Sat Oct 08, 2016 11:41 am
by ega2002
Unfortunately, my switch can have only one IP address (no separate DHCP for VLANs). So, I must look for another solution.

Re: Two DHCP addresses for WAN possible?

Posted: Sun Oct 09, 2016 2:33 am
by Sob
By making ether1 to be a bridge member you are disconnecting ether1 from cpu and putting there the bridge instead. So you have still only one interface.
It used to work, but not any more (tested with latest RC). Well, it was indeed sort of bug. But the original vrrp hack still works. Although it might stop working too one day, because it doesn't look less bug-like by too much.