IPsec в ядре Linux

9954
Catalin Vasile

У меня есть некоторые вопросы (вопросы), связанные с реализацией IPsec в ядре Linux и его пользовательским интерфейсом.

  1. Самый большой вопрос - какой официальный проект по внедрению Linux Kernel IPsec? Из того, что я понял, реализация является форком проекта Kame, но друг сказал, что это не так. Какой у них официальный сайт и репо?
  2. Где в источнике документации ядра я могу найти некоторые заметки?
  3. Какой пользовательский интерфейс используется чаще всего? ip-tools или пакет iproute2? У этих двоих одинаковый подход, или у одного из них большие накладные расходы?
  4. Из того, что я видел, учебные пособия по транспортному режиму IPsec iproute2 относятся к утилите "setkey" для загрузки файла конфигурации. "Setkey" на самом деле используется для пакета iproute2, или меня вводят в заблуждение? «Setkey» приклеен к «racoon» из ip-tools, или это обычное приложение для загрузки конфигурации? Что на самом деле делает «setkey» (я очень смущен этим)?
7

1 ответ на вопрос

15
ecdsa
  1. The IPsec stack integrated in the Linux kernel since 2.6 (NETKEY) was originally based on the KAME stack (at least in regards to the API). The source code is part of the kernel repository, where the main components are found in the net/xfrm folder, including the implementation of the Netlink/XFRM configuration interface. The alternative and standardized (but somewhat extended) PF_KEYv2 interface implementation is located in the net/key folder.
  2. There is not much documentation. But check the Documentation/networking folder.
  3. If you do manual configuration of IPsec SAs and policies (manual keying) I'd recommend iproute2. It uses the more powerful Netlink/XFRM interface and the package is installed by most distributions by default. But usually you'd use automatic keying provided by a userland IKE daemon such as strongSwan, Open/libreswan or racoon (ipsec-tools), that way you don't have to manually install SAs and policies and you get ephemeral encryption/integrity keys established via Diffie-Hellman during IKE. Regular automatic negotiation of new keys, which is called rekeying, is also possible.
  4. setkey is provided by the ipsec-tools package for manual keying, there is no relation to the iproute2 package. With iproute2 you'd use the ip xfrm command to manually configure SAs and policies. Both commands directly interact with the SAD and SPD (see RFC 4301) in the kernel to manually manage IPsec SAs and policies. setkey, like racoon and other BSD-based tools, uses the PF_KEYv2 interface, so it is less powerful than the ip xfrm command. For instance, extended sequence numbers or marks can't be configured with PF_KEYv2 on Linux.

Похожие вопросы