İçeriğe geç

CITRIX (ADC) NETSCALER GEOIP 2 DATABASE

Amaç:

www.tnetshop.com adresine Farklı Location’ lardan (Hindistan, Rusya, Amerika, Çin gibi farklı Ülkelerden) gelen istekleri Citrix ADC (Netscaler) cihazının üzerinde bloklanmasını talep ediyoruz.

Bu işlemi Citrix ADC (Netscaler) cihazında bloklamak için GeoIP2 database’i yükleyebiliriz. Citrix ADC (Netscaler) cihazı eskiden Maxmind’ın Geoip formatını (yeni ismi ile GeoIP Legacy) desteklemekteydi ancak Maxmind firması şuan GeoIP Legacy yerine GeoIP2 formatını desteklemektedir.

Bilgi:

Statik proximity veri tabanına sahip UNIX tabanlı bir ASCII dosyasıdır. Bu veritabanına bir konum dosyasından eklenen girişlere statik girişler denir. Citrix ADC (Netscaler) cihazına sadece bir adet konum dosyası yüklenebilmektedir.

Varolan dosyanın üzerine yeni bir dosya eklerseniz bir öncekini geçersiz kılacaktır.

Bu database dosyaları Citrix ADC (Netscaler) cihazı tarafından desteklenen bir formatta / var / netscaler / inbuilt_db dizininde bulunmaktadır.

Citrix ADC (Netscaler) cihazı GeoIP2 database’ini netscaler formatına dönüştürebilmesi için bir Converter Tool kullanmanız gerekmektedir.

Maxmind firmasını hem ücretli hem de ücretsiz versiyonu bulunmaktadır. Ücretsiz versiyonda kullanılabilir ancak ücretli versiyon daha sık güncellenmekte ve daha güvenilirdir.             

Ücretsiz Versiyon: GeoLite2 database

Ücretli Versiyon: GeoIP2 database

Bu makaleyi hazırlarken ben GeoLite2 database’ ini kullanarak yazdım.

Talimatlar:

1) Maxmind’ dan GeoIP2’yi indirdirme

Maxmind gibi GeoIP2 database indirebileceğimiz firmalardan da bulup indirebilirsiniz ancak ben testlerimi Maxmind’ dan GeoIP2 database’ ini indirerek yaptım. Link aşağıda mevcuttur. 

GeoIP2 yi indirirken GeoLite2 Country ve CSV formatında indirmemiz gerekmektedir.

1.1) İndirme işlemini tamamladıktan sonra WinSCP programını kullanarak indirmiş olduğumuz dosyayı;

  • /var/netscaler/locdb dizisinin içine yüklüyoruz.

2) Citrix ADC (Netscaler) Cihazına Converter Tool’ u indirme.

Citrix ADC (Netscaler) cihazının GeoIP2’ yi kendi formatında çalıştırabilmesi için Sıkript’e yani Converter tool’ a ihtiyacı vardır.

              Converter Tool’ u indirmek için aşağıdaki link’ i kullanabilirsiniz.

https://github.com/citrix/MaxMind-GeoIP-Database-Conversion-Citrix-ADC-Format

2.1) Converter Tool’ u indirme işlemini yaptıktan sonra, Converter Tool’u :

  • /var/netscaler/locdb dizisinin içine yüklüyoruz.

3) Converter Tool’ u Çalıştırma

Converter Tool’ u /var/netscaler/locdb klasörünün içine yükledikten sonra ssh il Converter Tool’u çalıştırıyoruz.

SSH’ la bağlandıktan sonra sırasıyla aşağıdaki komutları çalıştırıyoruz;

> shell

Copyright (c) 1992-2013 The FreeBSD Project.

Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994

        The Regents of the University of California. All rights reserved.

[email protected]# cd /var/netscaler/locdb/

[email protected]# chmod +x Convert_GeoIPDB_To_Netscaler_Format_WithContinent.pl

[email protected]#

3.1) Geoip2 Database’i Citrix ADC (Netscaler) Formatına Dönüştürme

Converter Tool’ u çalıştırdıktan sonra Perl işlemini yani GeoIP2 database’ ini netscaler formatına çeviriyoruz. Burada Perl etmemiz gereken dosyalar;

GeoLite2-Country-Blocks-IPv4.csv

GeoLite2-Country-Blocks-IPv6.csv

GeoLite2-Country-Locations-en.csv

SSH’ la bağlandıktan sonra sırasıyla aşağıdaki komutları çalıştırıyoruz;

[email protected]# perl Convert_GeoIPDB_To_Netscaler_Format_WithContinent.pl -b GeoLite2-Country-Blocks-IPv4.csv -i GeoLite2-Country-Blocks-IPv6.csv -l GeoLite2-Country-Locations-en.csv

Converting the file to netscaler format….

Converting the file to netscaler format….

[email protected]#

3.2) Perl işlemini Tamamladıktan Sonra;

Perl ettiğimiz yani Netscaler formatına dönüştürdüğümüz dosya zip’ li bir dosya olarak oluşturulur. Netscaler’ a bind etmemiz için zip’ li dosyayı açmamız gerekmektedir:

[email protected]# gunzip Netscaler_Maxmind_GeoIP_DB_IPv4.csv.gz

[email protected]# ls

COPYRIGHT.txt                                  

 LICENSE.txt

Netscaler_Maxmind_GeoIP_DB_IPv4.csv

Netscaler_Maxmind_GeoIP_DB_IPv6.csv.gz

4) Netscaler’ a Bind Etme

Netscaler formatına çevirdiğimiz GeoIP2 databse’ ini Citrix ADC (Netscaler) cihazına bind ediyoruz.

> add locationfile  /var/netscaler/locdb/Netscaler_Maxmind_GeoIP_DB_IPv4.csv

 Done

4.1) Location Wildcard Parameter

Citrix ADC (Netscaler) cihazında Wildcard “yes” olarak değil de “no” olarak geliyor. Bu komut yalnızca NetScaler 11.1 build 53.11 ve üst versiyonları için geçerlidir.

Wildcard’ ı “yes” olarak ayarlamak için:

> set locationParameter -matchWildcardtoany YES

5) Eklenen GeoIP2 Database Kontrolü

Bu komutu yazmamızın amacı eklemiş olduğumuz GeoIP2 database’ inde hata alıp almadığımızı kontrol etmektir. Görüldüğü üzere 323920 satır okunmuş ve 0 hata alınmıştır.

> show locationparameter

Static Proximity

—————-

Database mode: File

Flushing: Idle; Loading: Idle

Context: geographic

Qualifier 1 label: Continent

Qualifier 2 label: Country_Code

Qualifier 3 label: Subdivision_1_Name

Qualifier 4 label: Subdivision_2_Name

Qualifier 5 label: City

Qualifier 6 label: Organization

IPv4 Location file (format: netscaler):

 /var/netscaler/locdb/Netscaler_Maxmind_GeoIP_DB_IPv4.csv

Lines: 323920 Warnings: 0 Errors: 0

Current static entries: 323913  Current custom entries: 0

IPv6 Location File

Location file (format: ):

 Not loaded

Lines: 0 Warnings: 0 Errors: 0

Current static entries: 0  Current custom entries: 0

Match wildcard qualifier to any: YES

 Done

6) Senaryomuza Göre Policy Oluşturma:

Citrix ADC (Netscaler) cihazında www.tnetshop.com adresine farklı location’lardan yapılan istekleri  bloklamak için Responder Policy oluşturarak block işlemini gerçekleştirebiliriz.

  • AppExpert > Responder >  Responder Policy > Add
  • Name: Turkiye-Harici-Blok
  • Action: RESET

Expression: CLIENT.IP.SRC.MATCHES_LOCATION(“*.TR.*.*.*.*”).NOT

Not: Ben action olarak RESET kullandım, isterseniz action’ ı DROP da kullanabilirsiniz.


7) İlgili Virtual Server’ a bind etme.

Traffic Management > Load Balancing > Virtual Server ‘ üzerine sağ tıklayıp Edit’liyoruz:

 7.1) Policy Bind Etme  

Edit’ ledikte sonra Policies tabını add’ liyoruz.

  • Oluşturduğumuz Policy’nin type’ını şeçiyoruz:
  • Policy Binding’ den oluşturmuş olduğumuz policy’i seçmek için Click to select’ i seçiyoruz: 
  • Oluşturmuş olduğumuz Responder policy’ i seçip Select’ e tıklıyoruz.  
  • Policy’ imizin Priority’ sini belirledikten sonra Bind işlemini tamamlayabiliriz.

8) Policy’ i Test Etme

  1. Policy’i devreye alamadan siteyi kontrol ediyorum.

Site çalışmaktadır.

2. Policy’i devreye aldıktan sonra aşağıda da görüldüğü üzere sayfamız RESET dönmektedir.

3. Aşağıda da görüldüğü üzere Policy’miz hit etmektedir.

Tarih:Citrix (ADC) NetscalerMakaleler

55 Yorum

  1. Hi there mates, how is everything, and what you would like to say concerning
    this post, in my view its actually remarkable in support of me.

  2. I’m not that much of a internet reader to be honest
    but your blogs really nice, keep it up! I’ll go ahead and bookmark
    your website to come back later on. Many thanks

  3. It’s amazing to go to see this web site and reading the views of all mates concerning this post, while I am also keen of getting experience.|

  4. I for all time emailed this website post page to all my contacts, for the reason that if like to read it after that my
    contacts will too.

  5. WOW just what I was searching for. Came here by searching for %keyword%|

  6. It’s an remarkable article for all the web users; they will get benefit from it I am sure.|

  7. I will right away seize your rss as I can’t in finding your e-mail subscription hyperlink or newsletter service. Do you have any? Kindly permit me recognise so that I may just subscribe. Thanks.|

  8. That is a very good tip especially to those new to the blogosphere.
    Simple but very accurate info… Thanks for sharing this one.
    A must read article!

  9. Greetings I am so happy I found your web site, I really found you by accident, while I was researching on Bing for something else, Regardless I am here now and would just like to say many thanks for a marvelous post and a all round interesting blog (I also love the theme/design), I don’t have time to go through it all at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back to read much more, Please do keep up the fantastic work.|

  10. Amazing! This blog looks exactly like my old one! It’s on a entirely different topic but it has pretty much the same page layout and design. Wonderful choice of colors!|

  11. clan symbol knight online clanlar için ücretsiz bir
    paylaşım sitesidir.

  12. 2021 yılına gelindiğinde dünyanın dört bir yanından katılımcı sağlayan canlı bahis şirketleri,
    aynı zamanda kullanıcılarına
    gerekli bilgileri paylaşmaya devam etmektedir.Sürekli kapanan güvenilir bahis siteleri sık sık
    domain güncellemektedir.
    Yeni domainlere ulaşmak, en güvenilir bahis sitelerinin en güncel girişlerini kaçırmamak ve marsbahis giriş
    adreslerini takip etmek için hangibet.com u ziyaret edebilirsiniz.

    HangiBET ziyaretçilerine ve oyunculara en güvenilir bahis sitelerinin resmi giriş adreslerini sunan, türkiyede
    çok popüler olan marsbahis giriş adresini güncel tutan güvenilir bir sitedir.

    Marsbahis giriş haftada 1-2 defa kapanmaktadır.En güncel marsbahis giriş adresini hangibet üzerinden takip edebilirsiniz.Piyasada çok fazla fake/dolandırıcı site bulunmakta bu sitelerden zarar görmemek için
    Hangibet üzerinden en güvenilir bahis sitelerine ulaşabilir güvenli bir şekilde
    oyununuzu oynayabilirsiniz.
    Güvenilir bahis siteleri size daima kaliteli,
    yüksek bonuslu, 7-24 müşteri hizmetleri, canlı destek gibi
    özellikler sunar.
    Bu yüzden güvenilir bahis siteleri haricindeki sitelerde oynamanız önerilmez aksi
    takdirde mağdur olabilirsiniz.
    Mağdur olmamak adına hangibet üzerinden güvenilir bahis sitelerini tercih etmenizi öneririz.

  13. It’s awesome to visit this website and reading
    the views of all friends concerning this article, while I
    am also keen of getting knowledge.

  14. I constantly spent my half an hour to read this website’s articles or reviews all the time along with a cup of coffee.

    Feel free to surf to my page; CBD oil for dogs

  15. This video is presenting does vital flow work but also try to cover the
    following subject:https://www.facebook.com/pages/category/Health—Wellness-Website/Vital-flow-reviews-102135748499657/

    -vital flow for prostate

    -vitalflow prostate really works

    -vitalflow prostate support reviews

    One thing I noticed when I was researching info on does vital flow
    work was the absence of appropriate details.

    Does vital flow work nevertheless is an subject that I know something about.
    This video therefore should be relevant and of interest to you.

    ~~~~~~~~~~~~~~~~~~~~~

    Follow our video clips about does vital flow work as well as other comparable
    topics on

    Hi, after reading this remarkable piece of writing i am as well happy to
    share my familiarity here with mates.

  16. Heya i am for the first time here. I found this board and I find It really useful & it helped me out much.
    I hope to give something back and help others like you aided me.

  17. This video is presenting does vital flow work but also try to cover the following subject:https://www.facebook.com/pages/category/Health—Wellness-Website/Vital-flow-reviews-102135748499657/

    -vital flow for prostate

    -vitalflow prostate really works

    -vitalflow prostate support reviews

    One thing I noticed when I was researching info on does
    vital flow work was the absence of appropriate details.

    Does vital flow work nevertheless is an subject
    that I know something about. This video therefore should be relevant and of interest to you.

    ~~~~~~~~~~~~~~~~~~~~~

    Follow our video clips about does vital flow work as
    well as other comparable topics on

    This design is steller! You certainly know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!)
    Great job. I really loved what you had to say, and more than that,
    how you presented it. Too cool!

  18. Fred L. Fred L.

    Hello Muhammed, this post is so usefull and in my opinion, the only one to describe step by step what we have to do to import theses databases.

    Congratulations et thank you for sharing this man !

  19. Heya great blog! Does running a blog like this require a
    large amount of work? I have virtually no understanding of coding but I was hoping to
    start my own blog in the near future. Anyhow, should you have any ideas or techniques for new blog owners please share.
    I know this is off subject nevertheless I just had to ask.
    Kudos!
    Lovely information. Thanks a lot!

    Good information. Cheers!

    Wow all kinds of useful knowledge.
    How long do I have to use this product before I see results?

    Remember, it’s critical to give Lean Belly 3X an honest chance to work
    by taking it as recommended for at least 60 days.

    Like all Beyond 40 products, Lean Belly 3X is made with the
    highest quality ingredients, but no product will work miracles overnight.

    Have a look at my page – Lean belly 3x supplement side effects

  20. Definitely believe that which you stated. Your favorite justification seemed to be on the web the simplest thing to be aware of. I say to you, I definitely get irked while people consider worries that they just do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side-effects , people could take a signal. Will probably be back to get more. Thanks|

  21. It’s enormous that you are getting thoughts from this piece of writing as well as from our discussion made at this place.|

  22. Thank you for the auspicious writeup. It in fact was a amusement account it.
    Look advanced to far added agreeable from you! However, how can we communicate?

  23. Next time I read a blog, I hope that it does not disappoint me just as much as this
    particular one. I mean, Yes, it was my choice to read through, however I genuinely
    believed you would probably have something useful to talk
    about. All I hear is a bunch of whining about something
    you can fix if you were not too busy looking for attention.

  24. Do you have a spam problem on this site; I also am a blogger, and I was curious about your situation; we have developed some nice procedures and we are looking to trade methods with other folks, why not shoot me an email if interested.|

  25. Excellent post. I was checking continuously this blog and I’m impressed!
    Very useful information particularly the last part :
    ) I care for such information much. I was looking for this particular info for a very long time.
    Thank you and good luck.

  26. Heya i am for the primary time here. I came across this board and I to find It really useful & it helped me out much.
    I’m hoping to present one thing again and aid others like you aided me.

    Also visit my web site … buy weed – http://www.heraldnet.com,

  27. Heya this is somewhat of off topic but I was wanting
    to know if blogs use WYSIWYG editors or if you
    have to manually code with HTML. I’m starting a blog soon but have no coding knowledge so I wanted to get
    guidance from someone with experience. Any help would be enormously appreciated!

    Here is my web blog … best kratom

  28. Hello! This is kind of off topic but I need some help from an established blog.
    Is it hard to set up your own blog? I’m not very techincal but I can figure
    things out pretty quick. I’m thinking about creating
    my own but I’m not sure where to start. Do you have any
    ideas or suggestions? Thanks

    Review my web-site no thc cbd oil

  29. Everyone loves what you guys are up too. This sort of clever work and reporting!
    Keep up the wonderful works guys I’ve incorporated you guys
    to blogroll.

    my site best kratom

  30. Hello, i read your blog from time to time and i own a similar
    one and i was just wondering if you get a lot of spam remarks?
    If so how do you stop it, any plugin or anything you can suggest?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

    my webpage best kratom

  31. You ought to be a part of a contest for one of the greatest blogs online.

    I’m going to highly recommend this site!

    Also visit my web blog; buy weed

  32. Does your site have a contact page? I’m having a tough time locating it but, I’d like to shoot you an email.
    I’ve got some ideas for your blog you might be interested
    in hearing. Either way, great site and I look forward to seeing it expand
    over time.

    Feel free to surf to my blog post best kratom (http://www.peninsuladailynews.com)

  33. I’m truly enjoying the design and layout of your blog.
    It’s a very easy on the eyes which makes it much more enjoyable for
    me to come here and visit more often. Did you hire out a designer to create your theme?
    Superb work!

    Stop by my page: delta 8 gummies dizziness

  34. Hi it’s me, I am also visiting this website on a regular basis, this web page is really fastidious
    and the viewers are genuinely sharing pleasant thoughts.

    My web-site; best kratom

  35. Oh my goodness! Awesome article dude! Thanks, However
    I am encountering difficulties with your RSS.
    I don’t understand why I can’t subscribe to it. Is there anybody else having the same
    RSS issues? Anyone that knows the solution will you kindly respond?
    Thanx!!

    Also visit my homepage – premium jane (Phillip)

  36. Nice post. I learn one thing more challenging on completely different blogs everyday. It can at all times be stimulating to read content material from other writers and observe a little bit one thing from their store. I抎 desire to use some with the content on my blog whether or not you don抰 mind. Natually I抣l offer you a link in your internet blog. Thanks for sharing.

  37. The following time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I do know it was my choice to read, but I actually thought youd have one thing fascinating to say. All I hear is a bunch of whining about one thing that you could fix for those who werent too busy searching for attention.

  38. Howdy! I just would like to offer you a big thumbs up for your excellent info you’ve got
    here on this post. I am returning to your website for more soon.

  39. Every weekend i used to pay a visit this site, for the reason that i want
    enjoyment, since this this web page conations
    genuinely pleasant funny material too.

  40. excellent points altogether, you simply won a
    new reader. What could you recommend about your publish that you just made a few days in the past?
    Any positive?

  41. It’s the best time to make some plans for the future and it’s time to be happy.

    I’ve read this post and if I could I wish to suggest you few interesting
    things or suggestions. Maybe you could write next
    articles referring to this article. I want to read more things about it!

  42. Howdy! I know this is kinda off topic however I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest
    writing a blog article or vice-versa? My site covers a lot of the same
    subjects as yours and I think we could greatly benefit from each other.
    If you are interested feel free to shoot me an email.

    I look forward to hearing from you! Excellent blog by the way!

  43. Hello mates, its great post about educationand fully
    defined, keep it up all the time.

  44. whoah this weblog is wonderful i like studying your posts.
    Stay up the great work! You recognize, many people are searching round for
    this info, you could help them greatly.

  45. Hello There. I found your weblog the usage of msn. That is
    a really neatly written article. I will make sure to bookmark it and come back to learn more of your useful information.
    Thank you for the post. I’ll certainly return.

  46. My spouse and I stumbled over here different web page and thought I may as well
    check things out. I like what I see so i am just following you.
    Look forward to looking at your web page repeatedly.

  47. I am regular visitor, how are you everybody? This post posted at this site is truly nice.

  48. Hi! This post couldn’t be written any better! Reading through this post reminds me
    of my good old room mate! He always kept talking about this.

    I will forward this post to him. Fairly certain he will
    have a good read. Many thanks for sharing!

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir