|
|
|
|
LAN 2------------ rl0 GW_B pppoe0 ---- net ---- tun0 GW_A rl0 ------------ LAN 1 192.168.2.0/24 .20 .20 192.168.1.0/24
pf.conf:
anchor vpn
/etc/pf_vpn.conf:
GATEWAY_A = " 83.112.80.229" GATEWAY_B = " 83.112.181.6" NETWORK_A = "192.168.1.0/24" NETWORK_B = "192.168.2.0/24" # default deny block in log on enc0 all block out log on enc0 all # Passing in encrypted traffic from security gateways pass in proto esp from $GATEWAY_B to $GATEWAY_A pass out proto esp from $GATEWAY_A to $GATEWAY_B # Need to allow ipencap traffic on enc0. pass in on enc0 proto ipencap all # Passing in traffic from the designated subnets. pass in on enc0 from $NETWORK_B to $NETWORK_A pass out on enc0 from $NETWORK_A to $NETWORK_B # Passing in isakmpd(8) traffic from the security gateways pass in on tun0 proto udp from $GATEWAY_B port = 500 to $GATEWAY_A port = 500 pass out on tun0 proto udp from $GATEWAY_A port = 500 to $GATEWAY_B port = 500
pf.conf:
anchor vpn
/etc/pf_vpn.conf:
GATEWAY_A = " 83.112.80.229" GATEWAY_B = " 83.112.181.6" NETWORK_A = "192.1.1.0/24" NETWORK_B = "192.1.2.0/24" # default deny block in log on enc0 all # Passing in encrypted traffic from security gateways pass in log proto esp from $GATEWAY_A to $GATEWAY_B pass out proto esp from $GATEWAY_B to $GATEWAY_A # Need to allow ipencap traffic on enc0. pass in log on enc0 proto ipencap all # Passing in traffic from the designated subnets. pass in log on enc0 from $NETWORK_A to $NETWORK_B pass out on enc0 from $NETWORK_B to $NETWORK_A # Passing in isakmpd(8) traffic from the security gateways pass in on pppoe0 proto udp from $GATEWAY_A port = 500 to $GATEWAY_B port = 500 pass out on pppoe0 proto udp from $GATEWAY_B port = 500 to $GATEWAY_A port = 500
GATEWAY_A# ipsecadm show sadb_dump: satype esp vers 2 len 22 seq 0 pid 0 errno 1: Operation not permitted sa: spi 0x00000104 auth hmac-sha1 enc 3des-cbc state larval replay 0 flags 4 lifetime_cur: alloc 0 bytes 0 add 1122444791 first 0 address_src: 83.112.80.229 address_dst: 83.112.181.6 key_auth: bits 160: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx key_encrypt: bits 192: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx sadb_dump: satype esp vers 2 len 22 seq 0 pid 0 errno 1: Operation not permitted sa: spi 0x00000105 auth hmac-sha1 enc 3des-cbc state larval replay 0 flags 4 lifetime_cur: alloc 0 bytes 0 add 1122444802 first 0 address_src: 83.112.181.6 address_dst: 83.112.80.229 key_auth: bits 160: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx key_encrypt: bits 192: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GATEWAY_B# ipsecadm show sadb_dump: satype esp vers 2 len 22 seq 0 pid 0 errno 188: Unknown error: 188 sa: spi 0x00000104 auth hmac-sha1 enc 3des-cbc state larval replay 0 flags 4 lifetime_cur: alloc 0 bytes 0 add 1122453570 first 0 address_src: 83.112.80.229 address_dst: 83.112.181.6 key_auth: bits 160: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx key_encrypt: bits 192: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx sadb_dump: satype esp vers 2 len 22 seq 0 pid 0 errno 188: Unknown error: 188 sa: spi 0x00000105 auth hmac-sha1 enc 3des-cbc state larval replay 0 flags 4 lifetime_cur: alloc 0 bytes 0 add 1122453582 first 0 address_src: 83.112.181.6 address_dst: 83.112.80.229 key_auth: bits 160: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx key_encrypt: bits 192: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
netstat -rn -f encap:
GATEWAY_A# netstat -rn -f encap Routing tables Encap: Source Port Destination Port Proto SA(Address/Proto/Type/Direction) 192.168.2/24 0 192.1.1/24 0 0 83.112.181.6/50/require/in 192.168.1/24 0 192.1.2/24 0 0 83.112.181.6/50/require/out GATEWAY_B# netstat -rn -f encap Routing tables Encap: Source Port Destination Port Proto SA(Address/Proto/Type/Direction) 192.168.1/24 0 192.1.2/24 0 0 83.112.80.229/50/require/in 192.168.2/24 0 192.1.1/24 0 0 83.112.80.229/50/require/out
GATEWAY_A# pfctl -a vpn:all -f /etc/pf_vpn.conf GATEWAY_B# pfctl -a vpn:all -f /etc/pf_vpn.conf
GATEWAY_A# ping -I 192.168.1.20 192.168.2.20 PING 192.168.2.20 (192.168.2.20): 56 data bytes ping: sendto: No route to host ping: wrote 192.168.2.20 64 chars, ret=-1 ping: sendto: No route to host ping: wrote 192.168.2.20 64 chars, ret=-1 ping: sendto: No route to host ping: wrote 192.168.2.20 64 chars, ret=-1 ... GATEWAY_B# ping -I 192.168.2.20 192.168.1.20 PING 192.168.1.20 (192.1.1.20): 56 data bytes ping: sendto: No route to host ping: wrote 192.168.1.20 64 chars, ret=-1 ping: sendto: No route to host ping: wrote 192.168.1.20 64 chars, ret=-1 ...
▀▄▀▄▀▄
Configuration: GATEWAY_A : GATEWAY_B : - OpenBSD 3.7-stable (GENERIC) - Intel Pentium II 350Mhz, 128 Mo de RAM - DD IDE Quantum Fireball 4 Go - 2 cartes réseaux : - chip realtek 8029 - chip realtek 8139
Bonjour,
Bon j'avance un peu sur ce problème. J'arrive à mettre en place la procédure manuelle en environnement de test comme indiqué à la page de man vpn : http://www.openbsd.org/cgi-bin/man.cgi?query=vpn&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html Le problème venait de mes règles sur Packet Filter. Si on suit bien à la lettre le tuto tout fonctionne bien. Je viens d'adapter un de mes fichiers pf.conf en conséquence. Pour le moment ça donne de bon résultats mais je n'en suis pas encore tout à fait au bout de mes tests. Finalement si j'avais bien lu ce tuto jusqu'au bout j'aurais su où regarder pour résoudre mon problème : If any traffic is being leaked i.e. the last ping detailed above is showing traffic, it is suggested that the administrator review the steps above, paying particular notice to the firewall configuration procedures. Cette dernière phrase devrait être écrite en rouge avec une taille de police minimum de 24. ▀▄▀▄▀▄ |
Résultats pour [OpenBSD] mise ne place d'un VPN
Résultats pour [OpenBSD] mise ne place d'un VPN
Résultats pour [OpenBSD] mise ne place d'un VPN
Résultats pour [OpenBSD] mise ne place d'un VPN
Résultats pour [OpenBSD] mise ne place d'un VPN
Résultats pour [OpenBSD] mise ne place d'un VPN