The Intenet --- adslmodem---linuxgateway(10.0.1.26)---(10.0.1.25)linuxpc
pc makinamdam çıkan tüm paketleri , gateway ile benim aramda oluşan tunele gönderiyor.
yani başka bir çıkışa tanımlanmış (route add -host xxx gw adsl2) bir xxx e ping atsan bile rotayı filan takmıyor, bunlarıda tunele gönderiyor.yani ne yaparsan yap hep tünel üzerinden ulaşıyorsun yerel ağındaki diğer 10.0.1.x li hostlara bile.bazı şeylerde faydası olabiler.tabiki aşağıdaki konfigürasyona göre.
linux_pc de ve linux_gateway de
apt-get install ipsec-tools racoon
her iki linuxtaki
cat /etc/racoon/racoon.conf
#
path pre_shared_key "/etc/racoon/psk.txt";
path certificate "/etc/racoon/certs";
remote anonymous {
exchange_mode main,aggressive;
proposal {
encryption_algorithm 3des;
hash_algorithm sha1;
authentication_method pre_shared_key;
dh_group modp1024;
}
#generate_policy off;
}
sainfo anonymous {
pfs_group modp1024;
encryption_algorithm 3des;
authentication_algorithm hmac_sha1, hmac_md5;
compression_algorithm deflate;
}
pc deki
debian:~# cat /etc/racoon/psk.txt
10.0.1.26 arabam
gatewaydeki
adsl2:~# cat /etc/racoon/psk.txt
# IPv4/v6 addresses
10.0.1.28 arabam
10.0.1.26 arabam
10.0.1.25 arabam
gatewaydeki
cat ipsec-tools.conf
flush;
spdflush;
spdadd 0.0.0.0/0 10.0.1.28/32 any -P out ipsec esp/tunnel/10.0.1.26-10.0.1.28/require;
spdadd 10.0.1.28/32 0.0.0.0/0 any -P in ipsec esp/tunnel/10.0.1.28-10.0.1.26/require;
spdadd 0.0.0.0/0 10.0.1.25/32 any -P out ipsec esp/tunnel/10.0.1.26-10.0.1.25/require;
spdadd 10.0.1.25/32 0.0.0.0/0 any -P in ipsec esp/tunnel/10.0.1.25-10.0.1.26/require;
pcdeki
ipsec-tools.conf
flush;
spdflush;
spdadd 0.0.0.0/0 10.0.1.25/32 any -P in ipsec
esp/tunnel/10.0.1.26-10.0.1.25/require;
spdadd 10.0.1.25/32 0.0.0.0/0 any -P out ipsec esp/tunnel/10.0.1.25-10.0.1.26/require;
/etc/init.d/setkey start
/etc/init.d/racoon start
her iki tarafta psk(burada arabam) kullanarak , her iki tarafı otantike ettirip bunlar kendileri otomatik keyleriyle takılıyorlar.sanırım...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment