Cisco 841MのIPsecスループット
Cisco C841M-4X-JSEC/K9のスループットを測定してみました。直結での計測なので実際の利用時のスピードを測るものではなく、ルーターの性能評価を行うものです。
計測環境
C841MとDebian9をIPsecで接続し、それぞれにぶら下げたCentOS7 Aをiperf3のクライアント、CentOS7 Bをiperf3のサーバーとして、スループットの測定を行います。C841Mのファームウェアは15.5(3)M9となります。
計測結果
CentOS Aでiperf3の実行した結果が以下となります。無負荷時の消費電力はTAP-TST10での目測値で6.4Wとなります。
receiver | sender | |||||
暗号化 | Mbps | CPU | 消費電力 | Mbps | CPU | 消費電力 |
AES128-SHA1 | 108 | 99% | 7.2W | 111 | 99% | 7.1W |
遅いです。公式サイトの説明だとIPsec 350Mbpsとありますが、全然その数字に届きませんね。AES256やSHA256のテストもしたかったのですが、設定がど素人の私には難解でうまくいきませんでした。後日再チャレンジします。
C841MのConfig
テストに使ったC841Mのconfigは以下の通りです。接続そのものはポリシーベース(policy based)とルートベース(route based)の2パターン試しましたが、テスト結果はルートベース(route based)の数値のみ掲載しています。なお、両者ともfirewallの設定は入れていません。後日見直してfirewallも入れてみます。IPsec関連のconfigのみ太字にしています。
ルートベース(route based)のconfig
version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot system flash:/c800m-universalk9-mz.SPA.155-3.M9.bin
boot-end-marker
!
no aaa new-model
ethernet lmi ce
clock timezone SGT 8 0
!
ip dhcp pool dhcp-lan1
network 192.168.100.0 255.255.255.0
default-router 192.168.100.1
dns-server 192.168.100.1
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
license udi pid C841M-4X-JAIS/K9 sn xxxxxxxxxx
!
redundancy
!
crypto ikev2 proposal default
encryption aes-cbc-128 aes-cbc-256
integrity sha1
group 2
!
crypto ikev2 keyring keys
peer debian
hostname debian.example.com
identity fqdn debian.example.com
pre-shared-key presharedkey
!
!
crypto ikev2 profile prof-debian
match identity remote fqdn debian.example.com
identity local fqdn cisco.example.com
authentication local pre-share
authentication remote pre-share
keyring local keys
!
crypto ipsec transform-set TS esp-aes esp-sha-hmac
mode tunnel
!
crypto ipsec profile ipsec-debian
set transform-set TS
set ikev2-profile prof-debian
!
interface Tunnel0
ip unnumbered GigabitEthernet0/4
tunnel source GigabitEthernet0/4
tunnel mode ipsec ipv4
tunnel destination 10.0.0.3 (注1)
tunnel protection ipsec profile ipsec-debian ikev2-profile prof-debian
!
interface GigabitEthernet0/0
no ip address
!
interface GigabitEthernet0/1
no ip address
!
interface GigabitEthernet0/2
no ip address
!
interface GigabitEthernet0/3
no ip address
!
interface GigabitEthernet0/4
ip address dhcp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
!
interface GigabitEthernet0/5
no ip address
shutdown
duplex auto
speed auto
!
interface Vlan1
ip address 192.168.100.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip dns server
ip nat inside source list 1 interface GigabitEthernet0/4 overload
ip route 192.168.200.0 255.255.255.0 Tunnel0
!
access-list 1 permit 192.168.100.0 0.0.0.255
!
control-plane
!
line con 0
exec-timeout 180 0
no modem enable
line vty 0 4
login
transport input none
!
scheduler allocate 20000 1000
!
end
(注1) debian.example.comと入力したのですが、config上はresolvされたIPアドレスに置き換わってしまいました。これだとdebian.example.comが動的アドレスだとするとIPアドレスが変更になると繋がらなくなります。回避策としてここにあるように定期的にconfigを修正するスクリプトを実行する対処方法があるようですが、今回はスループットテストが目的なので、入れていません。
ポリシーベース(policy based)のconfig
version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot system flash:/c800m-universalk9-mz.SPA.155-3.M9.bin
boot-end-marker
!
no aaa new-model
ethernet lmi ce
clock timezone SGT 8 0
!
ip dhcp pool dhcp-lan1
network 192.168.100.0 255.255.255.0
default-router 192.168.100.1
dns-server 192.168.100.1
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
license udi pid C841M-4X-JAIS/K9 sn xxxxxxxxxxxxx
!
redundancy
!
crypto ikev2 proposal default
encryption aes-cbc-128
integrity sha1
group 2
!
crypto ikev2 keyring keys
peer debian
hostname debian.example.com
identity fqdn debian.example.com
pre-shared-key presharedkey
!
crypto ikev2 profile prof-debian
match identity remote fqdn debian.example.com
identity local fqdn cisco.example.com
authentication local pre-share
authentication remote pre-share
keyring local keys
!
crypto ipsec transform-set TS esp-aes esp-sha-hmac
mode tunnel
!
crypto map vpn 10 ipsec-isakmp
set peer debian.example.com dynamic
set transform-set TS
set ikev2-profile prof-debian
match address acl-debian
!
interface GigabitEthernet0/0
no ip address
!
interface GigabitEthernet0/1
no ip address
!
interface GigabitEthernet0/2
no ip address
!
interface GigabitEthernet0/3
no ip address
!
interface GigabitEthernet0/4
ip address dhcp
ip nat outside
ip virtual-reassembly in
duplex auto
speed auto
crypto map vpn
!
interface GigabitEthernet0/5
no ip address
shutdown
duplex auto
speed auto
!
interface Vlan1
ip address 192.168.100.1 255.255.255.0
ip nat inside
ip virtual-reassembly in
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
ip dns server
ip nat inside source list nat interface GigabitEthernet0/4 overload
!
ip access-list extended acl-debian
permit ip 192.168.100.0 0.0.0.255 192.168.200.0 0.0.0.255
ip access-list extended nat
deny ip 192.168.100.0 0.0.0.255 192.168.200.0 0.0.0.255 (注1)
permit ip 192.168.100.0 0.0.0.255 any
!
control-plane
!
line con 0
exec-timeout 180 0
no modem enable
line vty 0 4
login
transport input none
!
scheduler allocate 20000 1000
!
end
(注1) IPsecの対象とする通信をNATから除外するための設定
Debian9の設定
IPsecにはstrongSwan 5.5.1を使いました。C841M側の設定がポリシーベース、ルートベースどちらのケースでもstrongSwan側の設定は同じとなります。
IPsec関連(strongSwan)
# cat /etc/ipsec.conf conn mikrotik left=%defaultroute leftid=debian.example.com right=cisco.example.com rightid=cisco.example.com leftsubnet=192.168.200.0/24 rightsubnet=192.168.100.0/24 keyexchange=ike authby=secret type=tunnel ike=aes128-sha1-modp1024! esp=aes128-sha1! reauth=no auto=start keyingtries=%forever # cat /etc/ipsec.secrets : PSK "presharedkey"