arşiv

‘Linux’ kategorisi için arşiv

Ubuntu OpenVPN

Cuma, 29 Oca 2010 1 yorum

sunucu tarafı

apt-get install openvpn bridge-utils
mkdir /etc/openvpn/easy-rsa/
cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/

edit  /etc/openvpn/easy-rsa/vars
cd /etc/openvpn/easy-rsa/
chown -R root:admin .


./vars
./clean-all
./build-ca
./build-key-server server
./build-key istemci1
./build-key istemci2  n sayidi client icin client  adinda ssl sertifikasi olusturuyoruz

./build-dh

cd keys
burada olusan keylerin ozelligi su sekilde olacak ( sunucu ve client paylasimi icin )

ca.crt sunucu ve tum istemcilerde olmali
ca.key sadece CA makinede olmali

server.crt sadece sunucu makinede
server.key sadece sunucu makinede

istemci1.crt sadece istemci1 makinasinda
istemci1.key sadece istemci1 makinasinda
istemci2crt sadece istemci2 makinasinda
istemci2key sadece istemci2 makinasinda

linux sunucu tarafinda /etc/openvpn altinda
pico server.conf dosyasi yaratilir ve icerigi su sekilde olur

# vpn servisinin hangi ip adresini dinleyecegi set edilir
local 123.123.123.123
port 1194
proto tcp

;dev tap0 # bridge mode  layer2 yapacak isek kullaniyoruz sadece 
# olusturulacak tunel interface
dev tun0

#CA Sunucunun sertifikası. Burada tam yol belirtilmelidir. Bu sertifika tüm sunucu ve istemcilerde bulunmak zorundadır.
ca /etc/openvpn/easy-rsa/keys/ca.crt

#VPN sunucunun sertifikası. Sadece sunucu tarafında bulunmalıdır
cert /etc/openvpn/easy-rsa/keys/server.crt

#bu dosya çok önemlidir. Diğer tüm sertifikaları imzalamada kullanılır.
key /etc/openvpn/easy-rsa/keys/server.key

#Diffie hellman parametrelerinin bulunduğu dosya
dh /etc/openvpn/easy-rsa/keys/dh1024.pem


#VPN sunucuya bağlanarak IP alacak istemcilerin IP havuzunu belirler. Havuz içinde ilk IP adresi VPN sunucunun IP adresi olacaktır.
# sistem bunu otomatik yapacakdir.
server 10.8.0.0 255.255.255.0

#VPN sunucuya bağlanarak IP adresi alan istemcilerin kayıtlarını tutar. VPN sunucuda yaşanacak bir bağlantı kopması sonrasında istemcilerin eski IP adreslerini almalarını sağlar.
ifconfig-pool-persist ipler.txt

#VPN ile bağlanan istemcileri VPN sunucu arkasındaki başka ağlara da erişim izni için yönlendirme tanımı.
;push "route 192.168.20.0 255.255.255.0"


#VPN sunucuya bağlanan istemcilerin varsayılan geçit yolunu(default gateway) VPN sunucu olarak ayarla anlamına gelir. Bu sekilde istemcinin özel olarak yönlendirilmemiş tüm trafiği VPN gateway aracılığı ile çıkacaktır
push "redirect-gateway"

#VPN istemcilerinin birbirini görmesi isteniliyor ise secilmek zorunda diger turlu client lar birbirisini goremez
client-to-client

#Sunucu ve istemcilerin birbirinin durumundan haberdar olmalarını sağlayan bir yapı. Anlamı her 20 saniyede bir kontrol et, 120sn içerisinde cevap gelmezse bağlantıyı kopar.
;keepalive 20 120

#eşzamanlı 200 kullanıcıya izin ver.
max-clients 200

#VPN sunucunun durumu hakkında özet bilgi için.
status openvpn-status.log

# loglama
log /var/log/openvpn.log
log-append /var/log/openvpn.log
verb 9
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose

# sıkistirma algoritmasini belirlenir. karsi tarafdada aynisinin secilmesi gerekiyor
# yavas baglantilarda hiz acisindan fayda saglar
comp-lzo

———————————————server.conf dosyasinin sonu ————————————————-

windows yada linux tarafindaki
client conf dosyasinda olmasi gereken ayarlar ise sunlardi
eger linux ise
/etc/openvpn/client.conf dosyasi yaratilir ve icine asagidaki ibareler yazilir

client
dev tun0
proto udp
remote 123.123.123.123 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert istemci.crt
key istemci.key
ns-cert-type server
comp-lzo
verb 9

eger windows makina ise
kurulum dizini icinde conf klasorunde ( keylerde burada olmak zorunda )
client.ovpn adinda bir dosya olusturup ayni degerleri yaziyoruz

Categories: Linux Tags: , , ,

Ubuntu da tek ethernet karti ile birden fazla vlan olusturma

Cuma, 29 Oca 2010 yorum yok

Amacimiz tek ethernet karti takili olan ubuntumuz ile layer3 switch deki birden fazla vlan a baglanmak.

gerekli paketleri yukluyorum

root@zeus:~# apt-get install vlan 

gerekli modulleri yukluyoruz

root@zeus:~# modprobe 8021q

vlan id miz 101 olarak sistemimize ekliyoruz

root@zeus:~# vconfig add eth0 101

vlan101 imizin ip ayarlarini yapiyoruz

root@zeus:~# ifconfig eth0.101 192.168.0.55 netmask 255.255.255.0

vlan imizin acilis sirasinda otomatik olarak tanimlanmasini istiyorsak

root@zeus:~# echo "8021q" >> /etc/modules

/etc/network/interfaces dosyasinada asagidaki konfigurasyon betiklerini eklememiz yeterli

auto eth0.101
iface eth0.101 inet static
    address 192.168.0.55
    netmask 255.255.255.0
    vlan-raw-device eth0

vconfig komutunun basit kullanim parametreleri

Usage: add             [interface-name] [vlan_id]
       rem             [vlan-name]
Categories: Linux Tags: , ,

Dansguardian Time Limiting

Perşembe, 28 Oca 2010 yorum yok

Gun geldi lazim oldu baya bir arastirdim ama detayli bir dokuman bulamamistim ve maillistleri kurcaladim forumlari didik didik ettim sonunda ufak bir ip ucu ile DG de Time Limiti buldum

Yapilmak istenen
hafta ici belirli saat araliklarinda istemis oldugum sitelere erisim izinin verilmesi geri kalan saatlerde ise bu bu sitelere erisimin yasaklanmasi

bannedsitelist dosyasinin icinde verilen ornek de tek bir time limit veriliyor.

# Time limiting syntax:
# #time: <start hour> <start minute> <end hour> <end minute> <days>
# Example:
##time: 9 0 17 0 01234
# Remove the first # from the line above to enable this list only from
# 9am to 5pm, Monday to Friday.

Ben gunun belirli saatlerinde izin vermek istiyorum buda gunde 2 kereye tekabul ediyor oglen 12-13 arasi ve aksam 17 den sabah 7 ye kadar. burdaki puf nokta tek bir dosyaya sadece 1 adet time limit yazabilmeniz. isterseniz 5 tane yazim en alttaki time limitiniz geride kalan 4 time limitin uzerine cikiyor

Filter2 grubu icin ornek dosyalar

/etc/dansguardian/filter2/9_12_yasakli_siteler

#time: 9 0 11 59 01234
abc.com.tr
def.com.tr

/etc/dansguardian/filter2/13_17_yasakli_siteler

#time: 13 0 16 59 01234
abc.com.tr
def.com.tr

/etc/dansguardian/filter2/bannedsitelist

.Include</etc/dansguardian/filter2/9_12_yasakli_siteler>
.Include</etc/dansguardian/filter2/13_17_yasakli_siteler>

dansguardian i reload ettikten sonra ayarlarimiz aktif olacaktir. (sayet filter2 grubundaki exceptionsitelist dosyasinda ayni sitelere izin verilmediyse ve/veya filter2 grubundaki kullaniciya exception tanimlanmadiysa)

Asterisk LibSS7 Howto

Perşembe, 17 Nis 2008 1 yorum

This Howto has been contributed by Matthew Fredrickson – Author of LibSS7 at Digium

I have received many requests lately for a more current document
describing how to setup Asterisk with SS7 support. The following email
will hopefully suffice. The contents of this are also contained in the
README file in libss7 as well as inside Asterisk-trunk in the
doc/ss7.txt file.

To Use:
=======
In order to use libss7, you must get at least the following versions of
Zaptel, libss7, and Asterisk (you might also want to get libpri):
Zaptel: 1.4.x
Asterisk: trunk
libss7: trunk (currently, there *only* is a trunk release).

You must then do a `make; make install` in each of the directories that
you installed in the given order (Zaptel first, libss7 second, and
Asterisk last).

NOTE: In order to check out the code, you must have the subversion
client installed. This is how to check them out from the public
subversion server.

These are the commands you would type to install them:

`svn co http://svn.digium.com/svn/zaptel/branches/1.4 zaptel-1.4`
`cd zaptel-1.4`
`make; make install`

`svn co http://svn.digium.com/svn/libss7/trunk libss7-trunk`
`cd libss7-trunk`
`make; make install`

`svn co http://svn.digium.com/svn/asterisk/trunk asterisk-trunk`
`cd asterisk-trunk`
`./configure; make; make install;`

This should build Zaptel, libss7, and Asterisk with SS7 support.

In the past, there was a special asterisk-ss7 branch to use which
contained the SS7 code. That code has been merged back into the trunk
version of Asterisk, and the old asterisk-ss7 branch has been deprecated
and removed. If you are still using the asterisk-ss7 branch, it will
not work against the current version of libss7, and you should switch to
asterisk-trunk instead.

CONFIGURATION:
In zaptel.conf, your signalling channel(s) should be a “dchan” and your
bearers should be set as “bchan”.

In the asterisk-ss7 branch, there is a sample zapata.conf that is
installed which contains sample configuration for setting up an E1 link.

In brief, here is a simple ss7 linkset setup:

signalling = ss7
ss7type = itu ; or ansi if you are using an ANSI link

linkset = 1 ; Pick a number for your linkset identifier in
; zapata.conf

pointcode = 28 ; The decimal form of your point code. If you
; are using an
; ANSI linkset, you can use the xxx-xxx-xxx
notation for
; specifying your linkset pointcode.
adjpointcode = 2 ; The point code of the switch adjacent to your
; linkset

defaultdpc = 3 ; The point code of the switch you want to send
; your ISUP
; traffic to. A lot of the time, this is the
; same as your
; adjpointcode.

; Now we configure our Bearer channels (CICs)

cicbeginswith = 1 ; Number to start counting the CICs from. So if
; Zap/1 to Zap/15 are CICs 1-15, you would set
; this to 1 before you
; declare channel=1-15

channel=1-15 ; Use Zap/1-15 and assign them to CICs 1-15

cicbeginswith = 17 ; Now for Zap/17 to Zap/31, they are CICs 17-31
; so we initialize
; cicbeginswith to 17 before we declare those
; channels

channel = 17-31 ; This assigns CICs 17-31 to channels 17-31

signchan = 16 ; This is where you declare which Zap channel is
; your signalling
; channel. In our case it is Zap/16. You can
; add redundant
; signalling channels by adding additional
; sigchan= lines.

; If we want an alternate redundant signalling channel add this

sigchan = 48 ; This would put two signalling channels
in our ; linkset, one at Zap/16 and one at Zap/48 which
; both would be used to send/receive
; ISUP traffic.

; End of zapata.conf

This is how a basic linkset is setup. For more detailed zapata.conf SS7
config information as well as other options available for that file, see
the default zapata.conf that comes with the samples in asterisk. If you
would like, you can do a `make samples` in your asterisk-trunk directory
and it will install a sample zapata.conf for you that contains more
information about SS7 setup.

Categories: Linux Tags: , , ,