Разобрался. Пришлось изменить мой ipsec-tools.conf на это:
flush;
spdflush;
# Generic routing
spdadd 10.4.0.0/16 10.3.0.0/25 any -P in ipsec esp/tunnel/205.251.233.121-199.167.xxx.xxx/require;
spdadd 10.3.0.0/25 10.4.0.0/16 any -P out ipsec esp/tunnel/199.167.xxx.xxx-205.251.233.121/require;
# Tunnel 1
spdadd 169.254.249.1/30 169.254.249.2/30 any -P in ipsec esp/tunnel/205.251.233.121-199.167.xxx.xxx/require;
spdadd 169.254.249.2/30 169.254.249.1/30 any -P out ipsec esp/tunnel/199.167.xxx.xxx-205.251.233.121/require;
spdadd 10.4.0.0/16 169.254.249.2/30 any -P in ipsec esp/tunnel/205.251.233.121-199.167.xxx.xxx/require;
spdadd 169.254.249.2/30 10.4.0.0/16 any -P out ipsec esp/tunnel/199.167.xxx.xxx-205.251.233.121/require;
# Tunnel 2
spdadd 169.254.249.5/30 169.254.249.6/30 any -P in ipsec esp/tunnel/205.251.233.122-199.167.xxx.xxx/require;
spdadd 169.254.249.6/30 169.254.249.5/30 any -P out ipsec esp/tunnel/199.167.xxx.xxx-205.251.233.122/require;
spdadd 10.4.0.0/16 169.254.249.6/30 any -P in ipsec esp/tunnel/205.251.233.122-199.167.xxx.xxx/require;
spdadd 169.254.249.6/30 10.4.0.0/16 any -P out ipsec esp/tunnel/199.167.xxx.xxx-205.251.233.122/require;
И изменить мой racoon.conf на это:
path pre_shared_key "/etc/racoon/psk.txt";
remote 205.251.233.122 {
exchange_mode main;
lifetime time 28800 seconds;
proposal {
encryption_algorithm aes128;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2;
}
generate_policy off;
}
remote 205.251.233.121 {
exchange_mode main;
lifetime time 28800 seconds;
proposal {
encryption_algorithm aes128;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2;
}
generate_policy off;
}
sainfo address 169.254.249.2/30 any address 169.254.249.1/30 any {
pfs_group 2;
lifetime time 3600 seconds;
encryption_algorithm aes128;
authentication_algorithm hmac_sha1;
compression_algorithm deflate;
}
sainfo address 169.254.249.6/30 any address 169.254.249.5/30 any {
pfs_group 2;
lifetime time 3600 seconds;
encryption_algorithm aes128;
authentication_algorithm hmac_sha1;
compression_algorithm deflate;
}
sainfo address 10.3.0.0/25 any address 10.4.0.0/16 any {
pfs_group 2;
lifetime time 3600 seconds;
encryption_algorithm aes128;
authentication_algorithm hmac_sha1;
compression_algorithm deflate;
}
Однако эта конфигурация, насколько я понимаю, будет маршрутизировать трафик только между 10.3.0.0/25 и 10.4.0.0/ 16 по первому туннелю (через xxx121). Я обновлю ответ, когда выясню это.
Вы знаете причину к использованию, "требуют" вместо "использования" для setkey конфигурации? Вы также знаете, имеет ли это значение, в какой порядок я помещаю операторы в удаленном и разделах sainfo и по ошибке дублировании определенных операторов? Например:
#original
remote 205.251.233.121 {
exchange_mode main;
lifetime time 28800 seconds;
proposal {
encryption_algorithm aes128;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group 2;
}
generate_policy off;
}
по сравнению с
#edited
remote 205.251.233.121 {
generate_policy off; #moved/duplicated
lifetime time 28800 seconds;
proposal {
dh_group 2; #moved
encryption_algorithm aes128;
hash_algorithm sha1;
authentication_method pre_shared_key;
}
exchange_mode main; #moved
generate_policy off; #duplicated/moved
}
Вы также выясняли, как заставить трафик течь на обоих туннелях?
Спасибо за любое руководство.
Ну, я обманул :) Я установил шлюз Astaro, который официально поддерживается Amazon, а затем использовал его для моделирования своего собственного. Вы можете просто подключиться по SSH к устройству Astaro и посмотреть, как они все настроили. Конечно, вы можете остаться с устройством Astaro, если захотите за него заплатить.