Een ipsec tunnel tussen m0n0wall(BSD) en Centos

Pagina: 1
Acties:

  • CodeConnected
  • Registratie: Juni 2004
  • Laatst online: 05-11-2025
Hallo,

Ik probeer een Ipsec tunnel tussen een monowall en een Centus(5.0) linux machine
ze draaien allebij Racoon als vpn server.

Ze komen Allebij door phase 1 maar bij Phase 2 gaat er iets mis.

Debug Info op de centos bak:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2008-04-28 13:56:48: DEBUG: begin.
2008-04-28 13:56:48: DEBUG: seen nptype=2(prop)
2008-04-28 13:56:48: DEBUG: succeed.
2008-04-28 13:56:48: DEBUG: proposal #1 len=40
2008-04-28 13:56:48: DEBUG: begin.
2008-04-28 13:56:48: DEBUG: seen nptype=3(trns)
2008-04-28 13:56:48: DEBUG: succeed.
2008-04-28 13:56:48: DEBUG: transform #1 len=28
2008-04-28 13:56:48: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds
2008-04-28 13:56:48: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600
2008-04-28 13:56:48: DEBUG: life duration was in TLV.
2008-04-28 13:56:48: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Tunnel
2008-04-28 13:56:48: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-md5
2008-04-28 13:56:48: DEBUG: type=Group Description, flag=0x8000, lorv=2
2008-04-28 13:56:48: DEBUG: hmac(modp1024)
2008-04-28 13:56:48: DEBUG: pair 1:
2008-04-28 13:56:48: DEBUG:  0x82196a0: next=(nil) tnext=(nil)
2008-04-28 13:56:48: DEBUG: proposal #1: 1 transform
2008-04-28 13:56:48: DEBUG: begin compare proposals.
2008-04-28 13:56:48: DEBUG: pair[1]: 0x82196a0
2008-04-28 13:56:48: DEBUG:  0x82196a0: next=(nil) tnext=(nil)
2008-04-28 13:56:48: DEBUG: prop#=1 prot-id=ESP spi-size=4 #trns=1 trns#=1 trns-id=DES
2008-04-28 13:56:48: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds
2008-04-28 13:56:48: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600
2008-04-28 13:56:48: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Tunnel
2008-04-28 13:56:48: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-md5
2008-04-28 13:56:48: DEBUG: type=Group Description, flag=0x8000, lorv=2
2008-04-28 13:56:48: DEBUG: peer's single bundle:
2008-04-28 13:56:48: DEBUG:  (proto_id=ESP spisize=4 spi=0692c537 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=DES encklen=0 authtype=hmac-md5)
2008-04-28 13:56:48: DEBUG: my single bundle:
2008-04-28 13:56:48: DEBUG:  (proto_id=AH spisize=4 spi=00000000 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=MD5 authtype=hmac-md5)
2008-04-28 13:56:48: DEBUG:  (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=DES encklen=0 authtype=hmac-md5)
2008-04-28 13:56:48: ERROR: not matched
2008-04-28 13:56:48: ERROR: no suitable policy found.
2008-04-28 13:56:48: ERROR: failed to pre-process packet.


Op de monowall zie ik precies het zelfde.

Ik heb alle mogelijke opties al geprobeerd bij phase 2 maar duidelijk word ik er niet echt uit.

Dit is mijn racoon.conf:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
path include "/etc/racoon";                                                                                                                                  
path pre_shared_key "/etc/racoon/psk.txt";                                                                                                                   
path certificate "/etc/racoon/certs";                                                                                                                        
                                                                                                                                                             
log notify;                                                                                                                                                  
log debug2;                                                                                                                                                  
                                                                                                                                                             
sainfo anonymous                                                                                                                                             
{                                                                                                                                                            
    pfs_group 2;                                                                                                                                             
    lifetime time 3600 sec;                                                                                                                                  
    encryption_algorithm des ;                                                                                                                               
    authentication_algorithm hmac_md5;                                                                                                                       
    compression_algorithm deflate;                                                                                                                           
}

remote (IP ADDRESS)                                                                                                      
{                                                                                                                                                            
        exchange_mode aggressive, main;                                                                                                                      
        my_identifier address;                                                                                                                               
        proposal {                                                                                                                                           
                encryption_algorithm 3des;                                                                                                                   
                hash_algorithm sha1;                                                                                                                         
                authentication_method pre_shared_key;                                                                                                        
                dh_group 2 ;                                                                                                                                 
        }                                                                                                                                                    
}


Hebben jullie nog enig iedee?

  • axis
  • Registratie: Juni 2000
  • Laatst online: 26-01-2023
beide racoon.confs zijn hetzelfde? Heb je beide machines in beheer?

Ik zie het zo ook niet meteen, maar misschien dat je op deze pagina op mijn blog nog iets ziet wat een belletje doet rinkelen? http://blog.hongens.nl/?page_id=32

Enne, het kan ook zijn dat de beide definities van welk verkeer versleuteld moeten worden, niet overeen komen. Ik neem aan dat die definitie op linux ook in /etc/ipsec.conf staat? En als je die nakijkt, staat er dan beiden hetzelfde in, in exact de omgekeerde volgorde?

Two advices for network troubleshooting.. learn to draw diagrams in Visio, and THINK IN LAYERS!


  • CodeConnected
  • Registratie: Juni 2004
  • Laatst online: 05-11-2025
Ik heb beide machine's in beheer.

Het nadeel is dat een m0n0wall standaart geen sshd heeft en dat je als je er een scherm en toetsenbord op aan sluit dat je dan niet in de console komt.

Je hebt eigenlijk alleen een webinterface met niet heel erg veel optie's
Dit zijn de ipsec opties in monowall(voor phase 2):
Afbeeldingslocatie: http://doc.m0n0.ch/handbook-single/screens/ipsec/phase2.png

met centos heb je geen /etc/ipsec.conf. Volgensmij komt dat omdat freebsd free/swan gebruikt en linux niet maar dat weet ik niet heel erg zeker!

  • axis
  • Registratie: Juni 2000
  • Laatst online: 26-01-2023
2 opmerkingen:

- zo te zien staat op je centos machine PFS aan (staat in racoon config), maar in monowall niet. Zet 'm eens op group 2 in je monowall?

- hoe zit het met encrypted verkeer? Waar heb je opgegeven in je centos machine welk verkeer er over de tunnel moet? En hoe staat dat ingesteld in je monowall machine?

Two advices for network troubleshooting.. learn to draw diagrams in Visio, and THINK IN LAYERS!


  • CodeConnected
  • Registratie: Juni 2004
  • Laatst online: 05-11-2025
Het plaatje was een voorbeeld(gewoon op google gevonden)

Ik heb hem bij de monowall wel op 2 staan en de codering ook goed staan(dus op des en sha1 vanplaats wat er op het plaatje staat.

in /etc/sysconfig/network-scripts maak je een bestand aan waar de tunnel gegevens in staan dus welke local networks door de tunnel moet. Maar dat is wel goed volgensmij want als ik daar een fout in maak dan gaat hij niet verder als phase 1.

  • axis
  • Registratie: Juni 2000
  • Laatst online: 26-01-2023
Het probleem is toch op een of andere manier dat je proposals niet overeen komen. Staat ook in je logfile:
code:
1
2
3
4
5
6
7
8
9
2008-04-28 13:56:48: DEBUG: peer's single bundle:
2008-04-28 13:56:48: DEBUG:  (proto_id=ESP spisize=4 spi=0692c537 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=DES encklen=0 authtype=hmac-md5)
2008-04-28 13:56:48: DEBUG: my single bundle:
2008-04-28 13:56:48: DEBUG:  (proto_id=AH spisize=4 spi=00000000 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=MD5 authtype=hmac-md5)
2008-04-28 13:56:48: DEBUG:  (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Tunnel reqid=0:0)
2008-04-28 13:56:48: DEBUG:   (trns_id=DES encklen=0 authtype=hmac-md5)
2008-04-28 13:56:48: ERROR: not matched

M0n0wall wil dus ESP, en jouw racoon wil ESP+AH, en dat werkt niet. Je ziet dan ook 'no match'.

Hieronder een voorbeeldje van hoe het er wel uit hoort te zien:
code:
1
2
3
4
5
6
7
2000-08-15 02:22:02: ipsec_doi.c:858:get_ph2approvalx(): peer's single bundle:
2000-08-15 02:22:02: proposal.c:575:printsaproto():  (proto_id=ESP spisize=4 spi=af134f82 spi_p=00000000 encmode=Tunnel reqid=0)
2000-08-15 02:22:02: proposal.c:608:printsatrns():   (trns_id=3DES encklen=0 authtype=hmac-sha)
2000-08-15 02:22:02: ipsec_doi.c:862:get_ph2approvalx(): my single bundle:
2000-08-15 02:22:02: proposal.c:575:printsaproto():  (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Tunnel reqid=0)
2000-08-15 02:22:02: proposal.c:608:printsatrns():   (trns_id=3DES encklen=0 authtype=hmac-sha)
2000-08-15 02:22:02: ipsec_doi.c:878:get_ph2approvalx(): matched


Dus je zult toch moeten kijken naar je network-scripts, daar geef je aan of je ESP+AH wil of alleen ESP ofzo.

vergelijkbare topics:
http://fixunix.com/networ...racoon-phase-2-issue.html

en volgens de bug is het met centos 5 niets eens mogelijk om GEEN AH te gebruiken, maar bevat wel weer een patch:
http://bugs.centos.org/view.php?id=2264

Two advices for network troubleshooting.. learn to draw diagrams in Visio, and THINK IN LAYERS!


  • CodeConnected
  • Registratie: Juni 2004
  • Laatst online: 05-11-2025
Bedankt!
Het is me gelukt. hij staat nu alleen op ESP en dat werkt
Pagina: 1