IPSEC

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску

IPSEC

У меня нет полного понимания работы IPSEC потому пока просто приведу рабочие конфинги для

  • setkey
  • openswan

setkey

setkey это такая утилита из ipsec-tools

rpm -qf  /usr/sbin/setkey
ipsec-tools-0.8.0-25.3.x86_64

Насколько я понимаю все шифрование выполняется ядром а утилита (как iptables или tc) только управляет правилами. Скорее всего все то же самое можно делать и другими средсвами
Вот пример конфигурации шифрования между 2 хостами

Host 1

#!/usr/sbin/setkey -f

flush;
spdflush;



add infra-dal06 infra-sjc01 ah 15800 -A hmac-md5 "1234567890123456";
add infra-sjc01 infra-dal06 ah 24600 -A hmac-md5 "1234567890123456";
add infra-dal06 infra-sjc01 esp 15801 -E 3des-cbc "1234567890123456fq2aswZE";
add infra-sjc01 infra-dal06 esp 24601 -E 3des-cbc "XmRVNN9Z1234567890123456";

spdadd infra-prod-sjc01 infra-prod-dal06 any -P out ipsec
    esp/transport//require
    ah/transport//require;

spdadd infra-prod-dal06 infra-prod-sjc01 any -P in ipsec
    esp/transport//require
    ah/transport//require;

Host2

#!/usr/sbin/setkey -f

flush;
spdflush;


### infra-prod-dal06

add infra-prod-dal06 infra-prod-dal07 ah 15700 -A hmac-md5 "X5URFWsPha9N7sEe";
add infra-prod-dal07 infra-prod-dal06 ah 24500 -A hmac-md5 "DChq54sZpxdkchWN";
add infra-prod-dal06 infra-prod-dal07 esp 15701 -E 3des-cbc "VxN2k792tsHW5pmbDG3gzVty";
add infra-prod-dal07 infra-prod-dal06 esp 24501 -E 3des-cbc "VxN2k792tsHW5pmbDG3gzVty";

spdadd infra-prod-dal07 infra-prod-dal06 any -P out ipsec
    esp/transport//require
    ah/transport//require;

spdadd infra-prod-dal06 infra-prod-dal07 any -P in ipsec
    esp/transport//require
    ah/transport//require;


### infra-prod-sjc01

add infra-prod-sjc01 infra-prod-dal07 ah 15900 -A hmac-md5 "9t5hkJtaE3GvKFG8";
add infra-prod-dal07 infra-prod-sjc01 ah 24700 -A hmac-md5 "8NNkddxmbnbUnUHt";
add infra-prod-sjc01 infra-prod-dal07 esp 15901 -E 3des-cbc "UXctDPGVtWV4cnLfPwm56ZEf";
add infra-prod-dal07 infra-prod-sjc01 esp 24701 -E 3des-cbc "NEBRapMe9cqrBRzFP4qNK2aX";

spdadd infra-prod-dal07 infra-prod-sjc01 any -P out ipsec
    esp/transport//require
    ah/transport//require;

spdadd infra-prod-sjc01 infra-prod-dal07 any -P in ipsec
    esp/transport//require
    ah/transport//require;

OpenSWAN