Mikrotik + Movistar Fusión Empresas

Hello everyone.
First of all, I’m a noob at networking. I’m an electrician and I’ve been forced to take care of the company network because our technician recenly got corona, so I’m sorry if I can’t understand you perfectly or I make a mistake trying to explain my case.

Recently in my workplace we changed to Movistar Fusión Empresas (I’m from Spain). Before that, we worked with a ONT + Mikrotik (RB750GL) and a static IP. Now the internet provider installed a new ONT, a Teldat and a Switch and changed the Static IP (for example: 54.87.19.52). The structure stay as follows: ONT - Teldat - Switch Movistar - Mikrotik - Local network. When I plug in the MikroTik to the switch we don’t have connection. I’ve tried to factory reset the device (we have backups saved), changing the vlan 3/6 to 20/21 (data and VoIP) and trying several ports, but I cannot make it work.

Mikrotik’s configuration:
WAN 192.168.100.0
LAN 192.168.10.0

Again, I’m sorry if I missed any crucial information. I didn’t study networking, I just have to deal with my boss decisions.
miktik.png

Since no one familiar with Movistar’s habits seems to wander around, let me ask you a question, because to debug a blackbox is not easy even for a network specialist, leaving aside regular users.

Should the static public IP be used to access some server in your premises remotely (web server, VPN connection, anything where you set up the public IP of your connection to a web browser or anything else on a remote PC or mobile)?

You should have put VLAN 20 at the ethernet port connected to the switch and the PPPoE connects to VLAN 20. Is the Teldat/switch in bridge mode then you can use PPPoE and if not you let the stuff from Moviestar do the work.

I assume that VOIP is handled by the Teldat/Moviestar switch itself.

Yes, we have a VPN for some employees and a Exchange server too. We have the outsorced DNS and we will change it to the new public IP after we get conection.

OK. In that case:

  • configure one of the VPN clients to connect to the new public IP (rather than to the domain name if set like that),
  • open a command line window to the Mikrotik (ssh, [Terminal] button in Winbox/WebFig) and make it as wide as your screen allows
  • run /tool sniffer quick interface=ether1 in that window (if you know the IP address of the client, add ip-address=ip.of.that.client to the command)
  • let the client (which must not be on your LAN) attempt to connect

You should see either the IP packets carrying the VPN initial request trying to reach your device, or ARP packets trying to determine some IP address, or nothing at all.
If only ARP requests are coming, you should see the VLAN ID which is used for internet connection (I don’t expect VoIP traffic to be arriving spontaneously, except if you have a specifically configured PBX). If nothing is coming at all, the forwarding of traffic which arrives to the public IP further to the private WAN IP of the Mikrotik is not configured on the Movistar gear.

So post the result of this test and your configuration export in anonymized text form, following the hint in my automatic signature right below.

I am familiar with the configuration. The problem is that the movistar fiber uses VLANs after the ONT. If your previous configuration is as you said (ONT<->Mikrotik) the configuration of the Mikrotik is using VLANs and it gets the public ip directly. If now you have a new hardware interconnections the Teldat removes the VLAN tags, gets the IP and does NAT. The configuration for the Mikrotik has to be different unless you remove Teldat+Switch Movistar.

If the “Switch Movistar” (I don’t know what this is) is just a switch, you might have a working configuration by setting up ONT<->Mikrotik<->Switch using the same ethernet (probably 1) that was used before.

I don’t think the Teldat is in bridge mode. When I plug in a laptop directly to the Movistar’ Switch I get the address 192.168.1.X, so it must be in router mode.

So what happens if you attach a DHCP client directly (no /interface vlan in between) to Mikrotik’s ether1 rather than a fixed address? Does it get a dynamic one too?

First of all, thank you all for your help.
Sadly I can’t try your solutions untill tomorrow (I have my own work as electrician and the company doesn’t stop until 22:00). The only moment I can touch the network without being yelled is at lunch break. Tomorrow I’ll tell you, every idea is welcomed.

Clarification: while the new configuration is fixed, Movistar kept the old ONT still running so we don’t loose functionality. When everyone stops working I go to the comunications room, plug the Mikrotik to the Teldat and the new ONT, and try to solve the puzzle.

My guess would be that if you disconnect/unplug the Teldat router and connect straight away the ONT to port 1 of the Mikrotik (which is how I guess things were installed before), things will work:

  • mikrotik will get the public IP address
  • internet will work
  • if you plug the switch to any of the remaining ports of the mikrotik, all the network will work.

This is assuming that before the connection was as you reported, and that the Movistar person only changed a standard consumer fiber by a enterprise fiber, no extra config.

INTERFACE TIME NUM DI SRC-MAC DST-MAC VLAN SRC-ADDRESS
ether1-gateway 3.74 12 ← 94:24:E3:3H:2J:FE 01:80:C2:00:00:00
ether1-gateway 3.782 13 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 3.907 14 ← 94:24:E3:3H:2J:FE 00:54:ER:00:70:04
ether1-gateway 4.053 15 ← 00:G0:24:D4:8R:3R FF:FF:FF:FF:FF:FF 741.258.963.159: who has 741.258.963.159
ether1-gateway 4.824 16 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 5.74 17 ← 94:24:E3:3H:2J:FE 01:80:C2:00:00:00
ether1-gateway 5.905 18 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 6.741 19 ← 94:24:E3:3H:2J:FE 01:80:C2:00:00:0U
ether1-gateway 6.837 20 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 7.74 21 ← 94:24:E3:3H:2J:FE 01:80:C2:00:00:00
ether1-gateway 7.78 22 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 8.811 23 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6
ether1-gateway 8.929 24 ← 00:G0:24:D4:8R:3R FF:FF:FF:FF:FF:FF 741.258.963.159: who has 741.258.963.159
ether1-gateway 9.26 25 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 3 0.0.0.0:xx (bootpc)
ether1-gateway 9.74 26 ← 94:24:E3:3H:2J:FE 01:80:C2:00:00:00
ether1-gateway 9.773 27 → 7D:6T:Y6:GF:8W:1G FF:FF:FF:FF:FF:FF 6

741.258.963.159 is my WAN

I did what you said: I connected the Mikrotik directly to the new ONT, but nothing changed. Probably the Teldat has some new configuration and Movistar disabled the ONT so I’m forced to use the Teldat.

You were quite aggressive with the obfuscation, can you double-check in the original data that in the “741.258.963.159: who has 741.258.963.159”, both addresses are really the same? I would expect their last byte to differ, which would mean that it is the modem/router (the gateway) asking for the translation of the IP address of your WAN to its MAC address so that it could deliver the actual packet to it. Can you confirm?

Second, to speed things up, is that address the new public one or it is one of (10.x.x.x, 172.16-31.x.x, 192.168.x.x, 100.64-127.x.x)?

Sorry for the aggressiveness. Yes, the last byte differ, my mistake.

The address begins with 217.x.x.x. The technician told me that I must change the MikroTik’s WAN to that addres so their firewall works. I think it’s a GRE tunnel inside the Teldat.

I doubt that you are forced to use the Movistar router, their fiber is quite standard through Spain. But without knowing the current configuration of your router it is difficult to know what is failing/missing. I expected that the Mikrotik had the right config to work without the router, but it doesn’t look so

Movistar uses vlans for its configuration, so adding something like the following to a default config of mikrotik, (removing ether1 from the WAN list and the dhcp-client on it is not even needed) should be close to enough to make it work without the teldat router, ethernet cable from ether1 straight to the ONT ether.

/interface vlan
add comment="VLAN PPPoE Movistar" interface=ether1 name=vlan6-movistar vlan-id=6
/interface pppoe-client
add add-default-route=yes comment="PPPoE Movistar" disabled=no interface=vlan6-movistar name=pppoe-out1 password=adslppp \
    use-peer-dns=yes user=adslppp@telefonicanetpa
/interface list member
add interface=pppoe-out1 list=WAN

Note the passwords are the same for every customer, they authenticate using the fiber circuit.

On the other hand, a default Mikrotik configuration should work “through” the teldat router straight out of the box. ( any teldat ethernet port to ether1)

If you have an export of the whole config it might be simpler to start with either a VLAN configuration that works without the Teldat router or a NATted dhcp-client configuration that works through the Teldat router, and then add the specifics of your mikrotik configuration on top of it (VPN, etc).

We will learn that in the next round. To get there, you have to assign the 217.x.x.x address to the uplink interface of the Mikrotik directly*) (no VLAN, because no VLAN is indicated in the sniff output for the ARP packets), so that the Mikrotik would respond to the ARP and get some IP packet. And from there, we will see whether it is a GRE one or a direct UDP one, attempting to establish the VPN connection. But as it is a public IP, my guess is that it will be direct IP and you’ll have the public IP directly on the Mikrotik itself, making some things easier.

I intentionally ignore the VoIP part for now.

What would make the whole process faster would be if you could use some other Mikrotik (a hAP lite for €20 would be sufficient) to allow debugging the new setup outside lunch time. A virtualized CHR for € 0,- would do as well but I guess it might be even further outside your scope.

*) before doing that, I’d strongly recommend to post the export of your configuration - even though Movistar mentions their firewall, I’d prefer to verify that there are decent firewall rules in your 'Tik.

Here is the config file. This is the configuration of the Mikrotik when we have connection with the old ONT. No changes made.

/interface ethernet
set 0 name=ether1-gateway
set 1 name=ether2-master-local
set 2 master-port=ether2-master-local name=ether3-slave-local
set 3 master-port=ether2-master-local name=ether4-slave-local
set 4 master-port=ether2-master-local name=ether5-slave-local
/interface vlan
add interface=ether1-gateway name=vlan3 vlan-id=3
add interface=ether1-gateway name=vlan6 vlan-id=6
/interface pppoe-client
add add-default-route=yes allow=pap,chap disabled=no interface=vlan6
max-mru=1492 max-mtu=1492 name=pppoe-out1 password=adslppp
use-peer-dns=yes user=adslppp@telefonicanetpa
/ip pool
add name=dhcp ranges=192.168.10.101-192.168.10.199
add name=vpn ranges=192.168.3.10-192.168.3.20
/ip dhcp-server
add address-pool=dhcp disabled=no interface=ether2-master-local name=dhcp1
/ppp profile
set 1 dns-server=192.168.3.250 local-address=192.168.3.250 remote-address=vpn
/interface pptp-server server
set authentication=mschap2 enabled=yes
/ip address
add address=192.168.10.1/24 interface=ether2-master-local
add address=192.168.100.10/24 interface=ether1-gateway
/ip dhcp-client
add add-default-route=no disabled=no interface=vlan3 use-peer-ntp=no
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=192.168.10.1 gateway=192.168.10.1
netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.10.1 name=router
/ip firewall filter
add chain=input comment=“default configuration” protocol=icmp
add chain=input comment=“default configuration” connection-state=established
add chain=input comment=“default configuration” connection-state=related
add chain=input disabled=yes dst-port=23,80 in-interface=pppoe-out1 protocol=
tcp
add chain=input dst-port=8291 in-interface=pppoe-out1 protocol=tcp
add chain=input dst-port=1723 in-interface=pppoe-out1 protocol=tcp
add action=drop chain=input comment=“default configuration” in-interface=
pppoe-out1
add chain=forward comment=“default configuration” connection-state=
established
add chain=forward comment=“default configuration” connection-state=related
add action=drop chain=forward comment=“default configuration”
connection-state=invalid
/ip firewall mangle
add action=set-priority chain=postrouting new-priority=4 out-interface=vlan3
add action=set-priority chain=postrouting new-priority=1 out-interface=
pppoe-out1
/ip firewall nat
add action=masquerade chain=srcnat comment=“default configuration”
out-interface=pppoe-out1
add action=masquerade chain=srcnat comment=“default configuration”
out-interface=ether1-gateway
add action=masquerade chain=srcnat comment=“default configuration”
out-interface=vlan3
add action=dst-nat chain=dstnat disabled=yes dst-port=80 in-interface=
pppoe-out1 protocol=tcp to-addresses=192.168.10.125
add action=dst-nat chain=dstnat disabled=yes dst-port=21 in-interface=
pppoe-out1 protocol=tcp to-addresses=192.168.10.125
/ip route
add distance=255 gateway=255.255.255.255
/ip upnp
set enabled=yes
/ip upnp interfaces
add interface=ether2-master-local type=internal
add interface=pppoe-out1 type=external
/routing rip interface
add interface=vlan3 passive=yes receive=v2
/routing rip network
add network=10.0.0.0/8
/system clock
set time-zone-name=Europe/Madrid

The configuration doesn’t seem to fit to the description you gave before, especially because I can see no traces of this device itself acting as a VPN server. But that’s for later.

Can you tell me the RouterOS version there? It seems to me it is way outdated (older than 6.41). Also the Winbox port open for access via WAN (so to anyone in the internet) along with a historical version of RouterOS makes me cry. The router may easily have been squatted in by some malware years ago.

But I mainly ask about the version as I’d like to suggest a script which would modify the firewall so that it would still work in the old condiguration but at the same time with the new one depending on where it would be connected, but if the RouterOS is too old, it might not support some things. We may come back to the security issues later, but they need to be addressed.

To me the old config is over a bridge.

add address=192.168.100.10/24 interface=ether1-gateway

Is that IP matching the new configuration?

Try 192.168.1.10 if it is free and also change the VLAN 6 to 20 and 3 to21.

This configuration contains the fragment I told you to connect to vlan6:

/interface vlan
add interface=ether1-gateway name=vlan3 vlan-id=3
add interface=ether1-gateway name=vlan6 vlan-id=6
/interface pppoe-client
add add-default-route=yes allow=pap,chap disabled=no interface=vlan6 \
    max-mru=1492 max-mtu=1492 name=pppoe-out1 password=adslppp \
	use-peer-dns=yes user=adslppp@telefonicanetpa

pppoe-out1 will get the public IPv4 from there

It also has the vlan3 (VoIP) configuration and a pptp vpn definition.

Now, unless your Movistar connection is fairly strange, your router should work straight away without the teldat, connected ONT<->ether1, and offer internet in ether2…ether5.