Community discussions

MikroTik App
thylacine26
刚刚加入了
Topic Author
Posts: 2
Joined: Sat Feb 03, 2018 10:47 pm

IPSEC Tunnel slow as death

Sat Feb 03, 2018 10:56 pm

Hey all:

I just setup an ipsec site to site tunnel and my connection is super slow. I have a 1Gbps fiber optic connection between point a and b. I think I have messed up in NAT someplace. Any guidance would be helpful

[admin@upgraydd] > export

# feb/03/2018 15:43:45 by RouterOS 6.41

# software id = 3KM6-4ZMC

#

# model = RouterBOARD 962UiGS-5HacT2HnT

# serial number = 6F15074A5DC9

/interface bridge

add admin-mac=64:D1:54:A7:BF:3B auto-mac=no comment=defconf name=bridge

/interface ethernet

set [ find default-name=ether2 ] name=ether2-master

/interface wireless

set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=nancy wireless-protocol=802.11

set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-Ceee disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=nancy wireless-protocol=802.11

/interface list

add exclude=dynamic name=discover

add name=mactel

add name=mac-winbox

add name=WAN

/接口无线安全性配置文件

set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=dynamic-keys supplicant-identity=MikroTik ************************************

/ip hotspot profile

set [ find default=yes ] html-directory=flash/hotspot

/ip ipsec proposal

set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc pfs-group=modp2048

/ip pool

add name=dhcp ranges=172.16.10.20-172.16.10.254

/ip dhcp-server

add address-pool=dhcp disabled=no interface=bridge name=defconf

/interface bridge port

add bridge=bridge comment=defconf interface=ether2-master

add bridge=bridge comment=defconf hw=no interface=sfp1

add bridge=bridge comment=defconf hw=no interface=wlan1

add bridge=bridge comment=defconf hw=no interface=wlan2

add bridge=bridge interface=ether3

add bridge=bridge interface=ether4

add bridge=bridge interface=ether5

/ip neighbor discovery-settings

set discover-interface-list=discover

/interface list member

add interface=ether2-master list=discover

add interface=ether3 list=discover

add interface=ether4 list=discover

add interface=ether5 list=discover

add interface=sfp1 list=discover

add interface=wlan1 list=discover

add interface=wlan2 list=discover

add interface=bridge list=discover

add interface=bridge list=mactel

add interface=bridge list=mac-winbox

add interface=ether1 list=WAN

/ip address

add address=172.16.10.1/24 comment=defconf interface=ether2-master network=172.16.10.0

/ip dhcp-client

add comment=defconf dhcp-options=hostname,clientid disabled=no interface=ether1

/ip dhcp-server network

add address=172.16.10.0/24 comment=defconf gateway=172.16.10.1 netmask=24

/ip dns

set allow-remote-requests=yes

/ip dns static

add address=192.168.88.1 name=router

/ip firewall filter

add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp

add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related

add action=drop chain=input comment="defconf: drop all from WAN" in-interface=ether1

add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related

add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related

add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid

add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=ether1

/ip firewall nat

add action=accept chain=srcnat dst-address=172.16.5.0/24 packet-size=0-65535 src-address=128.0.0.0/2

add action=accept chain=dstnat disabled=yes dst-address=172.16.5.0/24 src-address=128.0.0.0/2

add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1

/ip ipsec peer

# Unsafe configuration, suggestion to use certificates

add address=204.13.42.45/32 dh-group=modp1024 enc-algorithm=aes-128 exchange-mode=aggressive hash-algorithm=sha256 secret=*********************************

/ip ipsec policy

add dst-address=172.16.5.0/24 sa-dst-address=204.13.42.45 sa-src-address=24.91.0.212 src-address=172.16.10.0/24 tunnel=yes

/system clock

set time-zone-name=America/New_York

/system identity

set name=upgraydd

/tool mac-server

set allowed-interface-list=mactel

/tool mac-server mac-winbox

设置allowed-interface-list = mac -winbox

[admin@upgraydd] >
Top
nescafe2002
Forum Veteran
Forum Veteran
Posts: 893
Joined: Tue Aug 11, 2015 12:46 pm
Location:Netherlands

Re: IPSEC Tunnel slow as death

Sun Feb 04, 2018 2:11 pm

There are some fundamental differences between your config and the 'actual' (renewed) default configuration.
You can execute /system default-configuration print to check out the defconf without applying. Then, apply fixes accordingly.

E.g.

Your config:
Code:Select all
/ip firewall filter add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related /ip firewall nat add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1
Default config:
Code:Select all
/ip firewall filter add chain=forward action=accept ipsec-policy=in,ipsec comment="defconf: accept in ipsec policy" add chain=forward action=accept ipsec-policy=out,ipsec comment="defconf: accept out ipsec policy" add chain=forward action=fasttrack-connection connection-state=established,related comment="defconf: fasttrack" /ip firewall nat add chain=srcnat out-interface-list=WAN ipsec-policy=out,none action=masquerade comment="defconf: masquerade"
So, exclude ipsec from nat and fasttrack and then check again.
Top
thylacine26
刚刚加入了
Topic Author
Posts: 2
Joined: Sat Feb 03, 2018 10:47 pm

Re: IPSEC Tunnel slow as death

Sun Feb 04, 2018 9:07 pm

I think I ended up duplicated my rules , I really don't know what I am doing here. I come from the world of Cisco and Watchguard, I am really not able to put 2 and 2 together here.

Apologies for the confusion

[admin@upgraydd] > export
# feb/04/2018 14:05:15 by RouterOS 6.41
# software id = 3KM6-4ZMC
#
# model = RouterBOARD 962UiGS-5HacT2HnT
# serial number = 6F15074A5DC9
/interface bridge
add admin-mac=64:D1:54:A7:BF:3B auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] name=ether2-master
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce \
disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=nancy \
wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=\
20/40/80mhz-Ceee disabled=no distance=indoors frequency=auto mode=\
ap-bridge ssid=nancy wireless-protocol=802.11
/interface list
add exclude=dynamic name=discover
add name=mactel
add name=mac-winbox
add name=WAN
/接口无线安全性配置文件
set [ find default=yes ] authentication-types=wpa-psk,wpa2-psk mode=\
dynamic-keys supplicant-identity=MikroTik wpa-pre-shared-key=*******************
wpa2-pre-shared-key=***************************
/ip hotspot pro
set [ find default=yes ] html-directory=flash/hotspot
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc \
pfs-group = modp2048
/ip pool
add name=dhcp ranges=172.16.10.20-172.16.10.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf hw=no interface=sfp1
add bridge=bridge comment=defconf hw=no interface=wlan1
add bridge=bridge comment=defconf hw=no interface=wlan2
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=discover
/interface list member
add interface=ether2-master list=discover
add interface=ether3 list=discover
add interface=ether4 list=discover
add interface=ether5 list=discover
add interface=sfp1 list=discover
add interface=wlan1 list=discover
add interface=wlan2 list=discover
add interface=bridge list=discover
add interface=bridge list=mactel
add interface=bridge list=mac-winbox
add interface=ether1 list=WAN
/ip address
add address=172.16.10.1/24 comment=defconf interface=ether2-master network=\
172.16.10.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=\
ether1
/ip dhcp-server network
add address=172.16.10.0/24 comment=defconf gateway=172.16.10.1 netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=input comment="defconf: drop all from WAN" \
in-interface=ether1
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related" \
connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" \
connection-state=invalid
add action=drop chain=forward comment=\
"defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
connection-state=new in-interface=ether1
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
connection-state=established,related
/ip firewall nat
add action=accept chain=srcnat dst-address=172.16.5.0/24 packet-size=0-65535 \
src-address=128.0.0.0/2
add action=accept chain=dstnat disabled=yes dst-address=172.16.5.0/24 \
src-address=128.0.0.0/2
add action=masquerade chain=srcnat comment="defconf: masquerade" \
out-interface=ether1
add action=masquerade chain=srcnat comment="defconf: masquerade" \
ipsec-policy=out,none out-interface-list=WAN
/ip ipsec peer
# Unsafe configuration, suggestion to use certificates
add address=204.13.42.45/32 dh-group=modp1024 enc-algorithm=aes-128 \
exchange-mode=aggressive hash-algorithm=sha256 secret=*******************
/ip ipsec policy
add dst-address=172.16.5.0/24 sa-dst-address=204.13.42.45 sa-src-address=\
24.91.0.212 src-address=172.16.10.0/24 tunnel=yes
/system clock
set time-zone-name=America/New_York
/system identity
set name=upgraydd
/tool mac-server
set allowed-interface-list=mactel
/tool mac-server mac-winbox
设置allowed-interface-list = mac -winbox
[admin@upgraydd] >
Top
User avatar
BlackVS
Member Candidate
Member Candidate
Posts: 171
Joined: Mon Feb 04, 2013 7:00 pm
Contact:

Re: IPSEC Tunnel slow as death

Mon Feb 05, 2018 8:41 am

I just setup an ipsec site to site tunnel and my connection is super slow. I have a 1Gbps fiber optic connection between point a and b. I think I have messed up in NAT someplace. Any guidance would be helpful
Which routers do you use?
Super slow - it is 1M, 10M, 100M?
Very probably you device (Hap AC?) does not support hardware encryption.
For Hap AC ipsec perfomance (AES-256) is ~80M udp / ~60M tcp for example.
Top
davestahr
刚刚加入了
Posts: 12
Joined: Wed May 04, 2011 3:33 pm

Re: IPSEC Tunnel slow as death

Thu Sep 06, 2018 3:56 pm

You need these two lines at the top of your filter rules:

add action=accept chain=forward comment="defconf: accept in ipsec policy" \
ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
ipsec-policy=out,ipsec

Specifically, they need to be before/above the fasttrack connection rule.
Top

Who is online

Users browsing this forum:mrshabaand 28 guests