Next Previous Contents

8. O SOCKS Diakomisths Ejoysiodothshs

8.1 Sthnontas to Diakomisth Ejoysiodothshs

O SOCKS diakomisths ejoysiodothshs einai dia8esimos apo to ftp://sunsite.unc.edu/pub/Linux/system/Network/misc/socks-linux- src.tgz. Ekei einai kai ena paradeigma toy arxeioy ry8misewn (config file) poy kaleitai "socks-conf". Aposympieste ta arxeia mesa se katalogo toy systhmatos sas, kai akoloy8hste tis odhgies panw sto pws 8a to ftiajete. Eixa merika problhmata otan to eftiaja ayto. Sigoyreythte oti ta Makefile arxeia sas einai entajei.

Ena symantiko pragma gia na shmeiwsoyme einai oti o diakomisths ejoysiodothshs xreiazetai na proste8ei sto arxeio /etc/inetd.conf. Prepei na pros8esete th grammh :

  socks  stream  tcp  nowait  nobody  /usr/local/etc/sockd  sockd

gia na peite sto diakomisth na trejei otan toy zhth8ei. to tell the server to run when requested.

8.2 Ry8mizontas to Diakomisth Ejoysiodothshs.

To programma SOCKS xreiazetai duo xwrista arxeia ry8misewn. Ena na leei thn epitrepomenh prosbash, kai ena gia na dromologei tis aithseis sto katallhlo diakomisth ejoysiodothshs. To arxeio prosbashs prepei na brisketai sto diakomisth. To arxeio dromologhshs ofeiletai na brisketai se ka8e Un*x mhxanhma. Oi DOS kai, ypoti8emenoi, Macintosh Y/H 8a kanoyn dikes toys dromologhseis.

To Arxeio Prosbashs

Me to socks4.2 Beta, to arxeio prosbashs kaleitai "sockd.conf". Ayto ofeilei na periexei 2 grammes, mia grammh adeia kai mia arnhsews. Ka8e grammh 8a exei tria pedia:

O ejakribwths einai h adeias h arnhsews. Ofeilete na exete amfotera mia grammh adeias kai mia arnhsews.

H IR dieu8ynsh krata mia tessarwn byte dieu8ynsh se typikh IR shmeiwsh koykidas. p.x. 192.168.2.0.

O tropopoihths diey8unsewn einai epishs mia typikh IR dieu8ynsh tessarwn byte. Ayto doyleuei san maska diktuoy (netmask). Oramatisthte ayto ton ari8mo na einai 32 bit (1 h 0). Ean to bit einai 1, to antistoixo bit apo th dieu8ynsh poy elegxete prepei na einai idio me to antistoixo bit mesa sto pedio twn IR diey8unsewn. p.x. ean h grammh einai:

    permit 192.168.2.23 255.255.255.255

ayto 8a dinei adeia mono se IR diey8unseis poy tairiazoyn se ka8e bit mesa 192.168.2.23, p.x. mono 192.168.2.3. H grammh:

    permit 192.168.2.0 255.255.255.0

8a dwsei adeia se ka8e ari8mo mesa sthn omada 192.168.2.0 ews 192.168.2.255, olh h C klash perioxh. Den prepei na exete th grammh:

    permit 192.168.2.0 0.0.0.0

epeidh ayth dinei adeia se ka8e dieu8ynsh, adiaforo.

Etsi, prwta dinoyme adeia se oles tis diey8unseis poy 8eloyme na dwsoyme adeia, kai tote aporriptoyme tis ypoloipes. Gia na afhsete toys pantes mesa sth perioxh 192.168.2.xxx, oi grammes:

    permit 192.168.2.0 255.255.255.0
    deny 0.0.0.0 0.0.0.0

8a doylecoyn kala. Shmeiwste oti to prwto "0.0.0.0" einai h grammh arnhsews. Me enan ena tropopoihth apo 0.0.0.0, to pedio IR dieu8ynshs den peirazei. Ola ta 0 einai kanonas epeidh einai eukola sth plhktrologhsh.

Perissoteres apo mia katagrafes apo to ka8ena epitrepontai.

Sygkekrimenoi xrhstes mporoun epishs na kerdisoyn h na toys apagoreytoun prosbaseis. Ayto ginetai mesw diamorfwshs ths diadikasias epikurwshs. Den to yposthrizoyn ola ta systhmata th diamorfwsh, perilambanomenoy toy Trumpet Winsock, etsi den 8a anafer8w se ayto edw. H tekmhriwsh poy periexei to socks einai entelws eparkhs gi' ayto to antikeimeno.

To arxeio Dromologhshs.

To arxeio dromologhshs einai ftwxa onomasmeno sto SOCKS "socks.conf". Eipa "ftwxa onomasmeno" epeidh einai toso konta sto onoma toy arxeio prosbashs poy einai eukolo na ta mperdecete.

To arxeio dromologhshs einai ekei gia na leei stoys SOCKS pelates pote na xrhsimopoioun to socks kai pote oxi. p.x. Sto diktyo mas, to 192.168.2.3 den 8a xreiastei ma xrhsimopoihsei to socks gia na epikoinwnhsei me to 192.168.2.1, to firewall. Exei amesh sundesh mesw toy Ethernet. Ayto ka8orizei to 127.0.0.1, ton epistrefomeno brogxo (loopback), aytomata. Bebaiws den xreiazeste to SOCKS gia na epikoinwnhsete me ton eayto sas. Yparxoyn treis eisagwges:

H arnhsh (deny) leei sto SOCKS pote na aporriptei mia aithsh. Ayth h eisagwgh exei ta idia tria pedia opws to sockd.conf, ton ejakribwth (identifier), dieu8ynsh kai tropopoihth (modifier). Genika, epeidh ayto xeirizetai epishs apo to sockd.conf, to arxeio prosbashs, to pedio toy tropopoihth einai orismeno sto 0.0.0.0. Ean 8elete na prologhsete ton eayto sas sto na kaleite apo pantou, mporeite na to kanete edw.

H direct eisagwgh leei gia poies diey8unseis na mhn xrhsimopoihtai to socks. Aytes einai oles oi diey8unseis poy mporoun na proseggis8oun xwris to diakomisth ejoysiodothshs. 3ana exoyme tria pedia, ejakribwth, dieu8ynsh kai tropopoihth. To paradeigma mas 8a exei

    direct 192.168.2.0 255.255.255.0

Etsi metabainei amesa o ka8enas panw sto prostateyomeno diktyo.

H sockd eisagwgh leei ston H/Y poios host exei ton socks diakomisth daimona panw toy. H suntajh einai:

  sockd @=<serverlist> <IP address> <modifier>

Shmeiwste th @= eisagwgh. Ayth epitrepei na sthsete tis IR diey8unseis apo mia lista apo diakomistes ejoysiodothshs. Sto paradeigma mas, xrhsimopoioume mono ena diakomisth ejoysiodothshs. Alla, mporeite na exete arketous gia na epitrepete megalutera fortia kai gia pleonasma se periptwsh elleichs.

Ta pedia IR dieu8ynsh kai tropopoihths doyleuoyn san ola ta alla paradeigmata. Na ka8orizete poies diey8unseis phgainoyn poy mesw apo ayta. The IP address and modifier fields work just like in the other examples. You specify which addresses go where through these.

DNS pisw apo to firewall.Sthnontas thn Onoma Perioxhs Yphresia (Domain Name Service) pisw apo firewalleinai omologoymenos eukolo 8ema. Xreiazeste apla kai mono na sthsete to DNSpanw sto mhxanhma poy einai o firewall. Meta, oriste se ka8e mhxanhma piswapo to firewall na xrhsimopoioun ayth to DNS.

8.3 Doyleuontas me Diakomisth Ejoysiodothshs.

Unix

Gia na exete tis efarmoges sas na doyleuoyn me to diakomisth ejoysiodothshs, xreiazontai na ginoyn "sockified". 8a xreiasthte duo diaforetika telnet, ena gia amesh epikoinwnia kai ena gia epikoinwnia mesw toy diakomisth ejoysiodothshs. To SOCS erxetai me odhgies panw sto pws na kanete SOCKify ena programma, toso oso kai merika pre-SOCKified programmata. Ean xrhsimopoihte mia SOCKified ekdosh gia na pate kapoy amesa, to SOCS aytomata 8a allajei sthn amesh ekdosh gia esas. Epeidh ginetai ayto, 8eloyme na metonomasoyme ola ta programmata sto proswpiko mas diktyo kai na ta antikatasthsoyme me SOCKified programmata. p.x to "Finger" ginetai "finger.orig", to "telnet" ginetai "telnet.orig", k.o. Prepei na peite sto SOCKS sxetika me ayta mesw toy include/socks.h arxeioy.

Sygkekrimena programmata 8a xeirizontai roytines kai 8a kanoyn sockify ton eayto toys. To Netscape einai ena apo ayta. Mporeite na xrhsimopoihte diakomisth ejoysiodothshs katw apo to Netscape eisagontas th dieu8ynsh toy diakomisth (192.168.2.1 sth periptwsh mas) mesa sto pedio SOKCs katw apo ta Proxies. H ka8e efarmogh 8a xreiastei ligh trofodothsh, asxeta apo to pws ths xeirizetai o diakomisth ejoysiodothshs.

MS Windows me Trumpet Winsock

To Trumpet Winsock erxetai me enswmatwmenes diakomisth ejoysiodothshs dynatothtes. Mesa sto menou "egkatastashs (setup)", eisagete thn IR dieu8ynsh apo to diakomisth, kai tis diey8unseis apo oloys toy H/Y poy einai syndedemenoi amesa. To Trumpet tote 8a xeiristei ola ta ejerxomena paketa.

Kanontas to Diakomisth Ejoysiodothshs na doyleuei me UDP Paketa

To paketo SOCKS doyleuei mono me paketa TCP, kai oxi UDP. Ayto to kanei ligotero xrhsimo. Polla xrhsima programmata, opws to talk kai to Archie, xrhsimopoioun UDP. Yparxei ena paketo sxediasmeno gia na xrhsimopoih8ei san diakomisths ejoysiodothshs gia paketa UDP kai kaleitai UDPrelay, apo ton Tom Fitzgerald <fitz@wang.com>. Dystyxws, th stigmh poy grafete ayto to HOWTO, den einai symbato me to Linux.

8.4 Meionekthmata me toys Diakomistes Ejoysiodothshs

O diakomisths ejoysiodothshs einai, panw ap' ola, mia asfalhs syskeyh. Xrhsimopoiwntas ton gia na ayjhsete thn prosbash sto Internet me periorismenes IR diey8unseis 8a exete polla meionekthmata. Enas diakomisths ejoysiodothshs 8a epitrepei kalliterh prosbash apo to eswteriko toy prostateyomenoy diktuoy pros ta ejw, alla 8a krata to eswteriko apolutws aprosbasto ap' ejw. Ayto shmainei oxi diakomistes, talk h archie syndeseis, h ameso taxydromeio stoys eswterikous ypologistes. Ayta ta meionekthmata mporei na fainontai ashmanta, alla skefthte me ayto to tropo:

To FTP dhmioyrgei allo ena problhma me to diakomisth ejoysiodothshs. Otan katebazete h kanete ls, o diakomisths FTP anoigei mia ypodoxh sth mhxanh pelath kai stelnei tis plhrofories mesw ayths. O diakomisths ejoysiodothshs den 8a to epitrecei ayto, etsi to FTP sygkekrimena den 8a doylecei.

Kai, oi diakomistes ejoysiodothshs einai argoi. Logw ths kalliterhs megalhs kalychs-elegxoy (overhead), sxedon ka8e allo meso apo to opoio pairnoyme ayth th prosbash 8a einai taxutero.

Basika, ean exete tis IR diey8unseis, kai den anhsyxhte sxetika me thn asfaleia, mhn xrhsimopoieite firewall kai/h diakomistes ejoysiodothshs. Ean den exete tis IR diey8unseis, kai epishs den exete na anhsyxhte gia thn asfaleia, mporeite epishs na rijete mia matia gia na xrhsimopoihsete ena ejomoiwth IR, san ta Term, Slirp h TIA. To Term einai dia8esimo apo to ftp://sunsite.unc.edu, to Slirp einai dia8esimo apo to ftp://blitzen.canberra.edu.au/pub/slirp, kai to TIA einai dia8esimo apo to marketplace.com. Ayta ta paketa 8a trexoyn taxutera, epitrepoyn kalliteres syndeseis, kai parexoyn megaloy epipedoy apo prosbash gia to eswteriko toy diktuoy apo to Internet. Oi diakomistes ejoysiodothshs einai kaloi gia ta diktya ayta poy exoyn pollous host poy 8a 8eloyn na syndeontai sto Internet "on the fly", me mia egkatastash kai ligh doyleia meta.


Next Previous Contents