Upgrade to Router OS7 routes are mess up

Upgrade to Router OS7 broke a few things Firewall rules, routes and L2TP.
I fix the L2TP Tunnel.

I have Phone that are on 172.16.19.0/24 and computers are on 192.168.2.0/24

The computers are going thought the L2TP which is right. But the Phones are going thought there to.
The Phone should be going right to the internet not thought the L2TP tunnel. How do I get the Phone to go right to the internet?

bridge1 192.168.2.1 (bridge1 has ether2, 4 and 5)

Ether3 172.16.19.1/24

All help is appreciated.
routes.JPG

To make devices in one subnet use one WAN, and devices in another subnet use another WAN, routes alone are not sufficient - you must use VRF (if feasible) or policy routing, i.e. multiple routing tables and, in case of policy routing, routing rules or firewall mangle rules matching on source address and telling the packets which routing table to use.

So if it worked before upgrade to RouterOS 7 and now it doesn’t, some part of that configuration must have not been converted properly, or, as has been reported multiple times here, part of the configuration got lost on reboot.

Can’t say more without seeing the full export of the config (see my automatic signature below, hide-sensitive must not be used as it is the default in ROS 7 that can be overridden by show-sensitive - not required here).

@ sindy

Well I have read some other post that there VRF are not working after upgrading to OS7 and cant getting them working again. So what would you do to route phones to the wan with out using VRF unless you think you can get VRF working again?

I’m not opposed to using VRF.


http://forum.mikrotik.com/t/vrf-traffic-isolation/150609/6

http://forum.mikrotik.com/t/ros-7-vrf-ppp-l2tp-sstp-servers/155564/1

As someone has pointed out in the first thread you’ve linked, VRF in Mikrotik is just another way of assigning the routing mark (routing table name) - you define each virtual router by a list of interfaces that belong to it and the routing table name. What RouterOS does is that it assigns the routing table name to use to a packet as soon as it enters it via an interface (and if you attach an IP subnet to an interface, the route to that connected subnet is automatically added to the corresponding routing table).

As this apparently doesn’t work in ROS 7, you have to assign the routing marks some other way. The simplest one is to use routing rules:

/routing/rule
add src-address=172.16.19.0/24 action=lookup-only-in-table table=via-ether1
add src-address=192.168.2.0/24 action=lookup-only-in-table table=via-l2tp

and, of course, you have to add the corresponding routing tables, each containing only a single default route via the correct gateway.

I had an impression that you had it working in ROS 6 and it got broken by the upgrade. So the easiest way to me seemed to be to fix what has already been there, but now it seems as if you are starting from scratch?

I was working on its own. I did not have to set any routing rules or VRF. It just worked. The stuff that we wanted to go out to the wan did and the stuff that we wanted to go to the L2TP tunnel did. We just added it to the route list. The only things I can think of is. This is on the L2TP Server side.

 /ppp secret
add caller-id=xxx.xxx.xxx.xxx local-address=192.168.1.1 name=xxx remote-address=192.168.2.1 routes="10.11.0.0/24  192.168.2.1 1" service=l2tp

Maybe I’ve misunderstood the requirement. My understanding was that the computers and phones are connected to a different LAN subnet of the router each, and you want each group to use a different “WAN” of the router (one of the WANs actually being an L2TP tunnel) to get to the internet.

If you had in mind that the PCs and the phone were L2TP clients, and you want the phone to access only the LAN subnets of the router via L2TP but get to internet directly, not via the tunnel and the router, I don’t know any mechanism allowing that in ROSv6 with L2TP on a phone, so I don’t get how that could be working before unless controlled by a setting at the phone client.

Sorry I should have explained better.

So we have 1 HQ and 2 site or offices if you want to think of it that way
Both site connect to HQ using Mikrotik Routers (RB750G r2) so the tunnels are established using the routers.
The phones are IP phones using VOIP.
Before we upgrading site1 The IP phone were going out right to the wan port. But after the upgrade now everything is going thought the L2TP tunnel witch would be fine if the internet was more reliable.

I had to put this in on the HQ Router to get the phone to work since they want to go through the tunnel
/ip route
add comment=“Site1 Phones” disabled=no distance=1 dst-address=172.16.19.0/24 gateway=192.168.2.1 pref-src=“” routing-table=main scope=30 suppress-hw-offload=no target-scope=10


HQ config

/interface bridge
add arp=reply-only comment="created from master port" name=bridge1 protocol-mode=none
/interface ethernet
set [ find default-name=ether1 ] name=ether1-gateway
set [ find default-name=ether2 ] arp=reply-only name=ether2-master-local
set [ find default-name=ether3 ] arp=reply-only
set [ find default-name=ether4 ] arp=reply-only
/interface l2tp-server
add name=l2tp-Site2 user=xxxxxx
add name=l2tp-in1-Site1 user=xxxxxx
/interface vlan
add arp=reply-only comment="Emp Network" interface=bridge1 name="Emp Network Vlan6" vlan-id=6
add comment="For Guest Wireless" interface=bridge1 name=vlan2 vlan-id=2
/interface list
add name=WAN
add name=LAN
add name=Test1
add comment="VPN List" name="L2TP List"
/ip dhcp-server
add add-arp=yes allow-dual-stack-queue=no interface="Emp Network Vlan6" lease-time=8h name="Emp Network Server"
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=xxxxxxx enc-algorithms=xxxxxxxxx
/ip pool
add name=Vlan2 ranges=10.10.0.3-10.10.0.254
add name="Emp Network Pool" ranges=10.11.0.5-10.11.0.154
/ip dhcp-server
add add-arp=yes address-pool=Vlan2 allow-dual-stack-queue=no authoritative=after-10sec-delay interface=vlan2 lease-time=8h name="Guest Wireless Network"
/ppp profile
set *0 use-compression=yes use-encryption=required
/routing bgp template
set default as=65530 disabled=no name=default output.network=bgp-networks
/routing ospf instance
add name=default-v2
/routing ospf area
add disabled=yes instance=default-v2 name=backbone-v2
/interface bridge port
add bridge=bridge1 ingress-filtering=no interface=ether2-master-local
add bridge=bridge1 ingress-filtering=no interface=ether3
add bridge=bridge1 ingress-filtering=no interface=ether4
add bridge=bridge1 ingress-filtering=no interface=ether5
/interface bridge settings
set use-ip-firewall=yes use-ip-firewall-for-vlan=yes
/ip settings
set max-neighbor-entries=8192 tcp-syncookies=yes
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface l2tp-server server
set authentication=xxxxxx default-profile=default enabled=yes keepalive-timeout=60 one-session-per-host=yes use-ipsec=required
/interface list member
add interface=ether1-gateway list=WAN
add interface=bridge1 list=LAN
add comment="Site1 Link" interface=l2tp-in1-Site1 list="L2TP List"
add comment="Site2 Link" interface=l2tp-Site2 list="L2TP List"
/ip address
add address=192.168.1.1/24 interface=ether2-master-local network=192.168.1.0
add address=10.10.0.1/24 comment="Guest Network" interface=vlan2 network=10.10.0.0
add address=HQ Public IP comment=WAN interface=ether1-gateway network=HQ Public IP
add address=10.11.0.1/24 comment="Emp Network" interface="Emp Network Vlan6" network=10.11.0.0
/ip arp
add address=192.168.1.4 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.1.6 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.1.11 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.1.12 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.1.13 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.1.14 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
/ip dhcp-relay
add dhcp-server=192.168.1.6 disabled=no interface=ether2-master-local local-address=192.168.1.1
add dhcp-server=192.168.1.1 disabled=no interface=vlan2 local-address=10.10.0.1 name="Guest Wireelss relay"
add dhcp-server=192.168.1.1 interface="Emp Network Vlan6" local-address=10.11.0.1 name="Emp Network"
/ip dhcp-server lease
add address=10.11.0.252 mac-address=xx:xx:xx:xx:xx:xx server="Emp Network Server"
add address=10.11.0.253 mac-address=xx:xx:xx:xx:xx:xx server="Emp Network Server"
add address=10.11.0.254 mac-address=xx:xx:xx:xx:xx:xx server="Emp Network Server"
/ip dhcp-server network
add address=10.10.0.0/24 comment="Guest Network" dns-server=10.11.0.145 gateway=10.10.0.1 netmask=24
add address=10.11.0.0/24 comment="Emp Network" dns-server=10.11.0.145 gateway=10.11.0.1 netmask=24
/ip dns
set servers=9.9.9.9,1.1.1.1
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=HQ Public IP
add comment="Site1" disabled=no distance=1 dst-address=192.168.2.0/24 gateway=192.168.2.1 pref-src=0.0.0.0 routing-table=main scope=255 suppress-hw-offload=no target-scope=10
add comment="Site2" disabled=no dst-address=192.168.3.0/24 gateway=192.168.3.1 scope=255
add comment="Site1 Emp network" disabled=no distance=1 dst-address=10.11.2.0/24 gateway=192.168.2.1 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add comment="Site1 Phones" disabled=no distance=1 dst-address=172.16.19.0/24 gateway=192.168.2.1 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
/ppp secret
add caller-id=Site2 Public IP local-address=192.168.1.1 name=Site2 remote-address=192.168.3.1 routes="192.168.3.1 1" service=l2tp
add caller-id=Site1 Public IP local-address=192.168.1.1 name=Site1 remote-address=192.168.2.1 routes="192.168.2.1 1" service=l2tp
/system logging
add topics=l2tp
add topics=ipsec
add topics=firewall
add topics=system
/system package update
set channel=long-term
/tool mac-server
set allowed-interface-list=none
/tool mac-server ping
set enabled=no

Site1

/interface bridge
add admin-mac=xx:xx:xx:xx:xx:xx arp=reply-only auto-mac=no comment="created from master port" name=bridge1 protocol-mode=none
/interface ethernet
set [ find default-name=ether1 ] mac-address=xx:xx:xx:xx:xx:xx name=ether1-gateway speed=100Mbps
set [ find default-name=ether2 ] arp=reply-only name=ether2-master speed=100Mbps
set [ find default-name=ether4 ] disabled=yes speed=100Mbps
set [ find default-name=ether5 ] disabled=yes speed=100Mbps
/interface vlan
add comment="For Guest Wireless" interface=bridge1 name=vlan2 vlan-id=2
add arp=reply-only comment="Employee Network" interface=bridge1 name=vlan6 vlan-id=6
/interface list
add exclude=dynamic name=discover
add name=WAN
add name=LAN
/ip dhcp-server
add add-arp=yes allow-dual-stack-queue=no interface=vlan6 lease-time=8h name="Employee Network"
/ip pool
add comment="Guest ip pool" name=Vlan2 ranges=10.10.2.2-10.10.2.254
add comment="Employee Network ip pool" name="Employee Network" ranges=10.11.2.6-10.11.2.254
/ip dhcp-server
add add-arp=yes address-pool=Vlan2 allow-dual-stack-queue=no authoritative=after-2sec-delay interface=vlan2 lease-time=5m name="Guest Network"
/ppp profile
set *0 use-compression=yes use-encryption=required
/interface l2tp-client
add add-default-route=yes comment="Site1" connect-to=HQ Public IP disabled=no max-mru=1460 max-mtu=1460 name=l2tp-out1 profile=default use-ipsec=yes user=xxxxxx
/routing bgp template
set default as=65530 disabled=no name=default output.network=bgp-networks
/routing ospf instance
add name=default-v2
/routing ospf area
add disabled=yes instance=default-v2 name=backbone-v2
/interface bridge port
add bridge=bridge1 ingress-filtering=no interface=ether4
add bridge=bridge1 ingress-filtering=no interface=ether5
add bridge=bridge1 ingress-filtering=no interface=ether2-master
/ipv6 settings
set disable-ipv6=yes max-neighbor-entries=8192
/interface list member
add interface=bridge1 list=discover
add interface=ether3 list=discover
add interface=ether4 list=discover
add interface=ether5 list=discover
add interface=l2tp-out1 list=discover
add interface=vlan2 list=discover
add interface=bridge1 list=mactel
add interface=bridge1 list=mac-winbox
add interface=ether1-gateway list=WAN
add interface=bridge1 list=LAN
/ip address
add address=192.168.2.1/24 interface=bridge1 network=192.168.2.0
add address=Site1 Public IP comment=Wan interface=ether1-gateway network=Site1 Public IP
add address=10.10.2.1/24 comment="guest network" interface=vlan2 network=10.10.2.0
add address=172.16.19.1/24 comment=Phones interface=ether3 network=172.16.19.0
add address=10.11.2.1/24 comment="Employee Network" interface=vlan6 network=10.11.2.0
/ip arp
add address=192.168.2.11 comment="Laptop1" interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.2.142 comment=PPR1 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.2.143 comment=PPR2 interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=192.168.2.12 comment="Laptop2" interface=bridge1 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.186 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.187 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.189 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.190 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.191 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.192 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.193 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.194 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.195 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.196 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.197 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
add address=172.16.19.198 interface=ether3 mac-address=xx:xx:xx:xx:xx:xx
/ip dhcp-relay
add dhcp-server=192.168.1.6 disabled=no interface=bridge1 local-address=192.168.2.1 name="DHCP Relay"
/ip dhcp-server lease
add address=10.11.2.9 allow-dual-stack-queue=no mac-address=xx:xx:xx:xx:xx:xx server="Employee Network"
add address=10.11.2.10 allow-dual-stack-queue=no mac-address=xx:xx:xx:xx:xx:xx server="Employee Network"
/ip dhcp-server network
add address=10.10.2.0/24 comment="Guest network" dns-server=10.11.0.145 gateway=10.10.2.1 netmask=24
add address=10.11.2.0/24 comment="Employee Network" dns-server=10.11.0.145 gateway=10.11.2.1 netmask=24
/ip dns
set servers=9.9.9.9,1.1.1.1
/ip route
add disabled=no dst-address=0.0.0.0/0 gateway=Site1 Public IP
add comment="TO HQ" disabled=no dst-address=192.168.1.0/24 gateway=192.168.1.1 scope=255
add comment="To other offices" disabled=yes distance=1 dst-address=192.168.0.0/24 gateway=192.168.1.1 pref-src="" routing-table=main scope=255 suppress-hw-offload=no target-scope=10
add comment="To DNS 10.11.0.145" disabled=no dst-address=10.11.0.0/24 gateway=l2tp-out1
/system identity
set name=Site1
/system logging
add topics=dns
add topics=l2tp
add topics=ipsec
add topics=firewall
add topics=dhcp
add topics=system
/system package update
set channel=long-term
/tool mac-server
set allowed-interface-list=none
/tool mac-server mac-winbox
set allowed-interface-list=mac-winbox
/tool mac-server ping
set enabled=no

L2TP Layout.jpg

So it turns out I did get it right initially after all, i.e. that the OP describes the requirements on Site 1 and/or Site 2 where the intention is that the phones use the local gateway to get to the internet whereas the computers either do not get to internet at all or use the HQ’s internet connection?

But then this may be the key question - are the computers supposed to get to internet at all, or can they talk only to the HQ (and maybe use a http proxy there to get further to the internet)?

Because if a computer should ping an address in the internet via L2TP, but a phone should ping the same address in the internet directly via a WAN gateway, there is no other way than to use two distinct routing tables and some rules that determine which of the routing tables to use based on something else than the destination address alone - in particular, in-interface or src-address.

So I can ony imagine it worked before by mere routes in a single routing table (i.e. with no need for routing marks) if the default route was via the WAN gateway, and routes to all private ranges were via L2TP, whilst the phones didn’t need to talk to private ranges whereas the computers didn’t need to talk directly to internet.

Could it be that simple?

If so, the only thing you need is to set add-default-route to no in the /interface l2tp-client row, so that it would stop adding a default route via itself. Which probably was like that in 6.x, and the configuration conversion might have broken it.

@sindy

whereas the computers either do not get to internet at all or use the HQ’s internet connection?

And yes the computer to get internet and use HQ internet connection.

And the computers can ping each other via L2TP.

I will try to go to those site tomorrow and set the default route to no. Just in case it breaks and I can turn it back on.
I will let you know what happens.

@Sindy

set add-default-route to no in the /interface l2tp-client row

That fix it.
Thanks your help. :smiley: :smiley: :smiley: