我正在尝试通过 debian 镜像中的 ip xfrm 命令配置 ipsec。我遇到了操作不支持的错误。请帮我看看哪里出错了。
日志:
NE145:2-10*:/tmp # ip xfrm policy add src 10.1.1.1/24 dst 224.0.0.5/32 proto 89 dir out ptype main tmpl src 10.1.1.1 dst 224.0.0.5 proto esp mode transport level required
RTNETLINK answers: Operation not supported
NE145:2-10*:/tmp # uname -a
Linux NE145 4.19.5-rt4+ #5 SMP PREEMPT RT Wed Apr 17 13:37:01 PDT 2019 x86_64 GNU/Linux
NE145:2-10*:/tmp #
配置文件:
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=y
CONFIG_XFRM_USER=y
# CONFIG_XFRM_INTERFACE is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
答案1
xfrm 本身只是基本框架 – 您还需要加载单独的功能:
- 隧道类型:
xfrm4_mode_transport
(配置INET4_XFRM_MODE_传输)xfrm6_mode_transport
(配置INET6_XFRM_MODE_传输)
- 封装:
esp4
(配置INET_ESP)esp6
(配置_INET6_ESP)
对于个别州,您还需要:
- 密码:
aes
,aes_x86_64
(CONFIG_CRYPTO_AES 等) - 密码模式:,,
cbc
(CONFIG_CRYPTO_CBC等)ctr
gcm