Hanyen kafaffen haɗin cibiyar sadarwa da musayar bayanai tsakanin su suna da dangantaka da bude tashoshin. An haɗi da haɗin zirga-zirga ta hanyar takamaiman tashar jiragen ruwa, kuma idan an rufe shi a cikin tsarin, ba zai yiwu a aiwatar da wannan tsari ba. Saboda haka, wasu masu amfani suna da sha'awar turawa ɗaya ko fiye lambobi don daidaita yanayin hulɗar na'urorin. Yau za mu nuna yadda ake aiki a aiki a tsarin sarrafawa wanda ya dogara da kudan zuma Linux.
Bude wuraren budewa a cikin Linux
Kodayake a yawancin rabawa, ta hanyar tsoho, akwai kayan aiki na cibiyar sadarwa, amma duk da haka irin waɗannan sauye-sauye ba sa baka izinin cikakken siffanta buɗewar mashigai. Umurni a cikin wannan labarin za su dogara ne akan wani ƙarin aikace-aikacen da ake kira Iptables - wani bayani don gyara shafukan tacewar wuta ta amfani da haƙƙoƙin superuser. A duk gina OS a kan Linux, yana aiki iri ɗaya, sai dai umarnin da za a shigar shi ne daban, amma zamu magana akan wannan a kasa.
Idan kana so ka san ko wace tashar jiragen ruwa an riga an buɗe a kan kwamfutarka, zaka iya amfani da ginannen ciki ko mai amfani mai amfani dashi. Za a iya samun cikakkun bayanai don gano bayanin da ake bukata a cikin wani labarinmu ta danna kan mahaɗin da ke biyo baya, kuma za mu ci gaba da nazarin mataki na farko na buɗe mashigai.
Kara karantawa: Duba bude tashar jiragen ruwa a Ubuntu
Mataki na 1: Shigar iptables kuma duba dokoki
Aikace-aikacen iptables ba asalin sashin tsarin aiki ba, wanda shine dalilin da ya sa kake buƙatar shigar da kanka daga asusun ajiyar hukuma, sa'an nan kuma aiki tare da dokoki kuma gyara su a kowace hanya. Shigarwa bai dauki lokaci mai tsawo ba kuma anyi ta ta hanyar kwaskwarima mai kyau.
- Bude menu kuma gudu "Ƙaddara". Hakanan za'a iya yin wannan ta amfani da hotkey na yau da kullum. Ctrl + Alt T.
- A cikin rarraba dangane da Debian ko Ubuntu jerin
sudo apt shigar iptables
don fara shigarwa, kuma a cikin tushen Fedora -sudo yum shigar iptables
. Bayan shigar da maballin Shigar. - Yi aiki da superuser yancin ta rubuta kalmar sirri don asusunku. Lura cewa ba a nuna haruffan a lokacin shigarwa ba, anyi wannan don tsaro.
- Jira da shigarwa don kammala kuma tabbatar da cewa kayan aikin yana aiki ta hanyar nazarin jerin jerin dokoki, da dama
sudo iptables -L
.
Kamar yadda kake gani, umurnin yanzu ya bayyana a rarrabaiptables
da alhakin gudanar da mai amfani da wannan sunan. Har yanzu muna tuna cewa wannan kayan aiki yana aiki ne daga manyan 'yancin, saboda haka dole ne a haɗa da ƙilasudo
, kuma kawai sai sauran lambobin da sauran muhawarar.
Mataki na 2: Samar da Sharuddan Sharhi
Babu tashar jiragen ruwa da ke aiki kullum idan mai amfani ya haramta musayar bayanai a matakin matakin nasa na tafin wuta. Bugu da ƙari, rashin daidaitattun dokoki a nan gaba na iya haifar da bayyanar da kurakurai daban-daban yayin aikawa, saboda haka muna ba da shawara sosai ga ku bi wadannan matakai:
- Tabbatar cewa babu dokoki a cikin fayil ɗin sanyi. Zai fi kyau a yi rajistar umarni don cire su, da alama kamar haka:
sudo iptables -F
. - Yanzu mun ƙara doka don bayanan shigarwa a kwamfuta ta hanyar sa layin
sudo iptables - INPUT -i--A yarda
. - Game da wannan umurnin -
sudo iptables - KARANTA -wallai -J TAKA
- yana da alhakin sabuwar doka don aika bayani. - Ya rage kawai don tabbatar da hulɗar al'ada na dokokin da ke sama don cewa uwar garke na iya aikawa da saitunan. Don haka kana buƙatar tsayar da sababbin haɗi, da tsofaffi - don ba da damar. Anyi wannan ta hanyar
sudo iptables - INPUT -m state --state ANYA, YAKE -A yarda
.
Mun gode da sigogi na sama, kun samar da sakon da ya dace da karbar bayanai, wanda zai ba ku izinin hulɗa tare da uwar garken ko wata kwamfuta ba tare da wata matsala ba. Ya rage kawai don buɗe tashar jiragen ruwa ta hanyar yin hulɗa da gaske.
Mataki na 3: Gyara tashoshin da ake bukata
Ka riga ka saba da hanyar da aka kara sababbin dokoki zuwa tsarin sanyi na iptables. Akwai wasu muhawara don buɗe wasu mashigai. Bari mu bincika wannan hanya ta yin amfani da misalin wuraren shahararrun mashigai 22 da 80.
- Fara da na'ura wasan bidiyo kuma shigar da wadannan umarni biyu daya daya:
sudo iptables - INPUT -p tcp --dport 22 -j Dakata
.
sudo iptables - INPUT -p tcp --dport 80 -j TAKA - Yanzu bincika jerin dokoki don tabbatar da cewa an yi nasarar tura tashar jiragen ruwa. An yi amfani da shi don wannan umarnin da ya rigaya ya saba.
sudo iptables -L
. - Zaka iya ba da shi a cikin layi da kuma nuna duk bayanan ta amfani da ƙarin bayani, to, layin zai kasance kamar wannan:
sudo iptables -nvL
. - Canja manufofin zuwa daidaitattun via
sudo iptables -P INPUT DROP
kuma jin kyauta don fara aiki tsakanin nodes.
A cikin yanayin idan mai gudanarwa na kwamfuta ya riga ya riga ya riga ya kafa dokoki nasa ga kayan aiki, ya shirya zubar da fakiti a hanya mai mahimmanci zuwa wani abu, alal misali, ta hanyarsudo iptables - INPUT -D DROP
, kana buƙatar amfani da wani umurni sudo iptables:-I INPUT -p tcp --dport 1924 -j TAMBAYA
inda 1924 - tashar tashar jiragen ruwa. Yana ƙara da tashar da ake buƙata a farkon tsarin, sannan ba a bar fakitoci ba.
Bayan haka zaku iya rubuta dukkan layinsudo iptables -L
kuma tabbatar da an kafa duk abin da ke daidai.
Yanzu kuna san yadda ake tura tashar jiragen ruwa a cikin Linux tsarin aiki ta hanyar misali na ɗakunan Iptables masu amfani. Muna ba da shawara ka ci gaba da idanu akan layin da ke fitowa a cikin na'ura mai kwakwalwa lokacin shigar da umarni, wannan zai taimaka wajen gano kowane kurakurai a lokaci kuma kawar da su nan da nan.