Momwe mungagwiritsire ntchito AntispamSniper kwa The Bat!

Ena ogwiritsira ntchito akufunanso kupanga pakompyuta pamtunda pakati pa makompyuta awiri. Amapereka ntchitoyo mothandizidwa ndi teknoloji ya VPN (Virtual Private Network). Kugwirizana kumeneku kumayendetsedwa kudzera kumagulu otsegulidwa kapena otsekedwa ndi mapulogalamu. Pambuyo pomangika bwino ndikukonzekera zigawo zonse, ndondomekoyi ikhonza kukhala yodzaza, ndi kugwirizana - kotetezedwa. Kuwonjezera apo, tikufuna kukambirana mwatsatanetsatane za kukhazikitsidwa kwa tekinoloje yoganiziridwa kudzera mwa kasitomala OpenVPN mu dongosolo loyendetsera ntchito pogwiritsa ntchito kernel ya Linux.

Ikani OpenVPN pa Linux

Popeza anthu ambiri amagwiritsa ntchito magawidwe a Ubuntu, lero malangizowa adzakhazikitsidwa pamatembenuzidwe awa. Nthaŵi zina, kusiyana kwakukulu mu kukhazikitsa ndi kukonza kwa OpenVPN simudzazindikira, kupatula ngati mutatsatira tsatanetsatane wa kufalitsa, zomwe mungathe kuziwerenga mu zolembedwera zadongosolo lanu. Timakupatsani inu kuti mudzidziwe nokha ndi ndondomeko yonseyo kuti muzimvetse mwatsatanetsatane ntchito iliyonse.

Onetsetsani kukumbukira kuti opaleshoni ya OpenVPN imapezeka kudzera m'makina awiri (kompyuta kapena seva), zomwe zikutanthauza kuti kukhazikitsa ndi kukonzekera kumagwira ntchito kwa onse omwe akugwirizana nawo. Phunziro lathu lotsatira lidzakumbukira kugwira ntchito ndi magwero awiri.

Khwerero 1: Sungani OpenVPN

Inde, muyenera kuyamba kuwonjezera makalata onse oyenera ku makompyuta. Konzani kuonetsetsa kuti ntchito yogwiritsidwa ntchito idzakhala yokhazikika mu OS. "Terminal".

  1. Tsegulani menyu ndipo yambani kutsegula. Mukhozanso kuchita izi mwakulumikiza makiyi ofunikira Ctrl + Alt + T.
  2. Lembani guluSudo apt kukhazikitsa openvpn mosavuta-rsakukhazikitsa zofunikira zonse zofunikira. Pambuyo polowani dinani Lowani.
  3. Tchulani mawu achinsinsi pa akaunti yodabwitsa. Omwe akujambula samawoneka m'bokosi.
  4. Onetsetsani Kuwonjezera kwa mafayilo atsopano mwa kusankha njira yoyenera.

Pitani ku sitepe yotsatira pokhapokha ngati maimidwewa apangidwa pa zipangizo ziwirizo.

Gawo 2: Kupanga ndi Kukonza Chidziwitso Chachidziwitso

Chidziwitso cha malo ndi udindo woonetsetsa makiyi a anthu ndikupatsirana mwamphamvu. Icho chimalengedwa pa chipangizo chimene otsala ena adzalumikizana nacho, kenaka mutsegule pulogalamuyi pa PC yofunayo ndikutsata izi:

  1. Foda ya kusungiramo mafungulo onse adayambitsidwa. Mutha kuziika paliponse, koma ndi bwino kupeza malo otetezeka. Gwiritsani ntchito lamulo ilisudo mkdir / etc / openvpn / zosavutakumene / etc / openvpn / zosavuta - Malo okonza cholemba.
  2. Kuwonjezera pa foda iyi imayenera kuyika mosavuta-rsa zowonjezerapo, ndipo izi zachitikasudo cp -R / usr / gawo / mosavuta-rsa / etc / openvpn /.
  3. Chigawo chovomerezeka chimapangidwira m'ndandanda yokonzeka. Choyamba pitani ku foda iyi.cd / etc / openvpn / zovuta-rsa /.
  4. Kenaka pangani lamulo lotsatila kumunda:

    sudo -i
    #yambira ./vars
    # ./clean-all
    # ./build-ca

Pamene kompyutesi ya seva ingasiyidwe yokha ndikusunthira ku makasitomala apamwamba.

Khwerero 3: Konzani Zolemba Zanyumba

Malangizo, omwe mudzawadziwe pansipa, adzafunika kuchitidwa pa kompyuta iliyonse ya kasitomala kuti akonze mgwirizano wotetezeka wogwira ntchito bwino.

  1. Tsegulani console ndipo lembani lamulo pamenepo.sudo cp -R / usr / gawo / mosavuta-rsa / etc / openvpn /kuti mufanizire zida zonse zofunika zolemba.
  2. Poyamba, fayilo yapadera yovomerezeka inalengedwa pa PC seva. Tsopano ikufunika kuti ikopedwe ndi kuyikidwa mu foda ndi zigawo zina. Njira yosavuta yochitira izi ndi kudzera mwa lamulo.sudo scp username @ host: /etc/openvpn/easy-rsa/keys/ca.crt / etc / openvpn / zovuta-rsa / makiyikumene username @ wothandizira - adiresi ya zipangizo zomwe mungatsatire.
  3. Zimangokhala pokhapokha mutsegula chinsinsi chachinsinsi kuti mtsogolomu ikhale yolumikizidwa kudzera mu izo. Chitani izi mwa kupita ku foda yosungirako script.cd / etc / openvpn / zovuta-rsa /.
  4. Kuti mupange fayilo, gwiritsani ntchito lamulo:

    sudo -i
    #yambira ./vars
    # Lupics zokonza

    Lumpics Pankhaniyi, dzina la fayilo. Mfungulo wopangidwawo uyenera kuti ukhale m'ndandanda womwewo ndi mafungulo ena.

  5. Ikutsalira kokha kutumiza chinsinsi chofikira cholozera ku chipangizo cha seva kuti chitsimikizire kutsimikizika kwa kugwirizana kwake. Izi zachitika ndi kuthandizidwa ndi lamulo lomwelo lopangidwa. Muyenera kulowascp /etc/openvpn/easy-rsa/keys/Lumpics.csr dzina lanu @ host: ~ /kumene username @ wothandizira - dzina la kompyuta kutumiza, ndi Lumpics.csr - dzina la fayiloyo ndi fungulo.
  6. Pa PC seva, chitsimikizani makiyiwo kudzera./sign-req ~ / Lumpicskumene Lumpics - fayilo dzina. Pambuyo pake, bweretsani chikalatachosudo scp username @ host: /home/Lumpics.crt / etc / openvpn / zovuta-rsa / makiyi.

Ili ndilo mapeto a ntchito yoyamba yonse, zonse zomwe zatsala ndikutulutsa OpenVPN yokha ku boma labwino ndipo mungayambe kugwiritsa ntchito mgwirizano wamtundu wapadera ndi mmodzi kapena angapo makasitomala.

Khwerero 4: Konzani OpenVPN

Chotsatira chotsatirachi chidzagwiritsidwa ntchito kwa onse ofuna chithandizo ndi seva. Tidzagawa zonse molingana ndi zochita ndikuchenjeza za kusintha kwa makina, kotero muyenera kutsatira malangizo.

  1. Choyamba, pangani mafayilo osinthika pa PC seva pogwiritsa ntchito lamulozcat /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf. Pamene mukukonzekera zipangizo zamakono, fayiloyi iyeneranso kulengedwa mosiyana.
  2. Werengani mfundo zoyenera. Monga momwe mukuonera, doko ndi ndondomeko zili zofanana ndi zomwe zilipo, koma palibe magawo ena.
  3. Tengerani makina okonzekera mafayilo kudzera mu editorsudo nano /etc/openvpn/server.conf.
  4. Sitidzatha kusintha ndondomeko zonse, popeza nthawi zina iwo ali pawokha, koma mizere yoyenera mu fayilo iyenera kukhalapo, koma chithunzi chomwecho chikuwoneka ngati ichi:

    doko 1194
    proto udp
    comp-lzo
    dev tun
    ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
    cert /etc/openvpn/easy-rsa/2.0/keys/ca.crt
    dh /etc/openvpn/easy-rsa/2.0/keys/dh2048.pem
    subnet
    seva 10.8.0.0 255.255.255.0
    ngaticonfig-pool-imapitiriza ipp.txt

    Zonsezi zitatha, sungani zosintha ndi kutseka fayilo.

  5. Gwiritsani ntchito gawo la seva lakwaniritsidwa. Thamangani OpenVPN kupyolera muzithunzi zosinthikaopenvpn /etc/openvpn/server.conf.
  6. Tsopano tiyambitsa makasitomala apangizo. Monga tanenera kale, mafayilo opangidwirawo adalengedwanso pano, koma nthawiyi sichimasulidwa, kotero lamulo liri ndi mawonekedwe awa:sudo cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf /etc/openvpn/client.conf.
  7. Kuthamangitsa fayilo mofanana ndiwonetsedwa pamwambapa ndi kuyika mizere yotsatira apo:

    wothandizira
    dev tun
    proto udp
    kutali 194.67.215.125 1194
    tsimikizani-yesetsani zosatha
    nobind
    pitirizani-fungulo
    Pitirizani kugwirizana
    ca /etc/openvpn/easy-rsa/keys/ca.crt
    cert /etc/openvpn/easy-rsa/keys/Sergiy.crt
    Chinsinsi /etc/openvpn/easy-rsa/keys/Sergiy.key
    tls-auth ta.key 1
    comp-lzo
    vesi 3
    .

    Kusintha kukamaliza, yambani OpenVPN:openvpn /etc/openvpn/client.conf.

  8. Lembani guluifconfigkuonetsetsa kuti dongosolo likugwira ntchito. Mwazinthu zonse zomwe zikuwonetsedwa, payenera kukhala mawonekedwe tun0.

Kuti mutsogolere pamsewu ndi kutsegula ma intaneti pa makasitomala onse pa PC seva, muyenera kuyika malamulo awa pansipa.

sysctl -w net.ipv4.ip_forward = 1
iptables -KUTUMWA -p kudp - kulengeza 1194 -j Kulandira
iptables -I CHIKHALIDWE -chiganizo -chith0 -j Kulandira
iptables -I NDIPONSO -iwo_maganizo -j kulandira
iptables -m nat -A POSTROUTING -m eth0 -j MASQUERADE

M'nkhani yamakono, inu mwadziwitsidwa ku kukhazikitsa ndi kukonza kwa OpenVPN pa seva ndi mbali ya kasitomala. Tikukulangizani kuti muzimvetsera zolemba zomwe zasonyezedwa "Terminal" ndi kufufuza ziphuphu zolakwika, ngati zilipo. Zochita zofananazi zidzakuthandizani kupeŵa mavuto ena ndi kugwirizana, chifukwa njira yothetsera vutoyo imalepheretsa maonekedwe enawo akuwoneka.