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:14] – thierry | brouillon_ipsec [2009/06/30 00:26] – thierry | ||
---|---|---|---|
Ligne 369: | Ligne 369: | ||
Voila. | Voila. | ||
+ | |||
+ | ===== Tips ===== | ||
+ | ==== Route et MTU ==== | ||
+ | On doit parfois jouer avec les routes... | ||
+ | |||
+ | Mais aussi avec la MTU. | ||
+ | |||
+ | Pour mémoire, on peut utiliser ce format de commande par exemple: | ||
+ | # ip route add < | ||
+ | Par exemple: | ||
+ | # ip route add 192.168.1.0/ | ||
+ | Ainsi, ce qui est a destination de la classe " | ||
+ | |||
+ | |||
+ | ==== iptables ==== | ||
+ | |||
+ | $IPTABLES -A INPUT -i eth0 -p esp -j ACCEPT | ||
+ | $IPTABLES -A INPUT -i eth0 -p ah -j ACCEPT | ||
+ | $IPTABLES -A INPUT -i eth0 -p udp --dport 500 -j ACCEPT | ||
+ | |||
+ | Faire des bizarreries, | ||
+ | |||
+ | ==== 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) | ||
===== Openswan ===== | ===== Openswan ===== | ||
Ligne 449: | Ligne 482: | ||
VID=4f45606c50487c5662707575 | VID=4f45606c50487c5662707575 | ||
VID=afcad71368a1f1c96b8696fc77570100 (Dead Peer Detection v1.0) | 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