LINUX.ORG.RU
ФорумAdmin

Не поднимается ipsec тунель


0

0

Был настроен ipsec тунель между 2мя Freebsd. После перевода 1го из серверов на Debian он перестал работать(конфиг взят со старого сервера).
Конфиг /etc/ipsec-tools.conf:
flush;
spdflush;
spdadd 192.168.16.0/24 192.168.0.0/24 any -P out ipsec esp/tunnel/ip1-ip2/require;
spdadd 192.168.0.0/24 192.168.16.0/24 any -P in ipsec esp/tunnel/ip1-ip2/require;

Скрипт запуска:
/etc/init.d/ipsec.sh
ip1=«<ip1>»
ip1_int=«192.168.16.1»
ip1_net=«192.168.16.0»
ip1_intmask=«24»

ip2=«<ip1>»
ip2_int=«192.168.0.1»
ip2_net=«192.168.0.0»
ip2_intmask=«24»

case $1 in
start)
error=0
echo -n «Starting IPSec: »
/sbin/ip tunnel add sit1 mode sit ttl 255 remote ${ip2} local ${ip1} || error=1
/sbin/ip link set dev sit1 up
if [ $error -eq 1 ]; then
echo " error. Exiting"
exit 1
else
echo «done.»
echo -n " Creating SPD entries ... "
fi

setkey -FP || error=1
setkey -F || error=1
# Add the policy
setkey -c << EOF 2>&1 > /dev/null || error=1
flush;
spdflush;


add ${ip1} ${ip2} esp 0x10007 -E des-cbc 0x3f1e0b0a4839ffff -A hmac-md5 «pass» ;
add ${ip2} ${ip1} esp 0x10008 -E des-cbc 0x3f1e0b0a4839ffff -A hmac-md5 «pass» ;
spdadd ${ip1_net}/${ip1_intmask} ${ip1_net}/${ip1_intmask} any -P out ipsec esp/tunnel/${ip2}-${ip1}/require;
spdadd ${ip1_int}/${ip1_intmask} ${ip2_int}/${ip2_intmask} any -P in ipsec esp/tunnel/${ip1}-${ip2}/require;

EOF


if [ $error -eq 1 ]; then
echo " error. Exiting"
exit 1
else
echo «done.»
fi

;;

stop)
echo -n «Stoping IPSec: »
/sbin/ip route del ${ip2} dev sit1

/sbin/ip link set sit1 down
/sbin/ip tunnel del sit1
echo «done.»
;;

restart)
$0 stop && sleep 5 && $0 start
;;

*)
echo «Usage: `basename $0` { start | stop }»
exit 64
;;
esac

ifconfig sit1
sit1 Link encap:IPv6-in-IPv4
inet6 addr: fe80::d409:e088/128 Scope:Link
UP POINTOPOINT RUNNING NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


Подозреваю, что чтото не включено в ядре. Как проверить?

Ответ на: комментарий от dimon555

Racoon запущен

sysctl -a | grep forwarding
net.ipv6.conf.sit1.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
error: «Operation not permitted» reading key «net.ipv6.route.flush»
net.ipv6.conf.eth0.forwarding = 1
net.ipv6.conf.lo.forwarding = 1
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 0
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
error: «Operation not permitted» reading key «net.ipv4.route.flush»
net.ipv4.conf.all.forwarding = 0

forlorn
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.