51 (edytowany przez rpc 2011-02-18 16:45:16)

Odp: IPsec a nowy kernel 2.6.32.27

1)to że tunel się zestawia miedzy hostami w lan automatycznie to normalne. Sam tunel między gateway na których stoi ipsec się nie zestawi całkowicie chyba że wywołasz ręcznie komendę connect w cli racoon

  racoonctl vpn-connect [-u identity] vpn_gateway
  racoonctl vpn-disconnect vpn_gateway

2)Bardzo często nie da się z routera który jest gatewayem vpn dostać na drugą stronę. Wynika to z różnych przyczyn. Jedną z nich jest adres źródłowy. Tunel musi dostać pakiet z lan a pingując standardowo z routera drugą stronę adresem źródłowym niekoniecznie jest adres ip interfejsu lan i to jest rónież przyczyną niemożności dostania się z routera po vpn na drógą stronę. Co do ping można w pewien sposób poradzić sobie z tym podając opcję -I IP_ADRES_IFACE_LAN

3)Nie moja wina że developerzy openwrt ciągle coś przerabiają w firewallu(nawet to dobrze że firewall ciągle ewoluuje). Ale w tym wypadku mocno przegięli.  Dla mnie to oczywisty błąd bo reguły z /etc/firewall.user powinny mieć pierwszeństwo nad tymi co są ładowane ze skryptów (/etc/config/firewall). Znaczy się powinny być ładowane na końcu. Niestety developerzy postarali się o to że przestawili reguły NAT dotyczące WAN i LAN na początek reguł POSTROUTING i za chiny ludowe nie da się czegokolwiek wstawić przed nimi z pliku /etc/firewall.user
Poprzednio Reguły NAT z WAN i LAN były za łańcuchem postouting_rule teraz niestety są przed. Więc użytkownikowi nie pozostawia się ŻADNEGO pola działania.
Mocno zastanawiam się czy modyfikować mój opis. Zmiany które wprowadzili są dla mnie dość kontrowersyjne. Nie wiem może na końcu każdego dokumentów napiszę o tym aby inni wiedzieli że coś nie tak.

Dlatego przeniesienie reguł dotyczących ipsec do własnego skryptu uruchamianego po firewallu jest wręcz wymagane.

potwierdzeniem tego co pisze wyżej jest ustawienie kolejności reguł

Chain POSTROUTING (policy ACCEPT 246 packets, 18433 bytes)
 pkts bytes target     prot opt in     out     source               destination
  854 61486 zone_wan_nat  all  --  any    eth0.2  anywhere             anywhere
    1    84 zone_lan_nat  all  --  any    br-lan  anywhere             anywhere
    0     0 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     192.168.1.0/24       192.168.11.0/24
  246 18433 postrouting_rule  all  --  any    any     anywhere             anywhere

nasze reguły zostały wstawione za NAT .
Zwracam uwagę że nie mogę użyć łańcuchów
zone_wan_nat i zone_lan_nat
ponieważ są one powiązane jasno z interfejsem fizycznym
W przypadku racoon nie ma czegoś takiego jak fizyczny interfejs

Można oczywiście użyć openswan on już ma iface np. ipsec0

PS. przerobiłem arta.

52

Odp: IPsec a nowy kernel 2.6.32.27

dzięki cezary za info

Alternatywą w/w zmian jest uaktualnienie pakietu firewall do najnowszej wersji

opkg install http://ecco.selfip.net/backfire/packages/firewall_2-21_all.ipk

po wgraniu w/w aktualizacji reguły spokojnie mogą zostać jak w oryginalnym opisie.
Bug został naprawiony

53

Odp: IPsec a nowy kernel 2.6.32.27

Zainstalowałem ten nowy pakiet z firewall'em, zostawiłem te reguły wg tego skryptu do uruchamiania racoon.
@ RPC - BTW dlaczego akurat racoon. Ja szukałem czegoś dla openwrt co pozwalało by na działanie IPSec i natrafiłem na Twoją stronę. Czytałem coś nt openswan, ale jakoś dobrze opisałeś racoona i się na niego zdecydowałem chyba z wygody.
Czy ten openswan jest lepszy/gorszy od racoon? Nie wiem w jakich kategoriach rozpatrywać różnice miedzy tymi programami.

Po instalacji firewalla i wpisaniu

root@Gargoyle:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 20 packets, 2108 bytes)
 pkts bytes target     prot opt in     out     source               destination
   26  2396 prerouting_rule  all  --  any    any     anywhere             anywhere
    8   384 zone_wan_prerouting  all  --  3g-wan any     anywhere             anywhere

Chain POSTROUTING (policy ACCEPT 11 packets, 780 bytes)
 pkts bytes target     prot opt in     out     source               destination
    1   136 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
    2   168 ACCEPT     all  --  any    any     172.16.200.240/28    150.2.*.0/16
    0     0 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     172.16.200.240/28    150.2.*.0/16
   76  5528 postrouting_rule  all  --  any    any     anywhere             anywhere
   37  2800 zone_wan_nat  all  --  any    3g-wan  anywhere             anywhere

Chain OUTPUT (policy ACCEPT 28 packets, 2276 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain nat_reflection_in (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain nat_reflection_out (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_A (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_C (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
    3   220 pf_loopback_C  all  --  any    br-lan  anywhere             anywhere
   70  5138 nat_reflection_out  all  --  any    any     anywhere             anywhere

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
   26  2396 nat_reflection_in  all  --  any    any     anywhere             anywhere

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_nat (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 pf_loopback_A  all  --  any    any     anywhere             83.220.*.139.umts.static.eranet.pl
    0     0 prerouting_lan  all  --  any    any     anywhere             anywhere

Chain zone_wan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination
   37  2800 MASQUERADE  all  --  any    any     anywhere             anywhere

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
    3   144 REDIRECT   tcp  --  any    any     anywhere             anywhere            tcp dpt:22 redir ports 22
    0     0 REDIRECT   tcp  --  any    any     anywhere             anywhere            tcp dpt:443 redir ports 443
    5   240 prerouting_wan  all  --  any    any     anywhere             anywhere
root@Gargoyle:~#

Oraz :

root@Gargoyle:~# iptables -L -v
Chain INPUT (policy ACCEPT 4 packets, 1920 bytes)
 pkts bytes target     prot opt in     out     source               destination
  915 72330 bw_ingress  all  --  3g-wan any     anywhere             anywhere
 1121 86845 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
   39  2771 ACCEPT     all  --  lo     any     anywhere             anywhere
    8   384 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
   19  2716 input_rule  all  --  any    any     anywhere             anywhere
   19  2716 input      all  --  any    any     anywhere             anywhere

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
   65  5136 ACCEPT     all  --  any    any     anywhere             150.2.*.0/16
   56  4704 ACCEPT     all  --  any    any     150.2.*.0/16         anywhere
    0     0 bw_ingress  all  --  3g-wan any     anywhere             anywhere
    0     0 ingress_restrictions  all  --  3g-wan any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     anywhere             150.2.*.0/16
    0     0 ACCEPT     all  --  any    any     150.2.*.0/16         anywhere
    0     0 zone_wan_MSSFIX  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
    0     0 forwarding_rule  all  --  any    any     anywhere             anywhere
    0     0 forward    all  --  any    any     anywhere             anywhere
    0     0 reject     all  --  any    any     anywhere             anywhere

Chain OUTPUT (policy ACCEPT 3 packets, 220 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1176  352K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
   39  2771 ACCEPT     all  --  any    lo      anywhere             anywhere
   51  3974 output_rule  all  --  any    any     anywhere             anywhere
   51  3974 output     all  --  any    any     anywhere             anywhere

Chain bw_ingress (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total1A-download-2-449 --type combined --current_bandwidth 224 --reset_interval 2 --reset_time 2 --intervals_to_save 449
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total1B-download-minute-15 --type combined --current_bandwidth 308 --reset_interval minute --intervals_to_save 15
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist1-download-minute-15 --type individual_local --subnet 172.16.200.240/28 --reset_interval minute --intervals_to_save 15
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total2A-download-minute-359 --type combined --current_bandwidth 308 --reset_interval minute --intervals_to_save 359
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total2B-download-900-24 --type combined --current_bandwidth 5972 --reset_interval 900 --reset_time 900 --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist2-download-900-24 --type individual_local --subnet 172.16.200.240/28 --reset_interval 900 --reset_time 900 --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total3A-download-180-479 --type combined --current_bandwidth 308 --reset_interval 180 --reset_time 180 --intervals_to_save 479
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total3B-download-hour-24 --type combined --current_bandwidth 71438 --reset_interval hour --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist3-download-hour-24 --type individual_local --subnet 172.16.200.240/28 --reset_interval hour --intervals_to_save 24
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total4A-download-7200-359 --type combined --current_bandwidth 71438 --reset_interval 7200 --reset_time 7200 --intervals_to_save 359
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total4B-download-day-31 --type combined --current_bandwidth 48039590 --reset_interval day --intervals_to_save 31
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist4-download-day-31 --type individual_local --subnet 172.16.200.240/28 --reset_interval day --intervals_to_save 31
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total5A-download-day-365 --type combined --current_bandwidth 48039530 --reset_interval day --intervals_to_save 365
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total5B-download-month-12 --type combined --current_bandwidth 55362439 --reset_interval month --intervals_to_save 12
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist5-download-month-12 --type individual_local --subnet 172.16.200.240/28 --reset_interval month --intervals_to_save 12

Chain egress_restrictions (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 egress_whitelist  all  --  any    any     anywhere             anywhere

Chain egress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 zone_wan_forward  all  --  3g-wan any     anywhere             anywhere

Chain forwarding_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 nat_reflection_fwd  all  --  any    any     anywhere             anywhere

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain ingress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ingress_whitelist  all  --  any    any     anywhere             anywhere

Chain ingress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input (1 references)
 pkts bytes target     prot opt in     out     source               destination
   15   796 zone_wan   all  --  3g-wan any     anywhere             anywhere

Chain input_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:443
    7   304            tcp  --  any    any     anywhere             anywhere            tcp dpt:22 recent: SET name: SSH_CHECK side: source
    0     0 DROP       all  --  any    any     anywhere             anywhere            recent: UPDATE seconds: 300 hit_count: 11 name: SSH_CHECK side: source
    7   304 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:22

Chain nat_reflection_fwd (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain output (1 references)
 pkts bytes target     prot opt in     out     source               destination
   51  3974 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere
   51  3974 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_B (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain reject (3 references)
 pkts bytes target     prot opt in     out     source               destination
    6   284 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset
    2   208 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination
    8   384 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
    0     0 DROP       all  --  any    any     anywhere             anywhere

Chain zone_lan (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 input_lan  all  --  any    any     anywhere             anywhere
    0     0 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere

Chain zone_lan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_MSSFIX (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_forward (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 pf_loopback_B  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  br-lan br-lan  anywhere             anywhere
    0     0 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere
    0     0 forwarding_lan  all  --  any    any     anywhere             anywhere
    0     0 zone_lan_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:68
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request
    0     0 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
   15   796 input_wan  all  --  any    any     anywhere             anywhere
    8   492 zone_wan_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination
   48  3754 ACCEPT     all  --  any    3g-wan  anywhere             anywhere
    0     0 ACCEPT     all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  any    3g-wan  anywhere             anywhere
    0     0 DROP       all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_MSSFIX (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 TCPMSS     tcp  --  any    3g-wan  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 reject     all  --  any    3g-wan  anywhere             anywhere
    8   492 reject     all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere
    0     0 zone_wan

To są logi z "nowego" firewall'a oraz ze skryptu uruchomieniowego zawierającoego reguły iptables.
Plik firewall.user jest pusty.

Łukasz

54

Odp: IPsec a nowy kernel 2.6.32.27

no bo masz zdublowane reguły to po pierwsze - widać w POSTROUTING

Chain POSTROUTING (policy ACCEPT 11 packets, 780 bytes)
 pkts bytes target     prot opt in     out     source               destination
    1   136 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
    2   168 ACCEPT     all  --  any    any     172.16.200.240/28    150.2.*.0/16
    0     0 ACCEPT     esp  --  any    any     anywhere             anywhere
    0     0 ACCEPT     ah   --  any    any     anywhere             anywhere
    0     0 ACCEPT     ipcomp--  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     172.16.200.240/28    150.2.*.0/16
   76  5528 postrouting_rule  all  --  any    any     anywhere             anywhere
   37  2800 zone_wan_nat  all  --  any    3g-wan  anywhere             anywhere

przepisz z powrotem reguły firewalla (iptables) z /etc/init.d/racoon do /etc/firewall.user tak jak było w oryginale i przeładuj najpierw firewalla a potem racoon

dlaczego racoon a nie openswan ?
bo mało opisywany
bo mniej popularny
bo mi pasi

tak po prawdzie kiedyś miałem freeswan (2.2/2.4) i się przejechałem . Musiałem się na coś zdecydować więc przeszedłem na racoon tak jakoś łatwo się zrobiło i działa po dziś dzień na debianie bez problemu już z 10 lat.


ja wiem czy lepszy czy gorszy. W sumie to robi ten sam efekt tylko innymi narzędziami
w sumie to tak naprawdę w racoon też jest łatwa konfiguracja ale ja z niej nigdy nie korzystałem bo nie musiałem

Dla usera to openswan jest czytelniejszy bo masz rzeczywisty interfejs np. ipsec0 do którego możesz podczepiać reguły firewalla. Lepiej to widać
A racoon działa na poziomie jądra więc w sumie uogólniając wszystko dzieje się jakoś przezroczyście. Pakiety są przechwytywane w locie i są wysyłane tam gdzie należy. W openswan widzisz że jak wyślesz na ipsec0 to pakiety idą tamtędy a tu nie jest to takie oczywiste na pierwszy rzut oka

Tak naprawdę racoon działa a to że coś się zmienia w openwrt to trzeba się do tego przyzwyczaić. Trzy razy coś developerzy poprawią a raz zepsują. Normalna rzecz a ja pewnie jeszcze wiele razy zanim zauważę że coś zmienili będę modyfikował wersje arta pod openwrt

55

Odp: IPsec a nowy kernel 2.6.32.27

Witam,

Dzięki kolego RPC za odpowiedź:)
Mam problem z podtrzymaniem tunelu, przy połączeniu pokazuje mi się takie coś w logach

WARNING: ignore RESPONDER-LIFETIME notification
WARNING: attribute has been modified

pogooglowałem trochę, ale sugestie padały na różne czasy życia hasła fazy pierwszej, ktoś napisał, że to może być różnica stref czasowych ustawionych na hostach(troche mało prawdopodobne..ale)

Gargoyle daemon.info racoon: WARNING: the expire message is received but the handler has not been established.
Gargoyle daemon.info racoon: ERROR: 195.177.*.157 give up to get IPsec-SA due to time up to wait.

To po jakimś czasie wyskakuje w logach jak tunel nie jest używany
Widziałem też, że jest opcja natt_keepalive, ale nie wiem czy jest tożsama z keepalive'em w innych routerach typu dlink netgear..
Da radę jakoś podtrzymać tunel mimo braku ruchu ze strony LANu?

Łukasz

56

Odp: IPsec a nowy kernel 2.6.32.27

natt_keepalive ci sie nie przyda bo jest od nat traversal
czy na pewno masz ustawione po obu stronach identyczne lifetime ?
lifetime powinno być w phase1 i phase2 takie same dla obu stron połączeń

57

Odp: IPsec a nowy kernel 2.6.32.27

Cześć,
Tak, wiem, że muszą być jednakowe, wg informacji jakie mam to są takie same.
Sprawdzam jeszcze raz informacje u źródła.

Co do tego keepaliva to jest jakaś możliwość żeby podtrzymywać tunel? Wiem, że mogę z komputera w lanie za pomocą crona pingować host po drugie stronie tunelu, ale czy sam router może podtrzymywać tunel?

58

Odp: IPsec a nowy kernel 2.6.32.27

tunel nie powinien padać
coś musi być jeszcze nie tak
najlepiej jak ktoś ten da zrzuty ekranu z routera z drugiej strony dotyczące ipsec
wtedy będzie można coś zweryfikować
czy nadal używasz opcji generate ? do generowania setkey

59

Odp: IPsec a nowy kernel 2.6.32.27

Znalazłem właśnie odpowiedź, mamy różne czasy trwania IKE SA

 b) Complete the negotiation but use a shorter lifetime than what was
   offered.

   Due to the fact that you can not alter the proposals presented by
   the initiator, another common solution to mismatched lifetimes is to
   accept the proposed lifetime of the initiator and delete the IKE SA
   when the shorter lifetime is exceeded.

   This however, can cause a "black hole" problem.

   Example:

   - Peer A initiates IKE to Peer B, proposing a lifetime of 1 year.
   - Peer Bs local policy says that lifetimes are acceptable only ifs
   they are 60 minutes.
   S. Fanning                                                         2

             Responder Lifetime Notify Message for IKE    December 2001

   - Peer B accepts the 1 year lifetime, but will send a DELETE
   notification when the 60 minutes is exceeded.

   However, in the case where Peer B sends a DELETE notify message and
   is not received by the Initiator (Peer A), the peer A will not
   delete its IKE SA until 1 year is up. Peer A will then send IKE
   messages that from Peer BĆs perspective cannot be authenticated.
   Peer A will now have that IKE SA information until it exceeds 1 year
   (or manual intervention removes it).

   Although some solutions will initiate a new IKE SA From Peer B to
   Peer A when an unauthenticated NOTIFY message is received, this
   behavior could facilitate a DoS attack unless some sort of rate
   limiting mechanism/logging facility was implemented.

   c) Complete the negotiation and send an advisory notification to the
   initiator indicating the responder's true lifetime.

   Since altering the proposal from the initiator is a violation of the
   IKE, there is no way to communicate to the initiator what IKE SA
   lifetime is being used by the responder another method of
   communicating this is required.

Mam właśnie coś takiego, po godzinie dzieją się dziwne rzeczy, tunel zachowuje się jak zombie,
niby żyje a nie żyje.
Dzięki za info, bo wiem, że to ten problem jeszcze mam do załatwienia
Nie używam już tej opcji (generate policies), okazała się niepotrzebna, dobrze sobie radzi z tymi regułami z setkey.conf.
Firewall skonfigurowałem w firewall.user, ale zamiast postrouting_rule musiałem wpisać POSTROUTING i dopiero zaczęło działać właściwie. Może jeszcze jakieś błędy, ale narazie walczę ze stabilnością.
Pozdrawiam

Łukasz

60 (edytowany przez rpc 2011-02-19 22:34:38)

Odp: IPsec a nowy kernel 2.6.32.27

dziwne jeśli to co dałeś w logu jest ok to postrouting_rule winien załatwić bezproblemowo sprawę bo jest przed nat i nie jest przypisany do iface
tam przenieśli nat_reflection może on zaburza całą sprawę
trzeba by sprawdzić czy reguły dodają się przed nat reflection w postrouting_rule
u mnie sprawdziłem regułki dodają się przed nat_reflection wiec mimo wszystko powinno być ok w łańcuchu postrouting_rule

jeśli możesz pokaż log ze swojego routera

/etc/init.d/racoon stop
racoon -F -f /etc/racoon/racoon.conf 

pingnij z lan siec odległą aby wszystko się zestawiło
i wklej tu log
i pokaż jeszcze raz plik z konfiguracją /etc/racoon/racoon.conf

jeszcze jedno
to wycinek twojego logu

192.168.223.0/27[any] 172.20.35.0/27[any] any
        out prio def ipsec
        esp/tunnel/83.220.8.58-217.97.*.174/require
        created: Feb  9 08:01:41 2011  lastused: Feb  9 08:03:50 2011
        lifetime: 3600(s) validtime: 0(s)
        spid=625 seq=1 pid=16275
        refcnt=3

zerknij na lifetime i masz swoją godzinę smile

61

Odp: IPsec a nowy kernel 2.6.32.27

Ok, ale chyba dopiero w poniedziałek, bo mi wszystkie komputery w Lanie powyłączali.
Miłego wieczoru

Pozdro

62

Odp: IPsec a nowy kernel 2.6.32.27

możesz pingnąć interfejs lan routera będzie to samo. Poza tym nie musisz mieć kompów odpalonych aby zestawił się tunel wystarczy tylko ping nawet jeśli host z drugiej strony jest wyłączony

63

Odp: IPsec a nowy kernel 2.6.32.27

Cześć,
Zrobiłem jak proponowałeś, zestawił mi się tunel

jeszcze jedno
to wycinek twojego logu

192.168.223.0/27[any] 172.20.35.0/27[any] any
        out prio def ipsec
        esp/tunnel/83.220.8.58-217.97.*.174/require
        created: Feb  9 08:01:41 2011  lastused: Feb  9 08:03:50 2011
        lifetime: 3600(s) validtime: 0(s)
        spid=625 seq=1 pid=16275
        refcnt=3

zerknij na lifetime i masz swoją godzinę 

Dobrze, że mi na to zwróciłeś uwagę, ale to niestety dotyczy poprzednich połączeń tych z Dlinkiem, teraz podłączam się do cisco.

To otrzymałem po wpisaniu

root@Gargoyle:~# racoon -F -f /etc/racoon/racoon.conf
Foreground mode.
2011-02-20 22:01:03: INFO: @(#)ipsec-tools 0.7.3 (http://ipsec-tools.sourceforge.net)
2011-02-20 22:01:03: INFO: @(#)This product linked OpenSSL 0.9.8p 16 Nov 2010 (http://www.openssl.org/)
2011-02-20 22:01:03: INFO: Reading configuration from "/etc/racoon/racoon.conf"
2011-02-20 22:01:03: INFO: 83.220.*.139[4500] used as isakmp port (fd=7)
2011-02-20 22:01:03: INFO: 83.220.*.139[4500] used for NAT-T
2011-02-20 22:01:03: INFO: 83.220.*.139[500] used as isakmp port (fd=8)
2011-02-20 22:01:03: INFO: 83.220.*.139[500] used for NAT-T
2011-02-20 22:01:14: INFO: IPsec-SA request for 195.177.*.157 queued due to no phase1 found.
2011-02-20 22:01:14: INFO: initiate new phase 1 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
2011-02-20 22:01:14: INFO: begin Identity Protection mode.
2011-02-20 22:01:14: INFO: received Vendor ID: CISCO-UNITY
2011-02-20 22:01:14: INFO: received Vendor ID: DPD
2011-02-20 22:01:14: INFO: received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt
2011-02-20 22:01:15: INFO: ISAKMP-SA established 83.220.*.139[500]-195.177.*.157[500] spi:54183de017b34cde:4b8ee0548095cf33
2011-02-20 22:01:15: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
2011-02-20 22:01:15: WARNING: ignore RESPONDER-LIFETIME notification.
2011-02-20 22:01:15: WARNING: attribute has been modified.
2011-02-20 22:01:15: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=259400015(0xf76214f)
2011-02-20 22:01:15: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=2221458460(0x8468c41c)
2011-02-20 22:04:25: INFO: ISAKMP-SA expired 83.220.*.139[500]-195.177.*.157[500] spi:54183de017b34cde:4b8ee0548095cf33
2011-02-20 22:04:26: INFO: ISAKMP-SA deleted 83.220.*.139[500]-195.177.*.157[500] spi:54183de017b34cde:4b8ee0548095cf33

Martwią mnie te wpisy
WARNING: ignore RESPONDER-LIFETIME notification.
to informacja dotycząca niezgodności ważności połączenia tunelu.

Po wpisaniu setkey -DP
Otrzymałem:

root@Gargoyle:~# setkey -DP
150.2.0.0/16[any] 172.16.200.240/28[any] any
        fwd prio def ipsec
        esp/tunnel/195.177.*.157-83.220.*.139/require
        created: Feb 19 14:00:19 2011  lastused: Feb 19 14:00:45 2011
        lifetime: 0(s) validtime: 0(s)
        spid=474 seq=1 pid=27770
        refcnt=1
150.2.0.0/16[any] 172.16.200.240/28[any] any
        in prio def ipsec
        esp/tunnel/195.177.*.157-83.220.*.139/require
        created: Feb 19 14:00:19 2011  lastused: Feb 20 17:53:01 2011
        lifetime: 0(s) validtime: 0(s)
        spid=464 seq=2 pid=27770
        refcnt=1
172.16.200.240/28[any] 150.2.0.0/16[any] any
        out prio def ipsec
        esp/tunnel/83.220.*.139-195.177.*.157/require
        created: Feb 19 14:00:19 2011  lastused: Feb 20 21:53:28 2011
        lifetime: 0(s) validtime: 0(s)
        spid=457 seq=0 pid=27770
        refcnt=1

Wysłałem zapytanie dotyczące potwierdzenia tych czasów, ale niestety dopiero jutro będę miał odpowiedź.

Pozdrawiam

Łukasz

64

Odp: IPsec a nowy kernel 2.6.32.27

to ja jeszcze poprosze

racoon -F -v -f /etc/racoon/racoon.conf

tak jak wyżej z nawiązania połaczenia

65

Odp: IPsec a nowy kernel 2.6.32.27

Cześć,

Oto logi:

root@Gargoyle:~# racoon -F -v -f /etc/racoon/racoon.conf
Foreground mode.
2011-02-21 20:48:41: INFO: @(#)ipsec-tools 0.7.3 (http://ipsec-tools.sourceforge.net)
2011-02-21 20:48:41: INFO: @(#)This product linked OpenSSL 0.9.8p 16 Nov 2010 (http://www.openssl.org/)
2011-02-21 20:48:41: INFO: Reading configuration from "/etc/racoon/racoon.conf"
2011-02-21 20:48:41: INFO: 83.220.*.139[4500] used as isakmp port (fd=7)
2011-02-21 20:48:41: INFO: 83.220.*.139[4500] used for NAT-T
2011-02-21 20:48:41: INFO: 83.220.*.139[500] used as isakmp port (fd=8)
2011-02-21 20:48:41: INFO: 83.220.*.139[500] used for NAT-T
2011-02-21 20:48:49: INFO: IPsec-SA request for 195.177.*.157 queued due to no phase1 found.
2011-02-21 20:48:49: INFO: initiate new phase 1 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
2011-02-21 20:48:49: INFO: begin Identity Protection mode.
2011-02-21 20:48:49: INFO: received Vendor ID: CISCO-UNITY
2011-02-21 20:48:49: INFO: received Vendor ID: DPD
2011-02-21 20:48:49: INFO: received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt
2011-02-21 20:48:49: INFO: ISAKMP-SA established 83.220.*.139[500]-195.177.*.157[500] spi:844896af517ff6dc:4b8ee054cc3b3055
2011-02-21 20:48:50: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
2011-02-21 20:48:51: WARNING: ignore RESPONDER-LIFETIME notification.
2011-02-21 20:48:51: WARNING: attribute has been modified.
2011-02-21 20:48:51: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=241506588(0xe65191c)
2011-02-21 20:48:51: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=574528324(0x223e9b44)

lifetime ISAKAMP-SA to 86400
a ipsec 3600

Nie wiem już co nie gra, może Ty masz jakieś sugestie..

Łukasz

66

Odp: IPsec a nowy kernel 2.6.32.27

to nie są pełne logi są bardzo ubogie
muszę sprawdzić czy sie coś nie zmieniło.

67 (edytowany przez lukaszp 2011-02-22 08:19:41)

Odp: IPsec a nowy kernel 2.6.32.27

Tyle mi się wyświetla po wpisaniu tego co proponowałeś..

Po wpisaniu w racoon.conf poziomu logowania z "info" na "debug2" i daniu opcji -v przy uruchomieniu
racoon -F -v -f /etc/racoon/racoon.conf otrzymałem

root@Gargoyle:~# racoon -F -v -f /etc/racoon/racoon.conf
Foreground mode.
2011-02-22 08:10:29: INFO: @(#)ipsec-tools 0.7.3 (http://ipsec-tools.sourceforge.net)
2011-02-22 08:10:29: INFO: @(#)This product linked OpenSSL 0.9.8p 16 Nov 2010 (http://www.openssl.org/)
2011-02-22 08:10:29: INFO: Reading configuration from "/etc/racoon/racoon.conf"
2011-02-22 08:10:29: DEBUG2: lifetime = 86400
2011-02-22 08:10:29: DEBUG2: lifebyte = 0
2011-02-22 08:10:29: DEBUG2: encklen=0
2011-02-22 08:10:29: DEBUG2: p:1 t:1
2011-02-22 08:10:29: DEBUG2: 3DES-CBC(5)
2011-02-22 08:10:29: DEBUG2: MD5(1)
2011-02-22 08:10:29: DEBUG2: 1024-bit MODP group(2)
2011-02-22 08:10:29: DEBUG2: pre-shared key(1)
2011-02-22 08:10:29: DEBUG2:
2011-02-22 08:10:29: DEBUG: compression algorithm can not be checked because sadb message doesn't support it.
2011-02-22 08:10:29: DEBUG: getsainfo params: loc='ANONYMOUS', rmt='ANONYMOUS', peer='NULL', id=0
2011-02-22 08:10:29: DEBUG: getsainfo pass #2
2011-02-22 08:10:29: DEBUG2: parse successed.
2011-02-22 08:10:29: DEBUG: open /var/racoon/racoon.sock as racoon management.
2011-02-22 08:10:29: INFO: 83.220.*.139[500] used as isakmp port (fd=7)
2011-02-22 08:10:29: INFO: 83.220.*.139[500] used for NAT-T
2011-02-22 08:10:29: DEBUG: pk_recv: retry[0] recv()
2011-02-22 08:10:29: DEBUG: get pfkey X_SPDDUMP message
2011-02-22 08:10:29: DEBUG2:
02120000 001c0001 00000001 0000329a 00030005 ff100000 00020000 96020000
00000000 00000000 00030006 ff1c0000 00020000 ac10c8f0 00000000 00000000
00040003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040004 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040002 00000000 00000000 00000000 00000000 4d624fde 00000000 00000000
00080012 00020300 0000005a 80000000 00300032 02020000 00000000 00000000
00020000 c3b1d49d 00000000 00000000 00020000 53dc668b 00000000 00000000
2011-02-22 08:10:29: DEBUG: pk_recv: retry[0] recv()
2011-02-22 08:10:29: DEBUG: get pfkey X_SPDDUMP message
2011-02-22 08:10:29: DEBUG2:
02120000 001c0001 00000002 0000329a 00030005 ff100000 00020000 96020000
00000000 00000000 00030006 ff1c0000 00020000 ac10c8f0 00000000 00000000
00040003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040004 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040002 00000000 00000000 00000000 00000000 4d624fde 00000000 4d62c2e1
00080012 00020100 00000050 80000000 00300032 02020000 00000000 00000000
00020000 c3b1d49d 00000000 00000000 00020000 53dc668b 00000000 00000000
2011-02-22 08:10:29: DEBUG: sub:0x7fd25328: 150.2.0.0/16[0] 172.16.200.240/28[0] proto=any dir=in
2011-02-22 08:10:29: DEBUG: db :0x489590: 150.2.0.0/16[0] 172.16.200.240/28[0] proto=any dir=fwd
2011-02-22 08:10:29: DEBUG: pk_recv: retry[0] recv()
2011-02-22 08:10:29: DEBUG: get pfkey X_SPDDUMP message
2011-02-22 08:10:29: DEBUG2:
02120000 001c0003 00000000 0000329a 00030005 ff1c0000 00020000 ac10c8f0
00000000 00000000 00030006 ff100000 00020000 96020000 00000000 00000000
00040003 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040004 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00040002 00000000 00000000 00000000 00000000 4d624fde 00000000 4d636126
00080012 00020200 00000049 80000000 00300032 02020000 00000000 00000000
00020000 53dc668b 00000000 00000000 00020000 c3b1d49d 00000000 00000000
2011-02-22 08:10:29: DEBUG: sub:0x7fd25328: 172.16.200.240/28[0] 150.2.0.0/16[0] proto=any dir=out
2011-02-22 08:10:29: DEBUG: db :0x489590: 150.2.0.0/16[0] 172.16.200.240/28[0] proto=any dir=fwd
2011-02-22 08:10:29: DEBUG: sub:0x7fd25328: 172.16.200.240/28[0] 150.2.0.0/16[0] proto=any dir=out
2011-02-22 08:10:29: DEBUG: db :0x489cb8: 150.2.0.0/16[0] 172.16.200.240/28[0] proto=any dir=in
2011-02-22 08:12:50: DEBUG: begin decryption.
2011-02-22 08:12:50: DEBUG: encryption(3des)
2011-02-22 08:12:50: DEBUG: IV was saved for next processing:
2011-02-22 08:12:50: DEBUG:
68761454 0cec9e91
2011-02-22 08:12:50: DEBUG: encryption(3des)
2011-02-22 08:12:50: DEBUG: with key:
2011-02-22 08:12:50: DEBUG:
78b4107f 4bf0c85f ddb2fc40 3630e912 832ec3e1 f4f07df6
2011-02-22 08:12:50: DEBUG: decrypted payload by IV:
2011-02-22 08:12:50: DEBUG:
64c0e5bf 7902c6ae
2011-02-22 08:12:50: DEBUG: decrypted payload, but not trimed.
2011-02-22 08:12:50: DEBUG:
01000014 b5a1a711 d301d6ec be6702ec 0084cef0 0a000034 00000001 00000001
00000028 01030401 d26a4eb1 0000001c 01030000 80040001 80010001 80020e10
80050001 80030002 04000018 6b538440 b9703d00 d84e4c73 f9e0051f 90aa3e06
05000084 4d65c8df 20755dee f21be7e1 56a61a0d 4916afef 0becc8f8 83164b2f
108e3343 7aec279f f059dfe9 ceb336b0 d499932f 5b45ce44 dabfdfa3 e761fb42
ef82c7ec 3c1294e7 d366889c 4ca261cc 63b3310b 5fd34c59 17e9eaab 7ba264d6
76bcdd15 8f971898 07194208 f8c252ae ac9d4354 5b6302e2 32cfcac1 ede4b9af
270b824e 05000010 04000000 ac10c8f0 fffffff0 0b000010 04000000 96020000
ffff0000 0000001c 00000001 03046000 d26a4eb1 80010002 00020004 00465000
00000000 00000000
2011-02-22 08:12:50: DEBUG: padding len=1
2011-02-22 08:12:50: DEBUG: skip to trim padding.
2011-02-22 08:12:50: DEBUG: decrypted.
2011-02-22 08:12:50: DEBUG:
73a05440 499ef07e 4b8ee054 f540b8d9 08102001 958d0b5a 00000144 01000014
b5a1a711 d301d6ec be6702ec 0084cef0 0a000034 00000001 00000001 00000028
01030401 d26a4eb1 0000001c 01030000 80040001 80010001 80020e10 80050001
80030002 04000018 6b538440 b9703d00 d84e4c73 f9e0051f 90aa3e06 05000084
4d65c8df 20755dee f21be7e1 56a61a0d 4916afef 0becc8f8 83164b2f 108e3343
7aec279f f059dfe9 ceb336b0 d499932f 5b45ce44 dabfdfa3 e761fb42 ef82c7ec
3c1294e7 d366889c 4ca261cc 63b3310b 5fd34c59 17e9eaab 7ba264d6 76bcdd15
8f971898 07194208 f8c252ae ac9d4354 5b6302e2 32cfcac1 ede4b9af 270b824e
05000010 04000000 ac10c8f0 fffffff0 0b000010 04000000 96020000 ffff0000
0000001c 00000001 03046000 d26a4eb1 80010002 00020004 00465000 00000000
00000000
2011-02-22 08:12:50: DEBUG: begin.
2011-02-22 08:12:50: DEBUG: seen nptype=8(hash)
2011-02-22 08:12:50: DEBUG: seen nptype=1(sa)
2011-02-22 08:12:50: DEBUG: seen nptype=10(nonce)
2011-02-22 08:12:50: DEBUG: seen nptype=4(ke)
2011-02-22 08:12:50: DEBUG: seen nptype=5(id)
2011-02-22 08:12:50: DEBUG: seen nptype=5(id)
2011-02-22 08:12:50: DEBUG: seen nptype=11(notify)
2011-02-22 08:12:50: DEBUG: succeed.
2011-02-22 08:12:50: DEBUG: Notify Message received
2011-02-22 08:12:50: WARNING: ignore RESPONDER-LIFETIME notification.
2011-02-22 08:12:50: DEBUG: HASH allocated:hbuf->l=312 actual:tlen=284
2011-02-22 08:12:50: DEBUG: HASH(2) received:2011-02-22 08:12:50: DEBUG:
b5a1a711 d301d6ec be6702ec 0084cef0
2011-02-22 08:12:50: DEBUG: HASH with:
2011-02-22 08:12:50: DEBUG:
958d0b5a f9842b0d d4a39255 7276b923 b6b4b5b6 0a000034 00000001 00000001
00000028 01030401 d26a4eb1 0000001c 01030000 80040001 80010001 80020e10
80050001 80030002 04000018 6b538440 b9703d00 d84e4c73 f9e0051f 90aa3e06
05000084 4d65c8df 20755dee f21be7e1 56a61a0d 4916afef 0becc8f8 83164b2f
108e3343 7aec279f f059dfe9 ceb336b0 d499932f 5b45ce44 dabfdfa3 e761fb42
ef82c7ec 3c1294e7 d366889c 4ca261cc 63b3310b 5fd34c59 17e9eaab 7ba264d6
76bcdd15 8f971898 07194208 f8c252ae ac9d4354 5b6302e2 32cfcac1 ede4b9af
270b824e 05000010 04000000 ac10c8f0 fffffff0 0b000010 04000000 96020000
ffff0000 0000001c 00000001 03046000 d26a4eb1 80010002 00020004 00465000
2011-02-22 08:12:50: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:50: DEBUG: HASH computed:
2011-02-22 08:12:50: DEBUG:
b5a1a711 d301d6ec be6702ec 0084cef0
2011-02-22 08:12:50: DEBUG: total SA len=48
2011-02-22 08:12:50: DEBUG:
00000001 00000001 00000028 01030401 06bd2074 0000001c 01030000 80010001
80020e10 80040001 80050001 80030002
2011-02-22 08:12:50: DEBUG: begin.
2011-02-22 08:12:50: DEBUG: seen nptype=2(prop)
2011-02-22 08:12:50: DEBUG: succeed.
2011-02-22 08:12:50: DEBUG: proposal #1 len=40
2011-02-22 08:12:50: DEBUG: begin.
2011-02-22 08:12:50: DEBUG: seen nptype=3(trns)
2011-02-22 08:12:50: DEBUG: succeed.
2011-02-22 08:12:50: DEBUG: transform #1 len=28
2011-02-22 08:12:50: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds
2011-02-22 08:12:50: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600
2011-02-22 08:12:50: DEBUG: life duration was in TLV.
2011-02-22 08:12:50: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Tunnel
2011-02-22 08:12:50: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-md5
2011-02-22 08:12:50: DEBUG: type=Group Description, flag=0x8000, lorv=2
2011-02-22 08:12:50: DEBUG: hmac(modp1024)
2011-02-22 08:12:50: DEBUG: pair 1:
2011-02-22 08:12:50: DEBUG:  0x48c0d0: next=(nil) tnext=(nil)
2011-02-22 08:12:50: DEBUG: proposal #1: 1 transform
2011-02-22 08:12:50: DEBUG: total SA len=48
2011-02-22 08:12:50: DEBUG:
00000001 00000001 00000028 01030401 d26a4eb1 0000001c 01030000 80040001
80010001 80020e10 80050001 80030002
2011-02-22 08:12:50: DEBUG: begin.
2011-02-22 08:12:50: DEBUG: seen nptype=2(prop)
2011-02-22 08:12:50: DEBUG: succeed.
2011-02-22 08:12:50: DEBUG: proposal #1 len=40
2011-02-22 08:12:50: DEBUG: begin.
2011-02-22 08:12:50: DEBUG: seen nptype=3(trns)
2011-02-22 08:12:50: DEBUG: succeed.
2011-02-22 08:12:50: DEBUG: transform #1 len=28
2011-02-22 08:12:50: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Tunnel
2011-02-22 08:12:50: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds
2011-02-22 08:12:50: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600
2011-02-22 08:12:50: DEBUG: life duration was in TLV.
2011-02-22 08:12:50: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-md5
2011-02-22 08:12:50: DEBUG: type=Group Description, flag=0x8000, lorv=2
2011-02-22 08:12:50: DEBUG: hmac(modp1024)
2011-02-22 08:12:50: DEBUG: pair 1:
2011-02-22 08:12:50: DEBUG:  0x48be40: next=(nil) tnext=(nil)
2011-02-22 08:12:50: DEBUG: proposal #1: 1 transform
2011-02-22 08:12:50: WARNING: attribute has been modified.
2011-02-22 08:12:50: DEBUG: begin compare proposals.
2011-02-22 08:12:50: DEBUG: pair[1]: 0x48be40
2011-02-22 08:12:50: DEBUG:  0x48be40: next=(nil) tnext=(nil)
2011-02-22 08:12:50: DEBUG: prop#=1 prot-id=ESP spi-size=4 #trns=1 trns#=1 trns-id=3DES
2011-02-22 08:12:50: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Tunnel
2011-02-22 08:12:50: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds
2011-02-22 08:12:50: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600
2011-02-22 08:12:50: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-md5
2011-02-22 08:12:50: DEBUG: type=Group Description, flag=0x8000, lorv=2
2011-02-22 08:12:50: DEBUG: peer's single bundle:
2011-02-22 08:12:50: DEBUG:  (proto_id=ESP spisize=4 spi=d26a4eb1 spi_p=00000000 encmode=Tunnel reqid=0:0)
2011-02-22 08:12:50: DEBUG:   (trns_id=3DES encklen=0 authtype=hmac-md5)
2011-02-22 08:12:50: DEBUG: my single bundle:
2011-02-22 08:12:50: DEBUG:  (proto_id=ESP spisize=4 spi=06bd2074 spi_p=00000000 encmode=Tunnel reqid=0:0)
2011-02-22 08:12:50: DEBUG:   (trns_id=3DES encklen=0 authtype=hmac-md5)
2011-02-22 08:12:50: DEBUG: matched
2011-02-22 08:12:50: DEBUG: ===
2011-02-22 08:12:50: DEBUG: HASH(3) generate
2011-02-22 08:12:50: DEBUG: HASH with:
2011-02-22 08:12:50: DEBUG:
00958d0b 5af9842b 0dd4a392 557276b9 23b6b4b5 b66b5384 40b9703d 00d84e4c
73f9e005 1f90aa3e 06
2011-02-22 08:12:50: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:50: DEBUG: HASH computed:
2011-02-22 08:12:50: DEBUG:
ead1aaf8 d9bf7596 0c5202fd 8518a1f8
2011-02-22 08:12:50: DEBUG: add payload of len 16, next type 0
2011-02-22 08:12:50: DEBUG: begin encryption.
2011-02-22 08:12:50: DEBUG: encryption(3des)
2011-02-22 08:12:50: DEBUG: pad length = 4
2011-02-22 08:12:50: DEBUG:
00000014 ead1aaf8 d9bf7596 0c5202fd 8518a1f8 431ebe03
2011-02-22 08:12:50: DEBUG: encryption(3des)
2011-02-22 08:12:50: DEBUG: with key:
2011-02-22 08:12:50: DEBUG:
78b4107f 4bf0c85f ddb2fc40 3630e912 832ec3e1 f4f07df6
2011-02-22 08:12:50: DEBUG: encrypted payload by IV:
2011-02-22 08:12:50: DEBUG:
68761454 0cec9e91
2011-02-22 08:12:50: DEBUG: save IV for next:
2011-02-22 08:12:50: DEBUG:
965a225c 3be5c5eb
2011-02-22 08:12:50: DEBUG: encrypted.
2011-02-22 08:12:50: DEBUG: 52 bytes from 83.220.*.139[500] to 195.177.*.157[500]
2011-02-22 08:12:50: DEBUG: sockname 83.220.*.139[500]
2011-02-22 08:12:50: DEBUG: send packet from 83.220.*.139[500]
2011-02-22 08:12:50: DEBUG: send packet to 195.177.*.157[500]
2011-02-22 08:12:50: DEBUG: src4 83.220.*.139[500]
2011-02-22 08:12:50: DEBUG: dst4 195.177.*.157[500]
2011-02-22 08:12:50: DEBUG: 1 times of 52 bytes message will be sent to 195.177.*.157[500]
2011-02-22 08:12:50: DEBUG:
73a05440 499ef07e 4b8ee054 f540b8d9 08102001 958d0b5a 00000034 ebc50aee
7588c830 691a8d37 7eaa7eb9 965a225c 3be5c5eb
2011-02-22 08:12:51: DEBUG: compute DH's shared.
2011-02-22 08:12:51: DEBUG:
186de190 1248292e bd339d05 af21a5cd 71412fd5 a1e6aa8b fd3b3ed9 9a0bd5eb
06d2334e df3e99b7 9513cc2d b447cf60 8181dcee 851c9054 288290b4 139c5ce0
70160b04 14762276 d1d90069 1ae4a384 e529fece 68aabccb 6c4fb2b8 b6546b78
63640c9f e213705f 7b11cb12 9efd9aa8 acb12bcd 84801f09 098526bf 07707814
2011-02-22 08:12:51: DEBUG: KEYMAT compute with
2011-02-22 08:12:51: DEBUG:
186de190 1248292e bd339d05 af21a5cd 71412fd5 a1e6aa8b fd3b3ed9 9a0bd5eb
06d2334e df3e99b7 9513cc2d b447cf60 8181dcee 851c9054 288290b4 139c5ce0
70160b04 14762276 d1d90069 1ae4a384 e529fece 68aabccb 6c4fb2b8 b6546b78
63640c9f e213705f 7b11cb12 9efd9aa8 acb12bcd 84801f09 098526bf 07707814
0306bd20 74f9842b 0dd4a392 557276b9 23b6b4b5 b66b5384 40b9703d 00d84e4c
73f9e005 1f90aa3e 06
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: encryption(3des)
2011-02-22 08:12:51: DEBUG: hmac(md5)
2011-02-22 08:12:51: DEBUG: encklen=192 authklen=128
2011-02-22 08:12:51: DEBUG: generating 512 bits of key (dupkeymat=4)
2011-02-22 08:12:51: DEBUG: generating K1...K4 for KEYMAT.
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG:
25e5f5c4 7c3dc88d 226d0f6c abbf6ab9 248fa104 1e615041 5781a78a b0f1a172
ffe20b8d 67bf2d02 c8bf8160 f97e4ee6 e69feb8a 13216dc2 c8ecc18b 969cd0d4
2011-02-22 08:12:51: DEBUG: KEYMAT compute with
2011-02-22 08:12:51: DEBUG:
186de190 1248292e bd339d05 af21a5cd 71412fd5 a1e6aa8b fd3b3ed9 9a0bd5eb
06d2334e df3e99b7 9513cc2d b447cf60 8181dcee 851c9054 288290b4 139c5ce0
70160b04 14762276 d1d90069 1ae4a384 e529fece 68aabccb 6c4fb2b8 b6546b78
63640c9f e213705f 7b11cb12 9efd9aa8 acb12bcd 84801f09 098526bf 07707814
03d26a4e b1f9842b 0dd4a392 557276b9 23b6b4b5 b66b5384 40b9703d 00d84e4c
73f9e005 1f90aa3e 06
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: encryption(3des)
2011-02-22 08:12:51: DEBUG: hmac(md5)
2011-02-22 08:12:51: DEBUG: encklen=192 authklen=128
2011-02-22 08:12:51: DEBUG: generating 512 bits of key (dupkeymat=4)
2011-02-22 08:12:51: DEBUG: generating K1...K4 for KEYMAT.
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG: hmac(hmac_md5)
2011-02-22 08:12:51: DEBUG:
c93cec39 64efe0ee 59d06a02 265ee264 487b4025 211c9731 167acbe9 0f471185
948e22a6 fb32d15c 2e00c9bc e09aa038 4a8e746c 0a881599 519be8c6 72b1d26c
2011-02-22 08:12:51: DEBUG: KEYMAT computed.
2011-02-22 08:12:51: DEBUG: call pk_sendupdate
2011-02-22 08:12:51: DEBUG: encryption(3des)
2011-02-22 08:12:51: DEBUG: hmac(md5)
2011-02-22 08:12:51: DEBUG: call pfkey_send_update2
2011-02-22 08:12:51: DEBUG: pfkey update sent.
2011-02-22 08:12:51: DEBUG: encryption(3des)
2011-02-22 08:12:51: DEBUG: hmac(md5)
2011-02-22 08:12:51: DEBUG: call pfkey_send_add2 (NAT flavor)
2011-02-22 08:12:51: DEBUG: call pfkey_send_add2
2011-02-22 08:12:51: DEBUG: pfkey add sent.
2011-02-22 08:12:51: DEBUG: pk_recv: retry[0] recv()
2011-02-22 08:12:51: DEBUG: get pfkey UPDATE message
2011-02-22 08:12:51: DEBUG2:
02020003 00220000 00000017 000033c9 00020001 06bd2074 04010203 00000000
00040003 00000000 00000000 00000000 00000000 00000e10 00000000 00000000
00040004 00000000 00000000 00000000 00000000 00000b40 00000000 00000000
00040002 00000000 00000000 00000000 00000000 4d6361f3 00000000 00000000
00030005 00200000 00020000 c3b1d49d 00000000 00000000 00030006 00200000
00020000 53dc668b 00000000 00000000 00030007 ff000000 00020000 00000000
00000000 00000000 00030008 00800000 5781a78a b0f1a172 ffe20b8d 67bf2d02
00040009 00c00000 25e5f5c4 7c3dc88d 226d0f6c abbf6ab9 248fa104 1e615041
00020013 02000000 00000000 00000000
2011-02-22 08:12:51: DEBUG: pfkey UPDATE succeeded: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=113057908(0x6bd2074)
2011-02-22 08:12:51: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=113057908(0x6bd2074)
2011-02-22 08:12:51: DEBUG: ===
2011-02-22 08:12:51: DEBUG: pk_recv: retry[0] recv()
2011-02-22 08:12:51: DEBUG: get pfkey ADD message
2011-02-22 08:12:51: DEBUG2:
02030003 00220000 00000017 000033c9 00020001 d26a4eb1 04010203 00000000
00040003 00000000 00000000 00000000 00000000 00000e10 00000000 00000000
00040004 00000000 00000000 00000000 00000000 00000b40 00000000 00000000
00040002 00000000 00000000 00000000 00000000 4d6361f3 00000000 00000000
00030005 00200000 00020000 53dc668b 00000000 00000000 00030006 00200000
00020000 c3b1d49d 00000000 00000000 00030007 ff000000 00020000 00000000
00000000 00000000 00030008 00800000 167acbe9 0f471185 948e22a6 fb32d15c
00040009 00c00000 c93cec39 64efe0ee 59d06a02 265ee264 487b4025 211c9731
00020013 02000000 00000000 00000000
2011-02-22 08:12:51: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=3530182321(0xd26a4eb1)
2011-02-22 08:12:51: DEBUG: ===

Mam ndzieję, że trochę to pomoże.
Pozdrawiam

Łukasz

68 (edytowany przez rpc 2011-02-22 15:11:34)

Odp: IPsec a nowy kernel 2.6.32.27

zmień do testu  w sainfo na

sainfo anonymous {
........................................
        lifetime time 60 sec;
............................................
}

i zobacz co się będzie działo ?

szkoda że nie masz możliwości dostania logów z cisco
show debug
z połączenia
tam by były przydatne informacje (szukać po RESPONDER-LIFETIME")

69 (edytowany przez lukaszp 2011-02-26 13:16:34)

Odp: IPsec a nowy kernel 2.6.32.27

Witam,

RPC zmieniłem ten wpis lifetime time 60sec i muszę powiedzieć, że się trochę zdziwiłem efektami, a oto one:

Feb 25 19:20:47 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:21:02 Gargoyle daemon.info racoon: ERROR: 195.177.*.157 give up to get IPsec-SA due to time up to wait.
Feb 25 19:21:17 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=145499738(0x8ac265a)
Feb 25 19:23:17 Gargoyle daemon.info racoon: INFO: caught signal 15
Feb 25 19:23:18 Gargoyle daemon.info racoon: INFO: racoon shutdown
Feb 25 19:23:23 Gargoyle daemon.info racoon: INFO: @(#)ipsec-tools 0.7.3 (http://ipsec-tools.sourceforge.net)
Feb 25 19:23:23 Gargoyle daemon.info racoon: INFO: @(#)This product linked OpenSSL 0.9.8p 16 Nov 2010 (http://www.openssl.org/)
Feb 25 19:23:23 Gargoyle daemon.info racoon: INFO: Reading configuration from "/etc/racoon/racoon.conf"
Feb 25 19:23:23 Gargoyle daemon.info racoon: INFO: 83.220.*.139[500] used as isakmp port (fd=8)
Feb 25 19:23:23 Gargoyle daemon.info racoon: INFO: 83.220.*.139[500] used for NAT-T
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: IPsec-SA request for 195.177.*.157 queued due to no phase1 found.
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: initiate new phase 1 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: begin Identity Protection mode.
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: received Vendor ID: CISCO-UNITY
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: received Vendor ID: DPD
Feb 25 19:23:43 Gargoyle daemon.info racoon: INFO: received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt
Feb 25 19:23:44 Gargoyle daemon.info racoon: INFO: ISAKMP-SA established 83.220.*.139[500]-195.177.*.157[500] spi:9d829c83aceb4d22:4b8ee0549ee90473
Feb 25 19:23:45 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:23:45 Gargoyle daemon.info racoon: WARNING: ignore RESPONDER-LIFETIME notification.
Feb 25 19:23:45 Gargoyle daemon.info racoon: WARNING: attribute has been modified.
Feb 25 19:23:45 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=105073485(0x6434b4d)
Feb 25 19:23:45 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=933278590(0x37a0b37e)
Feb 25 19:24:33 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=105073485(0x6434b4d)
Feb 25 19:24:33 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:24:33 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=933278590(0x37a0b37e)
Feb 25 19:24:34 Gargoyle daemon.info racoon: WARNING: ignore RESPONDER-LIFETIME notification.
Feb 25 19:24:34 Gargoyle daemon.info racoon: WARNING: attribute has been modified.
Feb 25 19:24:34 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=107799454(0x66ce39e)
Feb 25 19:24:34 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=1415218689(0x545a8601)
Feb 25 19:24:45 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=105073485(0x6434b4d)
Feb 25 19:24:45 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=933278590(0x37a0b37e)
Feb 25 19:25:22 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=107799454(0x66ce39e)
Feb 25 19:25:22 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:25:22 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=1415218689(0x545a8601)
Feb 25 19:25:22 Gargoyle daemon.info racoon: WARNING: ignore RESPONDER-LIFETIME notification.
Feb 25 19:25:22 Gargoyle daemon.info racoon: WARNING: attribute has been modified.
Feb 25 19:25:22 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=254031439(0xf24364f)
Feb 25 19:25:22 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=1384138092(0x5280456c)
Feb 25 19:25:34 Gargoyle daemon.info racoon: INFO: purged IPsec-SA proto_id=ESP spi=1415218689.
Feb 25 19:25:34 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=107799454(0x66ce39e)
Feb 25 19:25:51 Gargoyle daemon.info racoon: INFO: respond new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:25:51 Gargoyle daemon.info racoon: ERROR: long lifetime proposed: my:60 peer:3600
Feb 25 19:25:51 Gargoyle daemon.info racoon: ERROR: not matched
Feb 25 19:25:51 Gargoyle daemon.info racoon: ERROR: no suitable policy found.
Feb 25 19:25:51 Gargoyle daemon.info racoon: ERROR: failed to pre-process packet.
Feb 25 19:25:51 Gargoyle daemon.info racoon: INFO: ISAKMP-SA expired 83.220.*.139[500]-195.177.*.157[500] spi:9d829c83aceb4d22:4b8ee0549ee90473
Feb 25 19:25:52 Gargoyle daemon.info racoon: INFO: ISAKMP-SA deleted 83.220.*.139[500]-195.177.*.157[500] spi:9d829c83aceb4d22:4b8ee0549ee90473
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=254031439(0xf24364f)
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: IPsec-SA request for 195.177.*.157 queued due to no phase1 found.
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: initiate new phase 1 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: begin Identity Protection mode.
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=1384138092(0x5280456c)
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: received Vendor ID: CISCO-UNITY
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: received Vendor ID: DPD
Feb 25 19:26:10 Gargoyle daemon.info racoon: INFO: received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt
Feb 25 19:26:11 Gargoyle daemon.info racoon: INFO: ISAKMP-SA established 83.220.*.139[500]-195.177.*.157[500] spi:d2dd12ef47b8a81d:4b8ee054d539ab3d
Feb 25 19:26:12 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:26:12 Gargoyle daemon.info racoon: WARNING: ignore RESPONDER-LIFETIME notification.
Feb 25 19:26:12 Gargoyle daemon.info racoon: WARNING: attribute has been modified.
Feb 25 19:26:12 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=177227553(0xa904721)
Feb 25 19:26:12 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=2077639480(0x7bd64338)
Feb 25 19:26:22 Gargoyle daemon.info racoon: INFO: purged IPsec-SA proto_id=ESP spi=1384138092.
Feb 25 19:26:22 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=254031439(0xf24364f)
Feb 25 19:26:40 Gargoyle daemon.info racoon: INFO: respond new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:26:40 Gargoyle daemon.info racoon: ERROR: long lifetime proposed: my:60 peer:3600
Feb 25 19:26:40 Gargoyle daemon.info racoon: ERROR: not matched
Feb 25 19:26:40 Gargoyle daemon.info racoon: ERROR: no suitable policy found.
Feb 25 19:26:40 Gargoyle daemon.info racoon: ERROR: failed to pre-process packet.
Feb 25 19:26:41 Gargoyle daemon.info racoon: INFO: ISAKMP-SA expired 83.220.*.139[500]-195.177.*.157[500] spi:d2dd12ef47b8a81d:4b8ee054d539ab3d
Feb 25 19:26:42 Gargoyle daemon.info racoon: INFO: ISAKMP-SA deleted 83.220.*.139[500]-195.177.*.157[500] spi:d2dd12ef47b8a81d:4b8ee054d539ab3d
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=177227553(0xa904721)
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: IPsec-SA request for 195.177.*.157 queued due to no phase1 found.
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: initiate new phase 1 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: begin Identity Protection mode.
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=2077639480(0x7bd64338)
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: received Vendor ID: CISCO-UNITY
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: received Vendor ID: DPD
Feb 25 19:27:00 Gargoyle daemon.info racoon: INFO: received Vendor ID: draft-ietf-ipsra-isakmp-xauth-06.txt
Feb 25 19:27:01 Gargoyle daemon.info racoon: INFO: ISAKMP-SA established 83.220.*.139[500]-195.177.*.157[500] spi:9e0fa69e9182fa17:4b8ee054aee58581
Feb 25 19:27:01 Gargoyle daemon.info racoon: INFO: initiate new phase 2 negotiation: 83.220.*.139[500]<=>195.177.*.157[500]
Feb 25 19:27:01 Gargoyle daemon.info racoon: WARNING: ignore RESPONDER-LIFETIME notification.
Feb 25 19:27:01 Gargoyle daemon.info racoon: WARNING: attribute has been modified.
Feb 25 19:27:01 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=201166268(0xbfd8dbc)
Feb 25 19:27:01 Gargoyle daemon.info racoon: INFO: IPsec-SA established: ESP/Tunnel 83.220.*.139[500]->195.177.*.157[500] spi=2017132412(0x783aff7c)
Feb 25 19:27:12 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 195.177.*.157[0]->83.220.*.139[0] spi=177227553(0xa904721)
Feb 25 19:27:12 Gargoyle daemon.info racoon: INFO: IPsec-SA expired: ESP/Tunnel 83.220.*.139[0]->195.177.*.157[0] spi=2077639480(0x7bd64338)
Feb 25 19:27:31 Gargoyle daemon.info racoon: INFO: respond new phase 2 negotiation: 83.220.*.139[500]<=>195.177.212.157[500]
Feb 25 19:27:31 Gargoyle daemon.info racoon: ERROR: long lifetime proposed: my:60 peer:3600
Feb 25 19:27:31 Gargoyle daemon.info racoon: ERROR: not matched
Feb 25 19:27:31 Gargoyle daemon.info racoon: ERROR: no suitable policy found.
Feb 25 19:27:31 Gargoyle daemon.info racoon: ERROR: failed to pre-process packet.
Feb 25 19:27:31 Gargoyle daemon.info racoon: INFO: ISAKMP-SA expired 83.220.*.139[500]-195.177.*.157[500] spi:9e0fa69e9182fa17:4b8ee054aee58581
Feb 25 19:27:32 Gargoyle daemon.info racoon: INFO: ISAKMP-SA deleted 83.220.*.139[500]-195.177.*.157[500] spi:9e0fa69e9182fa17:4b8ee054aee58581

Ciekawe, że jak miałem wpisane 3600 to mi pisał, że "WARNING: ignore RESPONDER-LIFETIME notification."
Czy jakies jeszcze opcje są do dopisania? Może jakieś tajmery?
Dopisalem jeszcze:

padding
{
        maximum_length 20;      
        randomize off;          
        strict_check off;       
        exclusive_tail off;     
}
timer
{
        counter 5 ;              
        interval 20 sec ;        
        persend 1 ;              
        phase1 30 sec ;
        phase2 15 sec ;
}

Dzięki

Łukasz

70

Odp: IPsec a nowy kernel 2.6.32.27

Cześć,

RPC chciałem Cię prosić o wsparcie w kwestii tego ipsec'a,
Zmieniałem różne parametry w configu, ale efekt jest zawsze ten sam, że po wygaśnięciu ważności klucza tunel się nie
zestawia. Już nie wiem gdzie szukać problemów.
Może to jakiś urok trunka..

71

Odp: IPsec a nowy kernel 2.6.32.27

lukaszp: jabber

72 (edytowany przez lukaszp 2011-03-16 12:10:42)

Odp: IPsec a nowy kernel 2.6.32.27

Cześć,
Prośba do Cezarego, czy dało by rade przygotować paczki pasujące do aktualnego gargoylapl pod StrongSwan'a.
Część paczek jest już zaktualizowana, ale brakuje kmod-crypto-authenc i nie ma swana w repo, ale to pewnie da się zainstalować z oficjalnego repo openwrt. Dodatkowo swan potrzebuje jakiejś biblioteki libgmp.
Gwoli wyjaśnienia, to walczę jeszcze z tym ipsec'iem i nie łączy się w oczekiwany sposób, zgłasza błędy typu
"responder lifetime...." i po upływie godziny wygasa.
Jakby dało rade coś zrobić w kwestii tego strong swana to było by super, nie ukrywam, że gargoyle-pl przypadł mi do gustu
i nie chcę za dużo kombinować.
Dzięki

Pozdri

73

Odp: IPsec a nowy kernel 2.6.32.27

Pewnie by się dało. W sumie moje gargoylepl jest wymienne z moim backfire, wiec jak skompiluje to powinno działać.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

74 (edytowany przez lukaszp 2011-04-08 13:39:31)

Odp: IPsec a nowy kernel 2.6.32.27

Witam szanownych forumowiczów, minęło już trochę czasu od ostatniego wpisu na forum.
W tym czasie pracowałem nad ustanowieniem tunelu VPN opartym na IPSec. Początkowo sprawa dotyczyła
łącza 3g oraz openwrt w wersji gargoyle oraz oprogramowanie do VPN - racoon ( w oparciu o stronę kolegi RPC).
Od ostatniego posta zminiłem platformę sprzętową i możńa powiedzieć softową, ale już mniejszym wymiarze.
Początkowo tunel zestawiałem na WR1043ND i modemie 1750 huawei w sieci ERA ze stałym adresem IP, teraz uruchomiłem
wersję openwrt backfire na Routerstation PRO i stronSwan'ie.
Pierszy tunel na TP-linku w oparciu i gargoyla i racoon'a utrzymywał mi sie godzinę i nie był to błąd w konfiguracji samego racoona, a przynajmniej jakiś prosty błąd.
Po zmianie na RS PRO, backfire i Strongswan router działa z powodzeniem od paru dni i jest bardzo szybki.
Tu podziękowania dla kolegi Cezary za przygotowanie odpowiednich modułów do kernela, jednocześnie mam pytanie,
próbowałem doinstalować moduły :

mod-crypto-aes kmod-crypto-authenc kmod-crypto-core kmod-crypto-des kmod-crypto-hmac kmod-crypto-md5 kmod-crypto-sha1 kmod-ipsec kmod-ipsec4

z repozytorium ecco - backfire do backfire i wszystko szybko i bez błędów się zainstalowało, a na gargoyle instalacja się nie udaje mimo tego samego źródła i najnowszej wersji gargulca.
Nie wnikałem już w szczegóły, ale zaintrygował mnie ten problem, gdyż nawet autor stweirdził, że te repozytoria pakietów pochodzą z tego samego źródła.
Nie ukrywam, że chciałbym też wypróbować strongswana na gargoylu, bo odpada mi wtedy pare rzeczy zwiazanych z konfiguracją 3g w trybie tekstowym, z resztą, jak może być zycie łatwiejesz to dlaczego by nie skorzystać. Mam 16mb flash to mogę pozwolić sobie na odrobinę rozrzutności.

Pozdrawiam

Łukasz

Aha, jeszcze jedno pytanie do kolegi Cezary, zegar mi się nie chce zsynchronizować automatycznie po podłączeniu WAN, wygląda na to, że za szybko próbuje synchronizacji rdate, po kilku minutach połączenia synchronizacja przebiaga właściwie.
Da się jakoś opóźnić ten skrypt program timezone, bo tam chyba są wpisane te adresy serwerów czasu.
tyle uwag;D

75

Odp: IPsec a nowy kernel 2.6.32.27

Witam.

Korzystając z okazji, bo wątek już trochę się postarzał, chciałbym poprosić o pomoc, bo problem mój jest nieco podobnej natury, jak ten w poście.

Otóż chciałbym spiąć dwie sieci za pośrednictwem VPN.
W sieci natknąłem się na stronę
http://www.rpc.one.pl/index.php/lista-a … dynamiczny
gdzie podany jest przykład wraz z konfigiem jak spiąć dwie sieci z których jedna dysponuje adresem zewnętrznym a druga wewnętrznym.

Mój problem polega na tym że chciałbym spiąć dwie sieci bez adresów zewnętrznych, czyli oba urządzenia mają ustawione DynDNS-y. Czy ktoś byłby w stanie pomóc mi w przekonfigurowaniu tego tutoriala ze strony pod moje potrzeby?

Założenia
Ruter do którego się podłączam to Linksys RV082 powiedzmy adres i maska 192.168.21.0/24 no i oczywiście VPN1.dyndns.org
ruter który nawiązuje połączenie to TP-Link TL-WR1043ND powiedzmy adres i maska 192.168.5.0/24        VPN2.dyndns.org

Z góry serdecznie dziękuje za pomoc.