Documente Academic
Documente Profesional
Documente Cultură
Cheatsheet
Comand Descrierescurt
d h c l i e n t cofiguraredinamictemporar i f c o n f i g afiareaconfigurrilor/configurareauneiinerfeedereea r o u t e i p i f u p i f d o w n
afiarea/configurareatabeleiderutare afiareaconfigurrilor/configurareauneiinerfeedereea,rutelor,etc trecereauneiinterfeenstareaUP trecereauneiinterfeenstareaDOWN
Suportlaborator
8.Configurridereea[http://books.google.com/books?
id=_JFGzyRxQGcC&lpg=PA532&dq=introducere%20in%20sisteme%20de%20operare&pg=PA217#v=onepage&q&f=false]
PuteiurmritutorialulvideocorespunztorlaboratoruluifcutdeITAssistant[http://itassistant.org/diverse/utilizarea
sistemelordeoperare/utilizareasistemelordeoperare5.html].
Mainivirtuale
Laboratorulfolosetedoumainivirtuale,sheldon[http://elf.cs.pub.ro/uso/store/usovmsheldon.tar.gz]ileonard [http://elf.cs.pub.ro/uso/store/usovmleonard.tar.gz].AmbeleauinstalatDebianGNU/Linux5.0[http://www.debian.org].Aceast distribuienuvinecus u d o instalat. Pentruaccesder o o t ,folosiiutilizatorulr o o t iparolau s o . Fiecaremainmaiareiunutilzatornormal,numits h e l d o n ,respectivl e o n a r d ,ambelecuparolau s o .
Introducere
Noiunigenerale
IP=InternetProtocol Sefolosetereferitorlaversiunea4,ncareadresaIPare32bii.Acetianmodobinuitsuntscriinformatul:
X . X . X . X
undeXesteunnumrreprezentatpe8bii,cuvalorinintervalul[0,255]. Deexemplu,adresa:
1 1 0 0 0 0 0 01 0 1 0 1 0 0 00 0 0 0 0 0 1 00 1 1 0 0 1 0 1
sescrieca
1 9 2 . 1 6 8 . 2 . 1 0 1
echivalentcu:
2 5 5 . 2 5 5 . 2 5 5 . 0
echivalentcu:
1 9 2 . 1 6 8 . 2 . 0
Configurridereea
Configurrileuneiadresepotficatalogatedupmaimultecriterii. nfunciedefelulncareseobineadresaIP,potfi: statice dinamice nfunciedepersistenapecareoauncadrulsistemului: temporare permanente Configurriletemporareserealizeazdinliniedecomandutiliznddiverseutilitare. naceastseciunegsiicomenzileutilizateictevaexemple,pentrumaimultedetaliiconsultaipaginiledemanualsau suportuldelaborator. Pentruconfigurriletemporaredinamicedereeafolosimd h c l i e n t urmatdenumeleinterfeei.
r o o t @ u s o : ~ #d h c l i e n te t h 0
Unexempludeconfigurarefolosinti p :
r o o t @ u s o : ~ #i pa d d r e s sa d d1 0 . 2 . 1 0 . 2 / 2 4d e ve t h 0
Unexemplupentruconfigurareapermanentstaticeste:
#T h el o o p b a c kn e t w o r ki n t e r f a c e a u t ol o i f a c el oi n e tl o o p b a c k #T h ep r i m a r yn e t w o r ki n t e r f a c e a u t oe t h 0 i f a c ee t h 0i n e ts t a t i c a d d r e s s1 0 . 1 5 . 1 . 2 0 n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0 g a t e w a y1 0 . 1 5 . 1 . 1
FiierulutilizatpentruaconfiguraservereledeDNSeste/ e t c / r e s o l v . c o n f .Aceastaconineintrridetipul
n a m e s e r v e ra d r e s a _ i p
Deexemplu:
n a m e s e r v e r8 . 8 . 8 . 8
Interfacestate
Pentruaasiguraconectivitatea,ointerfatrebuiesfienstareaU P .Pentruaoaducenaceaststarefolosimi f u p .
r o o t @ u s o : ~ #i f u pe t h 0
PentruaaduceointerfanstareaD O W N folosimi f d o w n
r o o t @ u s o : ~ #i f d o w ne t h 0
Exerciii
DeschideimainavirtualcuVmwarePlayer!
1.Configurridinamicetemporaredereea
Configuraidinamic,temporar,interfaadereeae t h 1 amainiifizice: Rezolvare
d h c l i e n te t h 1
2.Descoperireaconfigurrilordereea
Inspectaiconfigurriledereeacurentedepemainafizic.Afiaiinformaiile: denivel2legaturdedate(adresaMAC) denivel3reea(adresaIP,mascadereeaigatewayulimplicit) denivel7aplicaii(serverDNS). pentruaschimbaconfigurriledereea,trebuiesfimr o o t .Pentrualeinspecta,ngeneral,nuestenevoie. Folosiii f c o n f i g pentruaaflaadresaMAC,adresaIP,imascadereea.Ceinterfaestecearelevant? AdresaMACsemainumeteiadresfizicsauadreshardware.
i f c o n f i g
Folosiir o u t e pentruaaflagatewayulimplicit.
r o u t en
3.Configurristaticetemporaredereea
Acestexerciiusedesfoarpemainavirtuals h e l d o n . Configurareareeleiesteooperaiunecriticsistemului,deciarenevoiedeprivilegiider o o t
gatewayulimplicitvafi192.168.21.2 Rezolvare
r o u t ea d dd e f a u l tg w1 9 2 . 1 6 8 . 2 1 . 2
serverulDNSvafi8.8.8.8.Suprascrieioriceserverexistent. Rezolvare
e c h on a m e s e r v e r8 . 8 . 8 . 8>/ e t c / r e s o l v . c o n f
Testaiconectivitateacugoogle.com,trimind5mesajeICMPsuccesive: Rezolvare
p i n gc5w w w . g o o g l e . c o m
Reporniimainavirtual.Saupstratconfigurrile?
4.Descoperireaconfigurrilordereeafolosindiproute2
ifconfig,routeiarpsuntcomenziclasicedeconfigurareareelei,darfacpartedintrunpachetcenumaiestemeninutn prezent.i p r o u t e 2 estepachetulmoderncevinesnlocuiascutilitareleclasice Folosiicomandai p pentruadescopericonfiguraiilemainiifizice. ListaiinterfeeleiIPurilorlorfolosindip. Rezolvare
i pa d d r e s ss h o w
Afiaitabeladerutarefolosindip. Rezolvare
i pr o u t es h o w
Faceiacelailucrufolosindvarianteleprescurtatealeacestorcomenzi. Rezolvare
i pas i prs
5.Configurripersistentedereea
6.Configurridinamicepermanente
Acestexerciiusedesfoarpemainavirtuals h e l d o n . Inspectaiconfiguraiadepemainas h e l d o n .Esteinterfaae t h 0 activ? Configuraiinterfaae t h 0 astfelncteasfieactivlabootareisfieconfiguratprinDHCP. Cefiierconineconfigurareainterfeelordereea? Reporniimainas h e l d o n .Testaiconectivitatea. Rezolvare
$c a t/ e t c / n e t w o r k / i n t e r f a c e s [ . . . ] a u t oe t h 0#a c t i v e a z i n t e r f a al ab o o t a r e i f a c ee t h 0i n e td h c p [ . . . ]
Pentruanurepornicalculatoruldefiecaredatcndmodificaifiierul,puteifolosicomanda:`/etc/init.d/networking restart`
7.Configurristaticepermanente
Acestexerciiusedesfoarpemainavirtuall e o n a r d . Inspectaiconfiguraiainterfeeie t h 0 .Esteinterfaaactiv? Configuraipermanentinterfaae t h 0 : adresa192.168.21.80 netmask255.255.255.0 gateway192.168.21.2 Folosii8.8.8.8canameserver.Atenie:nufolosiiacelaifiierncareaiconfiguratadresaIPi gatewayul. Porniiinterfaae t h 0 folosindi f u p .Cucediferi f u p dei f c o n f i g ? Testaiconectivitatea. Rezolvare
$c a t/ e t c / n e t w o r k / i n t e r f a c e s [ . . . ] a u t oe t h 0 i f a c ee t h 0i n e ts t a t i c a d d r e s s1 9 2 . 1 6 8 . 1 0 2 . 8 0 n e t m a s k2 5 5 . 2 5 5 . 2 5 5 . 0 g a t e w a y1 9 2 . 1 6 8 . 1 0 2 . 2 [ . . . ] $c a t/ e t c / r e s o l v . c o n f n a m e s e r v e r8 . 8 . 8 . 8 $i f u pe t h 0#i f u pf o l o s e t ei n f o r m a i i l ed i n/ e t c / n e t w o r k / i n t e r f a c e s
8.VizualizareatabeleiARP
ListaipemainafizictabelaARP(neighbourtable)folosinddoucomenzidiferite(ocomandclasiciocomanddin cadruiproute2). Rezolvare
a r p a r pa i pn e i g h b o u rs h o w i pns
9.Configurareastaticaunuinume
Acestexerciiusedesfoarpemainafizic. Aflaiadresaserveruluihttp://wikipedia.org/[http://wikipedia.org/].Celmaisimplumodesteafolosip i n g . Adugaiointrarenfiierul/ e t c / h o s t s astfelnctserverulWikipediaspoatfiaccesatcunumele
w i k i .
Testaiconectivitateafolosindp i n g . Rezolvare
$h o s tw i k i p e d i a . o r g#a l t e r n a t i v ,s ep u t e af o l o s ip i n g w i k i p e d i a . o r gh a sa d d r e s s2 0 8 . 8 0 . 1 5 2 . 2 $e c h o" 2 0 8 . 8 0 . 1 5 2 . 2w i k i "> >/ e t c / h o s t s $p i n gw i k i
NiciontrebaredeexamensautestpracticnuvaconinenoiunidespreIPv6.
10.Folosireaiproute2.ConfigurareadeadreseIPv6
Folosiiiproute2(comandacorespunztoaresenumetei p )pentruaconfiguraurmtoareleadrese: 2000::1/64peinterfaavmnet8amainiifizice 2000::2/64peinterfaaeth0amainiivirtualesheldon InspectairuteledintabeladerutareIPv6depefiecaremain(folosiitoti p )itestaiconectivitateafolosindcomanda p i n g 6 . PentruconfigurareaadreselorIPv6nLinux,poatefifolositattsuitaiproute2ctii f c o n f i g .Hint:configureipv6
[http://www.tldp.org/HOWTO/Linux+IPv6HOWTO/chapterconfigurationaddress.html]
Rezolvare Pemainafizic:
r o o t @ u s o : ~ #i p6a d d r e s sa d d2 0 0 0 : : 1 / 6 4d e vv m n e t 8
Pemainavirtuals h e l d o n :
s h e l d o n : ~ #i p6a d d r e s sa d d2 0 0 0 : : 2 / 6 4d e ve t h 0 s h e l d o n : ~ #p i n g 62 0 0 0 : : 1
11.NameserverSwitch
Adaugatiin/ e t c / h o s t s urmatoareaintrare1 2 7 . 0 . 0 . 1g o o g l e . c o m .Inacestmomentcomandap i n g g o o g l e . c o m vadapingla1 2 7 . 0 . 0 . 1 .Frarealizaaltemodificrin/ e t c / h o s t s ,configuratisistemul astfelincatp i n gg o o g l e . c o m savaraspundacuadresaIPrealaagoogle.com. Cautatiinformatiidesprensswitch Rezolvare
s t u d e n t @ u s o : ~ #c a t/ e t c / h o s t s 1 2 7 . 0 . 0 . 1 g o o g l e . c o m . . . s u d e n t @ u s o : ~ #p i n gc1g o o g l e . c o m P I N Gg o o g l e . c o m( 1 2 7 . 0 . 0 . 1 )5 6 ( 8 4 )b y t e so fd a t a . 6 4b y t e sf r o ml o c a l h o s t . l o c a l d o m a i n( 1 2 7 . 0 . 0 . 1 ) :i c m p _ r e q = 1t t l = 6 4t i m e = 0 . 0 3 6m s
12.ConfigurareaunuitunelIPv6pesteIPv4
ConfiguraiuntunelIPv6pesteIPv4ntremainaSheldoniLeonard.MainaLeonardaredoaroadresIPv4peinterfaa eth0(nuadugaioadresIPv6). Tunetulsevacreantreinterfeeleeth0cuadreseleIPv4depefiecaredintreceledoumaini.Capetelecelordoutunele voraveaadresele2001::1/64,respectiv2001::2/64. http://tldp.org/HOWTO/Linux+IPv6HOWTO/confipv6inipv4pointtopointtunnels.html[http://tldp.org/HOWTO/Linux+IPv6
HOWTO/confipv6inipv4pointtopointtunnels.html]
Rezolvare Pemainavirtuals h e l d o n :
s h e l d o n : ~ #i pt u n n e la d ds i t 1m o d es i tt t l6 4r e m o t e1 9 2 . 1 6 8 . 9 9 . 1 3 5l o c a l1 9 2 . 1 6 8 . 9 9 . 1 3 4 s h e l d o n : ~ #i pl i n ks e td e vs i t 1u p s h e l d o n : ~ #i pa d d r e s sa d d2 0 0 1 : : 1 / 6 4d e vs i t 1 s h e l d o n : ~ #i p6r o u t ea d d2 0 0 1 : : / 6 4d e vs i t 1m e t r i c1
Pemainavirtualleonard:
l e o n a r d : ~ #i pt u n n e la d ds i t 1m o d es i tt t l6 4r e m o t e1 9 2 . 1 6 8 . 9 9 . 1 3 4l o c a l1 9 2 . 1 6 8 . 9 9 . 1 3 5 l e o n a r d : ~ #i pl i n ks e td e vs i t 1u p l e o n a r d : ~ #i pa d d r e s sa d d2 0 0 1 : : 2 / 6 4d e vs i t 1 l e o n a r d : ~ #i p6r o u t ea d d2 0 0 1 : : / 6 4d e vs i t 1m e t r i c1 l e o n a r d : ~ #p i n g 62 0 0 1 : : 1
uso/laboratoare/laborator08.txtLastmodified:2013/01/1421:11bysorina.sandu