Basebedisi ba bang ba thahasella ho bopa sebopeho se ikemetseng pakeng tsa lik'homphieutha tse peli. E fana ka mosebetsi ka thuso ea theknoloji ea VPN (Virtual Private Network). Tlhaloso e kenngoa ts'ebetsong ka liphallelo tse bulehileng kapa tse koetsoeng. Ka mor'a hore ho behoe katleho le ho hlophisoa ha likarolo tsohle, mokhoa ona o ka nkoa o feletse, 'me mohokahanyo o sireletsehile. Ho feta moo, re ka rata ho tšohla ka ho qaqileng ts'ebetsong ea thekenoloji e nkiloeng ka har'a client ClientVPN tsamaisong ea ts'ebeliso e thehiloeng ho kernel ea Linux.
Kenya OpenVPN ho Linux
Kaha basebelisi ba bangata ba sebelisa liphallelo tse thehiloeng Bibeleng, kajeno litaelo li tla thehiloe liphetolelong tsena. Maemong a mang, phapang e kholo ea ho kenya le ho ikamahanya ha OpenVPN u ke ke oa e hlokomela, ntle leha u lokela ho latela syntax ea kabo, eo u ka e balang ka eona litokomaneng tsa molao tsa tsamaiso ea hau. Re u fa hore u tsebe ka mokhoa o mong le o mong mohato o mong le o mong e le hore u utloisise ka ho qaqileng ketso e 'ngoe le e' ngoe.
Etsa bonnete ba hore o hopola hore ts'ebetsong ea OpenVPN e hlaha ka li-node tse peli (khomphuta kapa seva), e bolelang hore tlhomamiso le ts'ebetso li sebetsa ho bohle ba kenyang letsoho. Thuto ea rona e latelang e tla lebisa tlhokomelo ho sebetsa le mehloli e 'meli.
Mohato oa 1: Kopa OpenVPN
Ha e le hantle, o lokela ho qala ka ho eketsa lilaebrari tsohle tse hlokahalang ho lik'homphieutha. Lokisetsa ho netefatsa hore mosebetsi o sebelisoang o tla hahoa feela ka OS. "Terminal".
- Bula menyetla 'me u qalella console. U ka boela ua etsa sena ka ho hatisa motsoako oa senotlolo Ctrl + Alt + T.
- Sehlopha sa ho ngolisa
Sudo apt kenya openvpn bonolo-rsa
ho kenya lisebelisoa tsohle tse hlokahalang. Ka mor'a hore u kenelle, tobetsa Kenya. - Hlalosa phasewete bakeng sa akhaonto ea superuser. Botho ba ho pata ha ba hlahe lebokoseng.
- Tiisa ho kenyelletsa lifaele tse ncha ka ho khetha khetho e nepahetseng.
E-ea mohato o latelang feela ha ho kenngoa hoa lisebelisoa ka bobeli.
Mohato oa 2: Ho theha le ho lokisa Lekhotla la Bopaki
Setsi sa boitsebiso se ikarabella bakeng sa ho netefatsa lintlha tsa sechaba le ho fana ka mokhoa o matla oa ho kenyelletsa. E bōptjoa ho sesebelisoa seo basebelisi ba bang ba tla se kopanya hamorao, kahoo bula li-console ho PC e lakatsang mme u latele mehato ena:
- Fensetere bakeng sa ho boloka mefuta eohle e etselitsoe pele. U ka e beha kae kapa kae, empa ho molemo ho fumana sebaka se sireletsehileng. Sebelisa bakeng sa taelo ena
sudo mkdir / etc / openvpn / bonolo-rsa
moo / joalo / openvpn / bonolo-rsa - Sebaka sa ho etsa lengolo. - Ho phaella ka fensetereng ena ho hlokahala hore u behe li-scripts tse bonolo-rsa, 'me sena se phethiloe
sudo cp -R / usr / share / bonolo-rsa / joalo / openvpn /
. - Setsi sa tikoloho se bōptjoa boitsebisong bo loketseng. Qala ho ea ka fensetereng ena.
cd / joalo-joalo / openvpn / bonolo-rsa /
. - Ebe o tlatsa taelo e latelang tšimong:
sudo -i
# mohloli
# ./clean-all
# ./build-ca
Ha k'homphieutha ea seva e ka sala e le mong 'me ea fallela lisebelisoa tsa bareki.
Mohato oa 3: Lokisa Li-Certificate tsa Moahloli
Thupelo, eo u tla e tseba ka tlase, e tla lokela ho etsoa mocheng o mong le e mong oa k'homphieutha bakeng sa ho hlophisa khokahano e sireletsehileng ea sebetsang hantle.
- Bula console mme u ngole taelo moo.
sudo cp -R / usr / share / bonolo-rsa / joalo / openvpn /
ho kopitsa mangolo ohle a hlokahalang a sesebelisoa. - Nakong e fetileng, faele e fapaneng ea setifikeiti e entsoe ka PC ea seva. Hona joale e lokela ho kopitsoa le ho kenngoa foldareng le likarolo tse ling. Tsela e bonolo ka ho fetisisa ea ho etsa sena ke ka taelo.
sudo scp lebitso la hau @ host: /etc/openvpn/easy-rsa/keys/ca.crt / etc / openvpn / bonolo-rsa / linotlolo
moo lebitso la username @ le amohela - aterese ea thepa eo u lokelang ho e jarolla. - E sala feela bakeng sa ho hlahisa senotlolo sephiring sa hau e le hore nakong e tlang e tla tsamaisana le eona. Etsa sena ka ho ea fensetereng ea polokelo ea script.
cd / joalo-joalo / openvpn / bonolo-rsa /
. - Ho theha faele, sebelisa taelo:
sudo -i
# mohloli
# Lumpics ea ho hahaLumpics tabeng ena, lebitso le hlalositsoeng la faele. Senotlolo se hlahisitsoeng se tlameha ho ba sebokeng se le seng le linotlolo tse ling.
- E sala feela bakeng sa ho romela kemiso ea ho kena e loketseng ho sesebedisoa sa seva ho tiisa botšepehi ba eona. Sena se etsoa ka thuso ea taelo e le 'ngoe eo ho etsoang download ho eona. U lokela ho kena
scp /etc/openvpn/easy-rsa/keys/Lumpics.csr lebitso la ka @ host: ~ /
moo lebitso la username @ le amohela - lebitso la k'homphieutha ho romela, le Lumpics.csr - lebitso la faele ka senotlolo. - Ho PC ea seva, netefatsa sefono ka tsela
./sign-req ~ / Lumpics
moo Lumpics - lebitso la faele. Ka mor'a moo, khutlisetsa tokomane eo hapesudo scp lebitso la hau @ host: /home/Lumpics.crt / etc / openvpn / bonolo-rsa / linotlolo
.
Ena ke qetello ea mosebetsi oa pele, tsohle tse setseng ke ho tlisa OpenVPN ka boeona boemong bo tloaelehileng 'me u ka qala ho sebelisa khokahanyo ea sekhukhu le mong kapa ba bangata ba bareki.
Mohato oa 4: Lokisa OpenVPN
Tataiso e latelang e tla sebetsa ho bohle ba kenyang le seva. Re tla arola ntho e 'ngoe le e' ngoe ho ea ka liketso ebe re lemosa ka liphetoho tsa mechine, kahoo u tlameha ho latela litaelo.
- Taba ea pele, bopa faele ea setupatso ho PC ea seva ho sebelisa taelo
zcat /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf
. Ha o lokisetsa lisebelisoa tsa bareki, faele ena e tla tlameha ho bōptjoa ka thoko. - Bala litekanyetso tse tloaelehileng. Joalokaha u ka bona, sekepe le protocol li tšoana le maemo a tloaelehileng, empa ha ho na meeli e eketsehileng.
- Sebelisa e hlahisoang fomati ea faele ka mohlophisi
sudo nano /etc/openvpn/server.conf
. - Re ke ke ra kena lintlheng tsa ho fetola litekanyetso tsohle, kaha maemong a mang li na le batho ka bomong, empa mela e tloaelehileng fesheneng e lokela ho ba teng, empa setšoantšo se tšoanang se shebahala:
port 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 ea topology
seva 10.8.0.0 255.255.255.0
haebaconfig-letamo-le phehella ipp.txtKa mor'a hore liphetoho tsohle li phethoe, boloka litlhophiso 'me u koale fono.
- Sebetsa le karolo ea seva e phethiloe. Matha OpenVPN ka ho hlahisa faele ea tlhomamiso
openvpn /etc/openvpn/server.conf
. - Hona joale re tla qala lisebelisoa tsa bareki. Joalokaha ho se ho boletsoe, faele ea ho setjha e boetse e bōptjoa mona, empa lekhetlong lena ha e hlakoloe, kahoo taelo e na le foromo e latelang:
sudo cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf /etc/openvpn/client.conf
. - Qala faele ka tsela e ts'oanang le e bontšitsoeng ka holimo 'me u behe mela e latelang moo:
mookameli
.
dev tun
proto udp
hole 194.67.215.125 1194
rarolla-leka hape ho sa feleng
e le hantle
phehella-senotlolo
tsitsitseng tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Sergiy.crt
key /etc/openvpn/easy-rsa/keys/Sergiy.key
tls-auth ta.key 1
comp-lzo
leetsi la 3Ha ho hlophisoa ho phethiloe, qala OpenVPN:
openvpn /etc/openvpn/client.conf
. - Sehlopha sa ho ngolisa
haebaconfig
ho etsa bonnete ba hore tsamaiso e sebetsa. Har'a mekhoa eohle e bontšitsoeng, ho tlameha hore ho be le sebopeho tun0.
Ho tsamaisa sephethephethe le ho bulela ho fumana Inthaneteng bakeng sa bareki bohle ho PC ea seva, u tla hloka ho kenya litaelo tse thathamisitsoeng ka tlase ka ho latellana.
sysctl -w net.ipv4.ip_forward = 1
li-iptables -A NAKOTSI -pp - ho phatlalatsa 1194 -j amohela
li-iptables-KE NALEKANE -a tun0 -o e -00 -j amohela
li-iptables-KE NA LEBAKA -e leng-o-o-o amohella
li-iptables -e nat -A POSTROUTING -o eth0 -j MASQUERADE
Ka sehloohong sa kajeno, u ile ua tsebisoa ho kenya le ho ikamahanya ha OpenVPN ka lehlakoreng la seva le la bareki. Re u eletsa hore u ele hloko litsebiso tse bontšitsoeng "Terminal" le ho hlahloba mekhoa ea phoso, haeba e le teng. Liketso tse joalo li tla thusa ho qoba mathata a eketsehileng le ho hokahanya, hobane tharollo ea ts'ebetso ea bothata e sitisa ho hlaha ha mathata a mang.