P. 1
Configurare router software linux

Configurare router software linux

|Views: 241|Likes:
Published by Vesna Bizau

More info:

Published by: Vesna Bizau on Jan 24, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

10/09/2014

pdf

text

original

UNIVERSITATEA „AUREL VLAICU” ARAD

FACULTATEA DE INGINERIE

PROIECT
REŢELE DE CALCULATOARE
IMPLEMENTARE ROUTER SOFTWARE PE SISTEM DE OPERARE LINUX

AUTOMATIZĂRI ŞI INFORMATICĂ APLICATĂ AN III STUDENT: DANITY SRGIAN PROF. COORD. PETCU MARIUS

0.2 10.2.1. Masca 255.255.168.255.1.1.0. Topoligie Reţea 10.255. Cerinţa Se doreşte implementarea unui router pentru a face legătura a două reţele cu Internet-ul.2.3 10.2 10.1 FIREWALL (LIPSEŞTE) GATEWAY ISP 192.0.2.2.1.222 ETH0:1=10. router-ul ce urmează a fi configurat şi gateway-ul ISP-ului.0.3 2x 2x SWITCH 8 PORTURI 1x ROUTER ETH0=192.1.I.0.0.0 10.1.0 Reţea 10.255.1 ETH0:2=10.0. Masca 255. III.168. II. Resurse disponibile Se dispune de: 1) Computer dotat cu o singură placă de reţea 2) Sistem de operare linux cu acces la contul de ‘root’ 3) Două reţele de tip LAN cu 2 calculatoare in fiecare reţea 4) Switch cu 8 porturi 5) Legăturile fizice prin intermediul switch-ului între cele 2 reţele.0.2 .0.0.

1. Implementarea soluţiei de routing a pachetelor A) Prezentarea situaţiei de la începutul procedurii a.255.nf_conntrack_ipv4 nf_defrag_ipv4 867 1 nf_conntrack_ipv4 iptable_filter 2026 0 ip_tables 8674 2 iptable_nat.00s 0.iptable_nat.222 Bcast:192.255 Mask:255.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 192.2. Configurarea interfeţelor de reţea virtuale root@poweredge:~# ifconfig eth0:1 10.33.0.15s 0. load average: 0.ip_tables ipv6 229909 36 B)Configurarea router-ului software a.255.1. Utilzatorul root@poweredge:/# whoami root b.01s w c.168.168.6.1.00.4-smp. Modulele încărcate root@poweredge:~# lsmod | grep ip ipt_MASQUERADE 1274 1 iptable_nat 4171 1 nf_nat 12555 2 ipt_MASQUERADE.iptable_nat.0.iptable_filter x_tables 10626 3 ipt_MASQUERADE. Accesul la consolă root@poweredge:/# w 18:44:09 up 21 min.IV. 0.168.1 netmask 255. Kernel-ul sistemului de operare (Slackware Linux 13.0 b.0 root@poweredge:~# ifconfig eth0:2 10.00.255. d. 1 user.1 netmask 255.1.255.255.nf_nat.255. Rezultatele configurării interfeţelor de reţea virtuale root@poweredge:/# ifconfig eth0 Link encap:Ethernet HWaddr 00:0b:db:92:02:22 inet addr:192.167 18:24 0. 0.nf_nat nf_conntrack 42669 4 ipt_MASQUERADE.iptable_nat nf_conntrack_ipv4 9349 3 iptable_nat.1) root@poweredge:/# cat /etc/motd Linux 2.0 inet6 addr: fe80::20b:dbff:fe92:222/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 .

255.255.0.1 PING 10.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:8 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:480 (480.0. Trimiterea de semnal ICMP (ping) către interfeţele virtuale root@poweredge:/# ping -c 2 10.0.0.0 0.006 ms e.1.1: icmp_req=2 ttl=64 time=0.1: icmp_req=1 ttl=64 time=0.255.1.0.1.0.0.1. 0% packet loss.0.0.0.255.2.1) 56(84) bytes of data.255.032 ms 64 bytes from 10.0.1) 56(84) bytes of data.2 KiB) eth0:1 Link encap:Ethernet HWaddr 00:0b:db:92:02:22 inet addr:10.0.0 0.1.0.0.0.0.2.0.1.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 eth0:2 Link encap:Ethernet HWaddr 00:0b:db:92:02:22 inet addr:10. 2 received.0 192.0 0.1.0 255.0.0 0.255.1 ping statistics --2 packets transmitted.255. 64 bytes from 10.0.0.034 ms --.0.1.0 192.0.0.2.0.037 ms 64 bytes from 10.0 255.0.005 ms root@poweredge:/# ping -c 2 10.1: icmp_req=1 ttl=64 time=0.0.168.033 ms --.0.0.037/0.0 127. time 999ms rtt min/avg/max/mdev = 0.2.0. Interogarea stării interfeţelor root@poweredge:/# mii-tool eth0:1 eth0:1: negotiated 100baseTx-FD flow-control.032/0.1 Mask:255.255 Mask:255.1: icmp_req=2 ttl=64 time=0.033/0.034/0.0.0. link ok d.0.255. Interogarea tebelului de rute root@poweredge:/# route -n Kernel IP routing table Destination Gateway 10. 0% packet loss.032/0.1 (10.0.255.1 ping statistics --2 packets transmitted.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 lo Link encap:Local Loopback inet addr:127. 64 bytes from 10. 2 received. link ok root@poweredge:/# mii-tool eth0:2 eth0:2: negotiated 100baseTx-FD flow-control.035/0.0 255.0.2.0.0 B) TX bytes:480 (480.0.10.0 10.3 KiB) TX bytes:525580 (513.1 PING 10.1 (10. time 1000ms rtt min/avg/max/mdev = 0.0.255.0.1.1 Bcast:10.10.0.2 Bcast:10.2.2.0 Metric U U U 0 UG Ref 0 0 0 0 1 Use 0 0 0 0 0 Iface 0 0 0 lo 0 eth0 eth0 eth0 eth0 .0 U 0.0.168.255 Mask:255.RX packets:1914 errors:0 dropped:0 overruns:0 frame:0 TX packets:1611 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:168255 (164.0 B) c.2 Genmask Flags 255.0 0.

0.1 with 32 bytes of data: Reply from 10.1. .1.0 Default Gateway . Received = 2. .10.1 f. . .1 Parametrii interfeţei de reţea PC2 C:\Documents and Settings\Programare2>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix .2 Subnet Mask .f.0. . . . .24. . .2 Semnal ICMP către propria interfaţă PC2 C:\Documents and Settings\Programare2>ping -n 2 10.0.1: Packets: Sent = 2. .01s 0. load average: 0. . . . 0.1.0 f.1. Average = 0ms f. 0.1. .0.2: bytes=32 time<1ms TTL=128 Ping statistics for 10.0. 1 user.0.1: bytes=32 time<1ms TTL=64 Reply from 10. .2 with 32 bytes of data: Reply from 10. . : 10.1.2 Pinging 10. Comenzi de control din reţeaua 10.0.00s w h. . .1. : IP Address. .0.2: Packets: Sent = 2. Maximum = 0ms. .0.255.0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 10.1.255.1. : 255. .1: bytes=32 time<1ms TTL=64 Ping statistics for 10. Maximum = 0ms.3 Semnal ICMP din reţeaua 10. .0. Lost = 0 (0% loss). . : 10. Revenire la consola router-ului pentru continuarea configurării root@poweredge:~# w 16:40:04 up 22:17.0. .1.1 Pinging 10.0. Received = 2. Average = 0ms g. Lost = 0 (0% loss).1.0 către router C:\Documents and Settings\Programare2>ping -n 2 10. Interogarea stării rutelor .2: bytes=32 time<1ms TTL=128 Reply from 10. .1.0.1. .00s 0. . Approximate round trip times in milli-seconds: Minimum = 0ms.1. .2 16:39 0.1. Approximate round trip times in milli-seconds: Minimum = 0ms.0.

1 l.1.0/24 dev eth0 proto kernel scope link src 192.2.104: Packets: Sent = 2. . Approximate round trip times in milli-seconds: Minimum = 98ms.com Pinging google.168. .0/24 dev eth0 proto kernel scope link src 10. . : IP Address.87. .ipv4.root@poweredge:~# ip route 10. .0/24 dev eth0 proto kernel scope link src 10. Activarea neconditionată a mascheradei pachetelor dintre reţelele interne şi gateway-ul ISP-ului root@poweredge:~# iptables –t nat –A POSTROUTING –o eth0 –j MASQUERADE k.0. . .1.125. .1.2.87.255.125. : 255. .0. Revenire la consola PC2 din reţeaua 10. .2 Subnet Mask . .0. . Received = 2.0 Default Gateway . : 10. starea interfeţei C:\Documents and Settings\Programare2>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix .1. Accesarea consolei PC2 din reţeaua 10.1 10. Average = 98ms m.0. . .0. . Semnal ICMP către o gazdă la distanţă C:\Documents and Settings\Programare2>ping -n 2 google. .222 127.168. Maximum = 98ms. .com [74.0.87. . . .125.104: bytes=32 time=98ms TTL=52 Reply from 74.87.0. .1. Lost = 0 (0% loss).0. .2. .104: bytes=32 time=98ms TTL=52 Ping statistics for 74.0.104] with 32 bytes of data: Reply from 74.1 192.ip_forward = 1 j.1. . : 10. . .0.2 dev eth0 metric 1 i. .0.1. : .0/8 dev lo scope link default via 192. .1.125.168.ip_forward net.255. . starea interfeţei C:\Documents and Settings\Programare2>ipconfig Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . Interogarea permisiunii de rutare a pachetelor root@poweredge:~# sysctl net.ipv4.0.

14. .1e100.1 n.87. S-a stabilit tabelul de rute conform topologiei alese şi a gateway-ului furnizat de provider-ul serviciilor de Internet.14.255.37 81 ms 10. .99: Packets: Sent = 2.87. Maximum = 99ms. .216. . V.romtelecom. : 10. .com [74. .43 98 ms 72.0.168.0. Semnal ICMP către o gazdă la distanţă C:\Documents and Settings\Programare2>ping -n 2 google.85. .200.225.2. Average = 99ms o.1 <1 ms 192.125. .254] 39 ms 10.200.0.255. . : 10.0. .125.125.245. .IP Address. .2.85.125.125.com Pinging google.50.net [89.0.232. pornind de la dotările fizice date s-a reuşit crearea de două reţele care comunică cu Internet-ul prin serviciile unui router software bazat pe sistemul de operare Linux. .2 39 ms adsl89-122-216-254.87. .net [74. .0.87. . : 255.99] with 32 bytes of data: Reply from 74.125. .com [74. Received = 2. . . Lost = 0 (0% loss). Calculatorul folosit pentru a servi ca şi router având o singură interfaţă de reţea conectată la cele 2 reţele private şi la Internet prin intermediul unui switch.81 84 ms 209. .87. Approximate round trip times in milli-seconds: Minimum = 99ms.22 83 ms 74.205 84 ms 10.255. .0 Default Gateway .248.236.99] over a maximum of 30 hops: 1 2 3 4 5 6 7 8 9 10 11 12 13 <1 ms <1 ms 49 ms 39 ms 81 ms 90 ms 94 ms 84 ms 84 ms 105 ms 99 ms 107 ms 103 ms <1 ms <1 ms 39 ms 39 ms 82 ms 84 ms 82 ms 84 ms 84 ms 98 ms 99 ms 101 ms 120 ms <1 ms 10. . . .250 99 ms 209.217 112 ms hb-in-f99.87.1.125. .45 82 ms 10.2. Concluzii În urma comenzilor arătate am arătat că. .178 97 ms 72.0.99: bytes=32 time=99ms TTL=51 Ping statistics for 74. . s-a ales folosirea a două interfeţe virtuale (eth0:1 respectiv eth0:2).122.2 Subnet Mask . . Interogarea rutei până la gazda aflată la distanţă C:\Documents and Settings\Programare2>tracert google. .99] Trace complete.99: bytes=32 time=99ms TTL=51 Reply from 74. .com Tracing route to google.

1 respectiv 10. S-a interogat ruta completă de la o staţie din reţelele interne către gazda aflată la distanţă. verificându-se un total de 13 noduri cu timp total întârziere de 120ms. cu menţiunea că serviciile furnizorului sunt accesate printr-un modem ADSL.Ulterior am configurat staţiile celor două reţele să folosească ca şi gateway adresele 10.0.2.0.1 aparţinând router-ului după care am verificat conexiunea dintre reţele şi router folosind semnale ICMP. Având confirmarea configurării corecte până la această etapă. s-a făcut activarea mascheradei pachetelor. S-a testat configuraţia router-ului folosind semnale ICMP din reţelele interne către o gazdă Internet aflată la distanţă. .1.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->