Next Previous Contents

7. Dromologhsh

An xrhsimopoieite ena H/Y Linux me duo kartes diktuoy gia na dromologeite metaju duo (h perissoterwn)ypodikuwn, xreiazetai na exete energopoihsei thn IP Prow8hsh (IP Forwarding) ston pyrhna sas. Kante ena


        cat /proc/ksyms | grep ip_forward

8a prepei na sas epistrecei kati san...


00141364 ip_forward_Rf71ac834

An oxi, tote den exete energopoihsei thn IP Prow8hsh (IP-Forwarding) ston pyrhna sas kai xreiazetai na epanametaglwtissete kai na egkatasthsete enan neo.

Gia xarh toy paradeigmatos, as ypo8esoyme pws exete apofasisei na ypodiktywsete ton C klashs ari8mo diktuoy sas 192.168.1.0 se 4 ypodiktya (to ka8ena apo 62 xrhsimopoihsimoys interface/host ari8mous IP). Parola ayta, duo apo ayta ta diktya syndyazontai se ena megalutero eniaia diktyo, dinontas tria fysika diktya.

ayta einai :-


Network         Broadcast       Netmask                 Hosts
192.168.1.0     192.168.1.63    255.255.255.192         62
192.168.1.64    192.168.1.127   255.255.255.192         62
182.168.1.128   192.168.1.255   255.255.255.126         124 (des shmeiwsh)

Shmeiwsh: o logos poy to teleytaio diktyo exei mono 124 xrhsimopoihsimes diey8unseis diktuoy (oxi 126 opws 8a perimename apo thn maska diktuoy) einai giati sthn pragmatikothta einai ena 'yper-diktyo' duo ypodiktuwn. Oi Hosts sta alla duo diktya 8a metafrazoyn to 192.168.1.192 san thn diktyakh dieu8ynsh toy 'mh-yparktou' ypodiktuoy. Paromoia, 8a metafrazoyn to 192.168.1.191 san thn dieu8ynsh ekpomhs/anakoinwshs toy 'mh-yparktou' ypodiktuoy.

Etsi, an xrhsimopoieite to 192.168.1.191 h to 192 san host diey8unseis toy tritoy diktuoy, tote oi mhxanes twn duo mikroterwn ypodiktuwn den 8a einai ikanes na epikoinwnoun mazi toys.

Ayto katadyknuei ena shmantiko 8ema me ta ypodiktya - oi xrhsimopoihsimes diey8unseis ka8orizontai apo to MIKROTERO ypodiktyo ston xwro diey8unsewn sas.

7.1 Oi pinakes dromologhsewn (routing tables)

As ypo8esoyme oti enas ypologisths poy trexei Linux dra san router gia ayto to diktyo. 8a exei tria interfaces diktuoy sta topika LANs kai pi8anon ena tetarto interface sto Internet (poy 8a apotelei kai thn proka8orismenh toy dromologhsh).

As ypo8esoyme oti to Linux xrhsimopoiei thn xamhloterh dia8esimh IP dieu8ynsh se ka8e ypodiktyo sto antistoixo interface gia to diktyo ayto. 8a ru8mize ta diktyaka toy interfaces ws :


Interface       IP Address            Netmask
eth0            192.168.1.1           255.255.255.192
eth1            192.168.1.65    255.255.255.192
eth2            192.168.1.129   255.255.255.128

H dromologhsh poy 8a egka8idrye 8a htan:


Destination       Gateway           Genmask           Interface
192.168.1.0     0.0.0.0         255.255.255.192 eth0
192.168.1.64    0.0.0.0         255.255.255.192 eth1
192.168.1.128   0.0.0.0         255.255.255.128 eth2

Se ka8'ena apo ta ypodiktya, oi hosts 8a ry8mizontan me to proswpiko toys IP ari8mo kai maska diktuoy (katallhlh gia to sygkekrimeno diktyo). Ka8e host 8a dhlwne to Linux PC ws th dikia toy pulh/dromologhth (gateway/router), 8etontas thn IP dieu8hnsh toy interface toy Linux gi'ayto to sygkekrimeno diktyo.

Gia sxolia, parathrhseis, dior8wseis, enhmerwseis peri ths Ellhnikhs metafrashs aytou toy HOWTO, steilte email sthn Boula Sanida : voulariba@hellug.gr h ston Eyripidh Papakwsta : evris@hellug.gr kai enallaktika : ep@rocketmail.com

Robert Hart Melbournh, Aystralia Martios 1997.


Next Previous Contents