FortiGate 60DのL2TP/IPsecスループット

FortiGate 60DのL2TP/IPsecのスループットを測定してみました。

計測環境

FortiGate 60DにDebian9をL2TP/IPsec接続し、CentOS7をiperf3のクライアント、Debian9をiperf3のサーバーにしスループットの測定を行います。FortiGate 60Dのファームウェアはv6.0.5です。

計測結果

CentOS7 Aでのiperf3の実行結果が以下となります。-Mオプションを使ってMSSを変えてテストを行っています。

receiver sender
MSS Mbps CPU 消費電力 Mbps CPU 消費電力
1310 42.9 99% 7.8W 31.3 99% 7.8W
1200 42.1 99% 7.8W 30.0 99% 7.8W
800 27.6 99% 7.8W 20.5 99% 7.8W
400 14.0 99% 7.8W 10.5 99% 7.8W

(*) iperf3を60秒間実行。無負荷時はTAP-TST10の目測値で7.8W。receiverはL2TP Client(Debian9)へのダウンロード、senderはL2TP Client(Debian9)からのアップロード。CPU負荷はWeb管理画面の表示で、タイミングによってかなり変動があるので参考値。

L2TP/IPsecについてはoffloadが効かないようで散々な結果です。以下のようにIPsecの処理がCP0で処理されておりoffloadされていません。

# diagnose vpn ipsec status
All ipsec crypto devices in use:
npl:
    Encryption (encrypted/decrypted)
        null             : 0                0               
        des              : 0                0               
        3des             : 0                0               
        aes              : 0                0               
        aes-gcm          : 0                0               
        aria             : 0                0               
        seed             : 0                0               
    Integrity (generated/validated)
        null             : 0                0               
        md5              : 0                0               
        sha1             : 0                0               
        sha256           : 0                0               
        sha384           : 0                0               
        sha512           : 0                0               

NPU HARDWARE:
    Encryption (encrypted/decrypted)
        null             : 0                0               
        des              : 0                0               
        3des             : 0                0               
        aes              : 0                0               
        aes-gcm          : 0                0               
        aria             : 0                0               
        seed             : 0                0               
    Integrity (generated/validated)
        null             : 0                0               
        md5              : 0                0               
        sha1             : 0                0               
        sha256           : 0                0               
        sha384           : 0                0               
        sha512           : 0                0               

CP0:
    Encryption (encrypted/decrypted)
        null             : 0                0               
        des              : 0                0               
        3des             : 0                0               
        aes              : 2206881          1750603         
        aes-gcm          : 0                0               
        aria             : 0                0               
        seed             : 0                0               
    Integrity (generated/validated)
        null             : 0                0               
        md5              : 0                0               
        sha1             : 2206881          1750603         
        sha256           : 0                0               
        sha384           : 0                0               
        sha512           : 0                0               

SOFTWARE:
    Encryption (encrypted/decrypted)
        null             : 0                0               
        des              : 0                0               
        3des             : 0                0               
        aes              : 0                0               
        aes-gcm          : 0                0               
        aria             : 0                0               
        seed             : 0                0               
    Integrity (generated/validated)
        null             : 0                0               
        md5              : 0                0               
        sha1             : 0                0               
        sha256           : 0                0               
        sha384           : 0                0               
        sha512           : 0                0

FortiGate 60DをL2TP/IPsecサーバーとして使うことはパフォーマンスの面から難しそうです。

FortiGate 60DのConfig

テストに使ったFortiGate 60Dのconfigは以下の通りです。初期状態にL2TP等の設定を追加した差分のみ記載しています。

# リモートアクセスユーザーを作成

config user local
    edit "ppp1"
        set type password
        set passwd test
    next
end
config user group
    edit "RemoteAccessUsers"
        set member "ppp1"
    next
end

# IPsecの設定

config vpn ipsec phase1
    edit "L2TP"
        set type dynamic
        set interface "wan1"
        set peertype any
        set proposal aes128-sha1
        set dpd disable
        set dhgrp 2
        set psksecret presharedkey
    next
end
config vpn ipsec phase2
    edit "L2TP"
        set phase1name "L2TP"
        set proposal aes128-sha1
        set pfs disable
        set encapsulation transport-mode
        set l2tp enable
        set keylifeseconds 86400
    next
end

# L2TPの設定(internalのサブネット内のアドレスを付与)

config vpn l2tp
    set status enable
    set sip 192.168.100.200
    set eip 192.168.100.210
    set usrgrp "RemoteAccessUsers"
end

-- Firewallの設定

config firewall address
    edit "L2TP Clients"
        set type iprange
        set start-ip 192.168.100.200
        set end-ip 192.168.100.210
    next
end

config firewall policy
    edit 0
        set name "LAN to L2TP Clients"
        set srcintf "internal"
        set dstintf "wan1"
        set srcaddr "all"
        set dstaddr "all"
        set action ipsec
        set schedule "always"
        set service "ALL"
        set logtraffic disable
        set vpntunnel "L2TP"
    next
    edit 0
        set name "L2TP Clients to LAN"
        set srcintf "wan1"
        set dstintf "internal"
        set srcaddr "L2TP Clients"
        set dstaddr "all"
        set action accept
        set schedule "always"
        set service "ALL"
        set logtraffic disable
    next
end

Debian9の設定

IPsecにはstrongSwan 5.5.1、L2TPにはxl2tpdを使いました。fortigate.example.comはFortiGate 60Dのwan1アドレスとなります(内部DNSに当該名前の登録を行ってテストしました)。

IPsec関連(strongSwan)
# cat /etc/ipsec.conf

conn fortigate
        keyexchange=ikev1
        authby=secret
        left=%defaultroute
        right=fortigate.example.com
        rightid=%any
        ike=aes128-sha1-modp1024!
        esp=aes128-sha1!
        auto=add
        leftprotoport=17/1701
        rightprotoport=17/1701
        type=transport

# cat /etc/ipsec.secrets

: PSK "presharedkey"
L2TP関連(xl2tpd)
# cat /etc/xl2tpd/xl2tpd.conf

[global]
auth file = /etc/ppp/chap-secrets

[lac fortigate]
lns = fortigate.example.com
require chap = yes
pppoptfile = /etc/ppp/options.xl2tpd.fortigate

# cat /etc/ppp/chap-secrets

"ppp1" "fortigate" "test" *

# cat /etc/ppp/options.xl2tpd.fortigate

name ppp1
remotename fortigate
ipcp-accept-local
ipcp-accept-remote
lcp-echo-interval 30
lcp-echo-failure 4
require-chap
noccp
nobsdcomp
noauth
mtu 1350
mru 1350
nodefaultroute
usepeerdns
connect-delay 5000
persist
debug
接続コマンド
# IPsec接続を行う、ipsec statusで接続状況確認可能
ipsec up fortigate

# L2TP接続を行う
echo "c fortigate" > /var/run/xl2tpd/l2tp-control

# 192.168.100.0/24へのルート追加
ip route add 192.168.100.0/24 dev ppp0

# L2TP切断
echo "d fortigate" > /var/run/xl2tpd/l2tp-control

# IPsec切断
ipsec down fortigate

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です