brouillon_ipsec
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
brouillon_ipsec [2009/06/30 00:25] – thierry | brouillon_ipsec [2009/06/30 00:26] – thierry | ||
---|---|---|---|
Ligne 410: | Ligne 410: | ||
Donc, j' | Donc, j' | ||
- | |||
- | ==== Test sur le même LAN ==== | ||
- | |||
- | === exemple === | ||
- | |||
- | Soit 2 becannes sur le même LAN, mais souhaitant partagé " | ||
- | |||
- | PC-A (" | ||
- | IP: 172.16.0.33 | ||
- | LAN SECRET: 192.168.50/ | ||
- | |||
- | PC-B (" | ||
- | IP: 172.16.0.39 | ||
- | LAN SECRET: aucun | ||
- | |||
- | Sur PC-A: | ||
- | # cat / | ||
- | 172.16.0.33 172.16.0.39 : PSK " | ||
- | | ||
- | # cat / | ||
- | version 2.0 # conforms to second version of ipsec.conf specification | ||
- | | ||
- | config setup | ||
- | nhelpers=0 | ||
- | | ||
- | conn mynet | ||
- | authby=secret | ||
- | left=172.16.0.33 | ||
- | leftsubnet=192.168.50.0/ | ||
- | right=172.16.0.39 | ||
- | auto=start | ||
- | | ||
- | include / | ||
- | |||
- | Copier **'' | ||
- | |||
- | Inverser les IP dans le fichier **'' | ||
- | 172.16.0.39 172.16.0.33 : PSK " | ||
- | |||
- | Puis, sur chacun des PC: | ||
- | # / | ||
- | |||
- | Un test montre que les requetes ARP passent aussi !? | ||
- | |||
- | === explications === | ||
- | |||
- | (sous réserve d' | ||
- | |||
- | *" | ||
- | *" | ||
- | *" | ||
- | *" | ||
- | |||
- | Les 2 ne sont pas obligés de partager... | ||
- | |||
- | |||
- | === pluto === | ||
- | # cat / | ||
- | Jun 24 11:43:29 xxxxxx ipsec__plutorun: | ||
- | Jun 24 11:43:29 xxxxxx ipsec__plutorun: | ||
- | |||
- | === ike-scan === | ||
- | |||
- | # aptitude install ike-scan | ||
- | # / | ||
- | # ike-scan -M 172.16.0.33 | ||
- | Starting ike-scan 1.9 with 1 hosts (http:// | ||
- | 172.16.0.33 | ||
- | HDR=(CKY-R=46746e295468b2d5) | ||
- | SA=(Enc=3DES Hash=SHA1 Auth=PSK Group=2: | ||
- | VID=4f45606c50487c5662707575 | ||
- | VID=afcad71368a1f1c96b8696fc77570100 (Dead Peer Detection v1.0) | ||
- | |||
- | ==== Test sur 2 IP Public ==== | ||
- | |||
- | Faire partager un reseau local, entre 2 IP public. | ||
- | |||
- | === conf === | ||
- | |||
- | " | ||
- | |||
- | Sur " | ||
- | |||
- | # cat ipsec.secrets | ||
- | IP_PUBLIC_20 IP_PUBLIC_15 : PSK " | ||
- | |||
- | # cat ipsec.conf | ||
- | version 2.0 # conforms to second version of ipsec.conf specification | ||
- | | ||
- | config setup | ||
- | nat_traversal=yes | ||
- | nhelpers=0 | ||
- | | ||
- | conn mynet | ||
- | authby=secret | ||
- | left=IP_PUBLIC_20 | ||
- | leftsubnet=192.168.1.0/ | ||
- | leftnexthop=IP_PUBLIC_15 | ||
- | right=IP_PUBLIC_15 | ||
- | rightnexthop=IP_PUBLIC_20 | ||
- | auto=start | ||
- | | ||
- | include / | ||
- | |||
- | Sur IP_PUBLIC_15 : \\ | ||
- | (Simple inversion) | ||
- | # cat ipsec.secrets | ||
- | IP_PUBLIC_15 IP_PUBLIC_20 : PSK " | ||
- | Et " | ||
- | |||
- | === detaillons === | ||
- | Au niveau IP, c'est un peu étrange... | ||
- | |||
- | Sur IP_PUBLIC_A : | ||
- | # route -n | ||
- | Table de routage IP du noyau | ||
- | Destination | ||
- | IP_PUBLIC_15 | ||
- | 192.168.1.0 | ||
- | ... | ||
- | |||
- | Sur IP_PUBLIC_B : | ||
- | # route -n | ||
- | Table de routage IP du noyau | ||
- | Destination | ||
- | 192.168.1.0 | ||
- | ... | ||
- | |||
- | Au niveau du firewall IP_PUBLIC_A : | ||
- | WAN_IF=eth0 | ||
- | WIFI_IF=eth1 | ||
- | | ||
- | # ipsec test | ||
- | |||
- | $IPTABLES -A INPUT -i $WAN_IF -p 50 -s IP_PUBLIC_15 -j ACCEPT | ||
- | $IPTABLES -A INPUT -i $WAN_IF -p 51 -s IP_PUBLIC_15 -j ACCEPT | ||
- | | ||
- | $IPTABLES -A INPUT -i $WAN_IF -s IP_PUBLIC_15 -d 192.168.1.0/ | ||
- | $IPTABLES -A OUTPUT -o $WAN_IF -d IP_PUBLIC_15 -s 192.168.1.0/ | ||
- | | ||
- | $IPTABLES -A FORWARD -i $WAN_IF -o $WIFI_IF -j ACCEPT | ||
- | $IPTABLES -A FORWARD -i $WIFI_IF -o $WAN_IF -j ACCEPT | ||
brouillon_ipsec.txt · Dernière modification : 2009/07/04 21:46 de thierry