Sie sind auf Seite 1von 48

Computer Science School

COMPUTER SCIENCE
(OPTION NETWORKING)

D.E.C / A.E.C PROGRAMS LINUX NETWORK SERVICES

Project

Winter 2 !" Linux (Networking) Page 1

PART I
O#$ECTIVES % I& Con'i()re LINUX in * TCP/IP Net+or, II& I-./e-ent * D0CP Ser1er III& In2t*// *n3 con'i()re * SAM#A Ser1er IV& I-./e-ent * N4S Ser1er V& I-./e-ent Internet conne5ion 26*rin(

Linux (Networking)

Page 2

NETWORK SERVIECES IN LINUX


PRO$ECT

N*-e% O#$ECTIVES % I& Con'i()re LINUX in * TCP/IP Net+or, II& I-./e-ent * D0CP Ser1er III& In2t*// *n3 con'i()re * SAM#A Ser1er IV& I-./e-ent * N4S Ser1er V& I-./e-ent Internet conne5ion 26*rin( PRERE7UISITES 1. Have installed Linux Fedora 2. Know the basics commands of Linux 3. Know the basic concepts of T !"I! networ#in$

Gro). %

%. Know the role of the followin$ services& '()*("+H !",F'

IMPLEMENTATION O4 T0E PRO$ECT % -.L/-.0T compan1 inc. has a networ# of 122 LI,34 wor#stations5 a 6indows server and two Linux servers 71 of them has 2 ,I s8. 122 computers with networ# interface cards 1 outlet for each ! Page 3

Linux (Networking)

2 shared networ# printers 2 networ# printers 9 2%:port 'witch 3T! cat; 9 patch panel 2% ports 2 Linux servers /peratin$ s1stems 6indows and LI,34

The compan1 has hired 1ou to install and confi$ure the followin$ services& '()*( " +H ! " ,F'. <ou have two Linux des#tops and a 6indows des#top
Net+or, !92.!:;.! . /2< LINUX8! WINDOWS LINUX82

!92.!:;.!! . /2< !92.!:;.!2 . /2< !92.!:;.!" . /2< !92.!:;.!< . /2< !92.!:;.!= . /2< !92.!:;.!: . /2< !92.!:;.!> . /2< !92.!:;.!; . /2< !92.!:;.!9 . /2< !92.!:;.2 . /2<

!92.!:;.2! . /2< !92.!:;.22 . /2<

Linux (Networking)

Page 4

I& CON4IGURE LINUX IN A TCP/IP NETWORK


O#$ECTIVES % 18 onfi$ure the networ# interface for T !"I! protocol

38 )odif1 the .TH.0,.T ,I s confi$uration files 28 3se T !"I! commands CONTEXT <ou have to confi$ure two wor#station in a networ#. /ne is a Linux Fedora and the other is a 6indows 4!. .ach compter needs its own hostname and I! address. STEPS% A& Co--*n3 -o3e STEPS
1) Network configuration files

RESULTS /etc/hosts The main purpose of this file is to resolve hostnames. /etc/resolv.conf This file specifies the IP addresses of the DNS servers and domain search. /etc/sysconfig/network file is used to specify

information about the desired networ confi!uration on your ser"er.


/etc/sysconfig/network-scripts/ifcfg<interface-name> For each network interface, there is a corresponding script for interface configuration. 28 Interfaces confi$uration files Linux (Networking) ifcfg-eth<X> #o$ <X> corresponds to a uni%ue number Page 5

assi!ned to a specific interface&

DEVICE=eth0 BOOTPROTO=none or dhcp or bootp


ONBOOT=yes NETWORK= !.!. .! NET"#$K=%&&.%&&.%&&.! '(#))R= !.!. .%* +$ER,T-=no

38 0estart the networ# service


. service network rest/rt /etc/init.0/network rest/rt

%8 -erif1 the I! address


/sbin/ifconfig 1/

;8 Test communication
ping

;8 .nable "+isable the networ# interface 98 (dd routes or displa1 the routin$ table =8 'how the path ta#en b1 a transmitted pac#et >8 -iew details about active connections on 1our machine& ports5 statistics ...

if2p eth! or if0own eth!

/sbin/ro2te /00 -net

tr/cero2te

netst/t

#& (r*.6ic*/ -o3e

Linux (Networking)

Page 6

18 'tart the networ# interface confi$uration

28 )odif1 the characteristics of the networ# interface card to confi$ure manual " +H !" *//T!

38 onfi$ure +,' information

%8 <ou can add a new device

Wor, to 3o onsiderin$ the networ# that 1ou have been assi$ned& 6hat is 1our I! address ? Linux (Networking) Page 7

18 onfi$ure 1our ,I with a static I! address & omputer name I! (ddress ,etwor# mas# +efault $atewa1 +,'

28 +ispla1 1our I! address with & i'con'i( 38 Test usin$ .in( the communication with other computers -erification @@@@@@@@@@@

II& IMPLEMENTING A D0CP SEVER ?D@n*-ic 0o2t Con'i()r*tion Protoco/&


O#$ECTIVES % 18 Install +H ! 'erver 28 onfi$ure +H ! 'erver options

38 'tart the +H ! 'erver %8 Teste the +H ! 'erver with 6indows and Linux clients Conte5t <ou want to allow networ# computers to obtain an I! address automaticall1 b1 confi$urin$ the +H ! service in Fedora.

Linux (Networking)

Page 8

STEPS % *& 4i/e2 to con2i3er 4ILES ROLE +H ! 'erver confi$uration file

/etc/dhcp/dhcpd.conf

/var/lib/dhcpd/dhcpd.leases +H ! client lease database


A& E5*-./e2
STEPS RBSULTS rp3 -4 0hcp or y23 inst/ll 0hcp

18 Installation

28

onfi$uration example

/etc/dhcp/dhcpd.conf
#ddns-update-style ad-hoc ; # ncessaire pour dhcp Fedora 8+ s2bnet 5%. 67.%%.! net3/sk %&&.%&&.%&&.! 8 option ro2ters 5%. 67.%%. 9 . p/sserelle p/r 0:f/2t option s2bnet-3/sk %&&.%&&.%&&.!9 . 3/s42e 0e so2s-r:se/2 option 0o3/in-n/3e ;ho3e.l/n;9 . no3 0e 0o3/ine option 0o3/in-n/3e-servers 5%. 67.%%. < 5%. 67.%%.%9 . serve2rs )N$ pri3/ire et secon0/ire r/nge 5%. 67.%%.%! 5%. 67.%%. !!9 . pl/ge 0=/0resse 0ef/2lt-le/se-ti3e % 6!!9 . 02r:e 02 b/il en secon0es 3/>-le/se-ti3e ?@%!! 9 . 02r:e 3/>i 02 b/il en sec. .$i on ve2t f/ire 0es r:serv/tions A/ttrib2er to2t le te3ps .l/ 3B3e '( . / 2n cert/in :42ipe3entC on les ins:rer/ ici. D host no33/chine 8 h/r0w/re ethernet %E@?E&6E*7E#BE,)9 . /0resse "#, 0e l/ .3/chine fi>e0-/00ress 5%. 67.%%. !!9 .'( 42e l=on ve2t l2i /ssigner D . $i on 0ispose 0e be/2co2p 0e st/tions gro2p pclin2> 8 2se-host-0ecl-n/3es on9

Linux (Networking)

Page 9

host no33/chine% 8 h/r0w/re ethernet !7E!!E%bE?cE%5E@%9 fi>e0-/00ress no33/chine%.no30o3/ine.tl09 D D

38

reate the client lease database file if it doesnAt exist %8 'pecif1 the networ# interface from which the +H ! will listen to +H ! clients ;8 'tart or 'top

+H ! client lease database & /var/lib/dhcpd/dhcpd.leases .dit & /etc/2@2con'i(/36c.3 (nd add D0CPARGSCet6

# /etc/init.d/dhcpd start or stop or # service dhcpd start or stop

98 .nable +H ! at startup =8 .rror messa$es5 editB >8 +H ! lient

chkconfig dhcpd on

/var/log/messages service dhcpcd start Linux lient & ipconfi$ "release ipconfi$ "renew

6indows lient

WORK TO DO %
18 6or# on the +H ! 'erver 28 onfi$ure a +H ! scope usin$ he followin$ options for the subnet 1C2.19>.x.2"2;;.2;;.2;;.2 &

+efault $atewa1 address +,' (ddress and domain name& Linux (Networking)

1C2.19>.x.2;% 1C2.19>.x.2;% and automne.com Page 10

0an$e and lease duration&

1C2.19>.x.122 1C2.19>.x.1;2 and 1 da1

38 6or# on the +H ! client a8 3se a 6indows client to obtain an I! address b8 3se a Linux client to obtain an I! address I! (ddress I! 'ubnet mas# +efault $atewa1 +,' verification @@@@@@@@@@@

III& IMPLEMNETING A SAM#A SERVER


O#$ECTIVES % 18 Install a '()*( 'erver 28 38 onfi$ure the '()*( 'erver reate user accounts for the '()*( 'erver

%8 'tart '()*( 'erver et ,)* for ,et*I/' name resolution ;8 Test the '()*( 'erver Conte5t <ou want 6indows and Fedora des#tops to share files and printers on the networ#. <ou must set up '()*( service. !& Note2% 'top or diable F.+/0( SE/in)5 7Security-Enhanced Linux) 3se the followin$ command& 8 /)2r/2Ain/2eten'orce to put it in permissive mode. <ou can also modif1 the confi$uration file D1i /etc/2e/in)5/con'i( and replace SELINUXCen'orcin( with SELINUXC3i2*A/e3 to disable it. Page 11

Linux (Networking)

2& "& <& =& :&

+isable the F.+/0(. firewall 8 2er1ice i.t*A/e2 2to. reate the folder to be shared in the "home director1 with the =;; permissions reate on 6indows the folder to be shared with the ri$ht share and ,TF' permissions .nable T !"I! over ,et*I/' on 6I,+/6' and confi$ure the 6I,' server to point to Fedora 7wins supportE1es8. onfi$ure 'amba in the command or the $raphical mode 7see examples bellow. onfi$ure 2-A.con' to displa1 the ,etbios name of F.+/0( and to ma#e Fedora actin$ as a 6I,' 'erver& netAio2 n*-e C VotreNo-4e3or* +in2 2)..ort C @e2

>& ;& 9& ! &

'tart ')* service for '()*( and ,)* service for name resolution D 2er1ice 2-A 2t*rt D 2er1ice n-A 2t*rt .nable automatic startup for ')* and ,)* services D c6,con'i( 2-A on D c6,con'i( n-A on Test the '()*( connexion from a 6indows computer If the connexion fails5 review the previous steps.

EXAMPLE o' SAM#A con'i()r*tion Install '()*( reate the folder to be shared in the "home direcrot1 .dit the "etc"samba"smb.conf file

Linux (Networking)

Page 12

(dd and"or modif1 lines in the 2-A.con' file for share securit1 mode securit1 E share NOTES % !& To en*A/e t6e 4EDORA Net#IOS n*-e to Ae 1i2iA/e netbios name E ,/)deF.+/0( 2& To *cti1*te t6e 4EDORA 2er1er *2 * WINS 2er1er wins support E 1es "& To *cti1*te t6e 4EDORA 2er1er *2 * WINS c/ient wins server E I!@server@6I,' 'tart 2-A *n3 n-A services

.nable automatic startup for smb and nmb services

Ste.2% A& Co--*n3 -o3e % E5*-./e o' con'i()r*tion 18 'erver & Linux '()*( 18 Installation @)- in2t*// 2*-A* 2*-A*Dc/ient @)- in2t*// 2@2te-Dcon'i(D2*-A* 7for the $raphical interface8 28 confi$uration file example& /etc/samba/smb.conf
Fglob/lG workgro2p = groupe00 netbios n/3e = ServeurLinux sec2rity=2ser wins s2pport = yes host /llow = 5%. 67.!. %*. encrypt p/sswor0s = yes s3b p/ssw0 file = /etc/samba/smbpasswd

Linux (Networking)

Page 13

9 le co3pte invite /cc:0er/ s/ns 3ot 0e p/sse g2est /cco2nt = invite [cdrom # chemin d'accs au point de montage du CDROM p/th = /mnt/cdrom # accessible en lecture re/0p2blic = yes # l'!criture sera forc!ment interdite write/ble = no Fp2blicG co33ent =R:pertoire p2blic p/th = /ho3e/p2blic g2est ok = yes write/ble = yes . les fichiers cr::s sont en lect2re se2le< po2r les /2tres Al/ c/t:gorie oC cre/te 3o0e = !66? FprintersG co33ent = #ll (rinters p/th = /v/r/spool/s/3b/ printer /03in = Hohn< e0< I/03ins cre/te 3/sk = !6!! g2est ok = Jes print/ble = Jes 2se client 0river = Jes browse/ble = Jes

%8 'pecif1 the '()*(


userAs password in /etc/s3bp/ssw0

.s3bp/ssw0 1/ 2s/gers/3b/

38 'tart " 'top '()*(


and ,)*76I,'8

#service smb start or stop or rest/rt .service nmb start

5) Test the syntax of the /etc/smb.conf file using the testparm utility 98 +eclare the 4! host in the hosts files

testparm

.vi /etc/hosts . vi

/etc/sysconfig/network

28 Win3o+2 XP C/ient 'or Lin)5 Linux (Networking) Page 14

a8 onfi$ure 6indows 4! in a peer to peer b8 'hare a folder and $rant access with Fedora and choose the same permissions wor#$roup and an I! address from the same c8 From networ# nei$hborhood 1ou can see subnet and access the folder on Fedora

38 Lin)5 C/ient 'or Win3o+2 STEPS 18 reate a folder 3k0ir /3nt/0isk that will be used as mountin$ point to the share on 6indows 28 )ount or unmounts smbmount //!"#!/partage /mnt/disk the shared folder on s3b23o2nt ... b2t< in KE)OR#< +$E 6indows in the folder 3o2nt -t cifs // 5%. 67. . /sh/re /3nt/somedirector" created in 1 RESULTS

#& Con'i()re SAM#A +it6 * (r*.6ic*/ Inter'*ce% a8 reate the folder to share in the "home director1 c8 'tart the '()*( confi$uration $raphical Interface b8 set permissions to =;; e8 rete the '()*( share with the necessar1 permissions

Linux (Networking)

Page 15

d8 onfi$ure the 6or#$roup and the '()*( authentication mode

f8 (dd the '()*( authoriFed users 7the same as in 6indows 8

$8 0estart ')* and ,)*

Dservice smb restart Dservice nmb restart

Wor, to 3o %
18 Wor, on t6e SAM#A Ser1er onfi$ure '()*( 'erver usin$ the followin$ information & Wor,(ro). U2er G0/3!.22 )2*(er2*-A* for Linux and 6indows

Linux (Networking)

Page 16

.*22+or3 2ec)rit@ S6*re3 'o/3er

123%;9 3ser !arta$esamba on Linux and 6indows with full access

2& Wor, on Win3o+2 XP a8 reate a peer to peer networ# with 6indows 4! b8 an 1ou see the Fedora computer when 1ou browse the networ#? c8 an 1ou access the Fedora shared folder .*rt*(e2*-A*? d8 Install a printer and share it 6or#$roup & I! address " subnet mas#

38 6or# on the Linux client to connect to 6indows 4! shares 3.18 )ount the .*rt*(e2*-A* share available on 6indows ? 3.28 (ccess the shared printer on 6I,+/6'?

-erification @@@@@@@@@@@

IV&

INSTALL AND CON4IGURE N4S?Net+or, 4i/e S@2te-&

Linux (Networking)

Page 17

O#$ECTIVES % 18 Install ,F' service 28 onfi$ure ,F' 'erver

38 onfi$ure ,F' client %8 Test ,F'

Conte5t

<ou must enable remote hosts to mount file s1stems over a networ# and use them Hust li#e local file s1stems between Fedora computers. To do this5 install and confi$ure the ,F' service 7,etwor# File '1stem8.

STPES %

A& Co--*n3 -o3e %

Ste.2

RESULTS

S$%&$% S'($ 18 Install ,F'


. y23 inst/ll nfs-2tils . y23 inst/ll syste3-config-nfs Afor the gr/phic/l 3o0eC

28 onfi$ure the ,F' 'erver

/C E0it E /etc/e>ports bC #00 the following lineE

/p/th/to/sh/re ipLclientArwC< ipLclient%ArwC

Linux (Networking)

Page 18

38 0estart the ,F' 'erver

./etc/init.0/nfs st/rt or stop or relo/0 or rest/rt

"L'$)* S'($ %8 From the client side & a8 rete a folder for a mountin$ operation
. 3k0ir /3nt/p/rt/ge

b8 )ount usin$ the command prompt&


. 3o2nt -t nfs ipLserve2rE/p/th/to/sh/re /3nt/p/rt/ge

c8 (utomatic mount at startup&


18 edit & "etc"fstab 28 (dd&
ipLserve2rE/p/th/to/sh/re /3nt/p/rt/ge nfs /2to<2ser<rw ! !

;8 )ount all partitions in fstab

. 3o2nt 1/

#& Gr*.6ic*/ -o3e

18 Launch the ,F' confi$uration $raphical tool

28 (dd the folder to share with the basic permissions and specif1 the host7s8 I! address7s8

Linux (Networking)

Page 19

38 user access control

%8 1ou can force the use of some specific ports&

Wor, to 3o in co--*n3 -o3e

!& N4S Ser1er%

reate a folder named 3o22iern'2 in /6o-e et set read and write permissions to Linux (Networking) Page 20

two fedora computers on the ntewor#

e0it E /etc/e>ports

/00 the followingE

/ho3e/0ossiernfs ipLclientArwC< ipLclient%ArwC

2& N4S C/ient %

a8 reate the folder "mnt"parta$enfs on the ,F' client

b8 (ccess to the shared folder 3o22iern'2 usin$ the mount command&

. 3o2nt -t nfs ipLserve2rE/ho3e/0ossiernfs /3nt/p/rt/genfs

c8 (dd the followin$ line to the "etc"fstab file for automatic mountin$ at startup &
ipLserve2rE/ho3e/0ossiernfs /3nt/p/rt/genfs /2to<2ser<rw ! !

verification @@@@@@@@@@@

Linux (Networking)

Page 21

V % S0ARING AN INTERNET CONNEXION USING IP MAS7UERADE


!& O#$ECTIVES %

18 onfi$ure a Linux computer with two ,I s 28 'hare an Internet connexion

2& Conte5t % <ou have a Linux computer with two networ# cards with +,' installed and confi$ured. <ou must allow other computers on the networ# to access the Internet throu$h this machine. <ou must confi$ure I! )('I3.0(+..

"& Wor, to 3o %

A&

Wor, on t6e 2er1er

!& Lo$on into a terminal as a root 2& 'tart " 'top the firewall service% 8 2er1ice i.t*A/e2 2t*rt or 2to. "& .nable I! masJuerade in the routin$ ,(T table on the et6E Interface connected to the 6(, .xecute the followin$ command if the et6 is connected to the 6(,& i.t*A/e2 Ft n*t FA POSTROUTING Fo et6 Fj MAS7UERADE

Linux (Networking)

Page 22

<& P)t t6e 1*/)e o' t6e i.G'or+*r3 to ! .dit the /etc/2@2ct/.con' file as root and modif1 net.i.1<.i.G'or+*r3C! .xecute the followin$ command& 2@2ct/ F. =& <ou can also set the forwardin$ value to 1 usin$ the followin$& ec6o ! H /.roc/2@2/net/i.1</con'/*///'or+*r3in(

#&

Wor, on t6e Internet c/ient

3se 6indows 4! client and confi$ure manualla1 and d1namicall1 7+H !8 an I!"masJue5 a default $atewa1 ans +,' servers 7those of the colle$e8 I! " )('I3. C& +efault $atewa1 +,'

Test Internet connexion from this client

verification @@@@@@@@@@@

Linux (Networking)

Page 23

PART II
O#$ECTIVES % VI& In2t*// *n3 con'i()re * .ri-*r@ DNS Ser1er VII& Secon3*r@ DNS Ser1er VIII& In2t*// *n3 con'i()re APAC0E Ser1er

PRERE7UISITES 1. Have installed Linux Fedora 2. Know the basics commands of Linux 3. Know the basic concepts of T !"I! networ#in$ %. Know the role of the followin$ services& '()*("+H !",F'

PRO$ECT IMPLEMENTATION% <ou are now the technician responsible for the compan1 -.L/-.0T inc. The compan1 has a Linux 7Fedora8 networ# <ou must install and confi$ure the +,' " HTT! services. 3se two Linux 7Fedora8 computers

Linux (Networking)

Page 24

VI& In2t*// *n3 con'i()re * .ri-*r@ DNS Ser1er

OAjecti1e2 %

18 Install the +,' service 28 onfi$ure the +,' service files for primar1 forward loo#up 38 onfi$ure the +,' service files for primar1 reverse loo#up

%8 'tart the primar1 server ;8 Test the primar1 server 98 reate forward and reverse loo#up Fone files

=8 Test other domain names

Conte5t %

The compan1 wants to perform name resolution and I! address resolution. <ou must install and confi$ure the +,' service. )a#e sure 1ou confi$ure the FI+, of the server5 set a static I! address5

Con'i()re 2t*tic IP *33re22

18 Launch 2@2te-Dcon'i(Dnet+or, and then edit the ,I properties.

28 .nter reJuired information &

Linux (Networking)

Page 25

Ste.2 %

!& 4i/e2 to )2e

/etc/named.conf /var/named/named.ca
/var/named/votredomaine.com.db

File containin$ +,' server t1pes& -*2ter or 2/*1e or 'or+*r3 File containin$ the root +,' 'ervers information File containin$ the forward loo#up Fone .xample of file containin$ the reverse loo#up Fone for the 12.2.1.2 subnet

/var/named/slaves/10.0.1.d

/etc/resolv.conf

File containin$ the search domain path and the the I! addresses of the +,' servers to use 2& Ste.2 *'ter #IND Ser1er 6*2 Aeen in2t*//e3 ?itI2 j)2t *n e5*-./e& Page 26

Linux (Networking)

a8 )a#e sure 1ou confi$ure static T ! " I! settin$s for the Fedora server

b8

FI+, of the F.+/0( computer I!")as# +,' (dd the followin$ +,' addresses in the /etc/re2o/1.con' 'i/e n*-e2er1er !92.!:;.!= .! n*-e2er1er !92.!:;.!= .2

c8

)odif1 the /etc/n*-e3.con' file

listen+on port ,- ./01.0.0./2/30./45./,0./262 allow+7uery.localhost2any262

d8

reate the terre1erte.net Fone usin$ tthe $raphical tool 7see the followin$ pa$es8. onfi$ure the AJ CNAMEJ MX records. The reverse Fone and the PTR record are automaticall1 created. Then5 chec# that the forward looup Fone file in 1*r/n*-e3/terre1erte.net.3A has benn created and the same for the reverse loo#up Fone v*r/n*-e3/!92.!:;.!= . .3A file. For the command line mode5 see the example bellow

e8

Test with n2/oo,). +++.terre1erte.net *n3 @o) oAt*in%

Linux (Networking)

Page 27

Con'i()r*tion e5*-./e

onfi$ure the "etc"named.conf file (dd the master and forward and reverse loo#up Fones

reate the "var"named"server.world.lan file for the forward loo#up Fone

Linux (Networking)

Page 28

reate the "var"named"2.2.12.db for the reverse loo#up Fone

"& DNS MASTER % co--*n3 -o3e

'T.!'

18 Installation

0K'3LT' y23 inst/ll bin0 bin0-2tils

y23 inst/ll syste3-config-bin0 L *2 root K 28 onfi$urin$ a primar1 /etc/n/3e0.conf +,' and creation of master forward and options 8 reverse loo#up Fones

L *2 root K Con'i()re t6e /i2tenin( .ort to Ae ="

listen+on port ,- ./01.0.0./2/0.0./.,262 allow+7uery.localhost2any262r8pond 9 tout poste

D Mone ;votre0o3/ine.co3.; 'N 8 type 3/ster9 file ;votre0o3/ine.co3.0b;9 allow+transfer./0.0./.1262serveur slave also+notify./0.0./.1262serveur slave D9

Linux (Networking)

Page 29

allow+transfer./0.0./.1262 also+notify./0.0./.1262 to allow the :one transfer for a slave ()S

Mone ; .!. !.in-/00r./rp/.; 'N 8 type 3/ster9 file ; !.!. .0b;9 allow+transfer ./0.0./.1262serveur slave also+notify ./0.0./.1262serveur slave D9

38 Forward loo#up Fone file /var/named/votredomaine.com.db example $ORIGIN example.com.


$TTL 86400 @ IN SOA dns1.example.com. hostmaster.example.com. ( 1 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ; minimum TTL of 1 day ) IN NS dns1.example.com. IN NS dns2.example.com. IN MX 10 mail.example.com. IN MX 20 mail2.example.com. IN A 10.0.1.5 dns1 IN A 10.0.1.5 dns2 IN A 10.0.1.7 server1 IN A 10.0.1.1 server2 IN A 10.0.1.2 ftp IN CNAME server1 mail IN CNAME server1 www IN CNAME server2

%8 0evesre loo#up Fone file /var/named//0.0./.db example


$ORIGIN 1.0.10.in-addr.arpa. $TTL 86400 @ IN SOA dns1.example.com. hostmaster.example.com. ( 1 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ; minimum TTL of 1 day ) IN NS dns1.example.com. IN NS dns2.example.com. 1 IN PTR server1.example.com. 2 IN PTR server2.example.com. 5 IN PTR dns1.example.com. 7 IN PTR dns2.example.com.

;8

onfi$ure the +,' client /etc/resolv.conf to use 1our own +,' for Linux (Networking) Page 30

name resolution
n/3eserver %*.!.!. n/3eserver !.!. .& . service n/3e0 st/rt . service n/3e0 stop . rn0c relo/0

98 start " stop the +,' 'erver =8 0eload the +,' server >8 (utomatiJue startup C8 Test of the +,' server 128 hec# for errors in the confi$ file

' ch confi! named on


nslookup servername.domainname.com dig servername.domainname.com # vi /var/log/messages

<& DNS MASTER% Gr*.6ic*/ Mo3e

a8 a8 /pen the $raphical confi$uration tool & '1stem" administration " server parameters or t1pe as a root D 2@2te-Dcon'i(DAin3

b8

lic# on new to create a new Lone.

lic# on

5 set the t1pe to

Linux (Networking)

Page 31

c8 .nter the Fone name5 1otre3o-*ine.co-. +onAt for$et the dot M . K at the end of the name then press

d8 .nter the info about the +,' server

e8 (dd the followin$ Fone records & AJ CNAMEJ MX

f8 (dd an A recor3

Linux (Networking)

Page 32

$8 (dd a CNAME recor3

h8 (dd a MX record

i8 'ave the modification

H8

onfi$ure the +,' client to use 1our Dvi "etc"resolv.conf own +,' for name resolution nameserver 12=.2.2.1 nameserver 1C2.19>.222.1 l8 If errors5 rechec# all the steps

#8 Test with n2/oo,). +++.1o/o1ert.net

=& Wor, to 3o in (r*.6ic*/ -o3e% Linux (Networking) Page 33

18

onfi$ure a master forward and a reverse loo#up Fone for VELOVERT.NET *n3 #IXI.COM 3o-*in2. reate the correspondin$ records&

None VELOVERT.NET

A CNAME MX

@o)r IP *33re22 WWW.VELOVERT.NET VOTRESERVER.VELOVERT.NET

None #IXI.COM

A CNAME MX

@o)r IP *33re22 WWW.#IXI.COM VOTRESERVER.#IXI.COM

28 Test 1our +,' 'erver with n2/oo,).

Linux (Networking)

Page 34

Faites vMrifier @@@@@@@@@@@

VII % INSTALLING AND CON4IGURING A SLAVE DNS SERVER


Linux (Networking) Page 35

OAjecti1e2 %

18 Install +,' 'erver on another Fedora computer 28 onfi$ure slave forward loo#up Fones 38 'tart and test the secondar1 +,' 'erver

Conte5t%

<ou need a second Fedora machine to act as a slave 7secondar18 +,' 'erver.

Steps: !& onfi$ure the )aster +,' "etc"named.conf confi$uration file to allow Fone transfert 7for 1our domain8 to a slave +,'. In the section L 1ourdomain.com N allow:transfer O12.2.1.=PQP slave server
/lso-notify 8 !.!. .*9D9 sl/ve server

2& SLAVE DNS

STEPS 18 Installation 28 onfi$ure forward loo#up Fone slave +,' E3ite /etc/n*-e3.con'

RESULTS D1um install bind bind:utils D1um install s1stem:confi$:bind Fone Rvotredomaine.com.R I, O t1pe slaveP file Rslaves"votredomaine.com.dbRP masters O 12.2.1.; port ;3 QP QP Fone R1.2.12.I,:(++0.(0!(.R I, O

38

onfi$ure reverse loo#up Fone Linux (Networking) Page 36

slave +,' E3ite /etc/n*-e3.con'

t1pe slaveP file Rslaves"1.2.12.I,:(++0.(0!(.dbRP masters O 12.2.1.; port ;3 QP QP D 'ervice named restart D rndc reload "var"named"slaves"votredomaine.com.db. D nsloo#up votreserver.votredomaine.com

%8 0estart +,' 'erver ;8 0eload +,' 'erver 98 hec# if file transfer has occurred =8 Test 1our server "& GRAP0ICAL MODE

".!& Con'i()r2 t6e MASTER DNS to *//o+ Lone tr*n'ert 'or 'or+*3 *n3 re1er2e /oo,). Lone2

'tart s1stem:confi$:bind +ouble:clic# on the created Fone 'elect allow transfer and add it to the current options allow:transfer

(dd the I! address of the 'L(-. +,' lic# on (dd

Linux (Networking)

Page 37

onfi$ure

(dd the I! address of the 'L(-. +,' (nd -alidate 0edo the same steps for the reverse loo#up Fone allow:transfer O ip@+,'@'lave PQP also:notif1Oip@+,'@'lave PQP 0estart the named service D service named restart

".2& Con'i()re t6e SLAVE DNS'or * 'or+*r3 /oo,). Lone

'tart s1stem:confi$:bind lic# on new Fone hoose 'L(-. Fone t1pe .nter the name of the master Fone and validate

Linux (Networking)

Page 38

.nter the I! address of the master +,' 'ave the confi$uration

0estart the +,' 'erver "."& Re/o*3 t6e DNS Ser1er

D service named restart #rndc reload

he# if the Fone file has been created in /1*r/n*-e3/2/*1e2

"."& Con'i()re t6e SLAVE DNS'or * re1er2e /oo,). Lone

Linux (Networking)

Page 39

'tart s1stem:confi$:bind lic# on new Fone hoose 'L(-. Fone t1pe .nter the name of the master Fone != .!92.!:;.INDADDR.ARPA. and validate

.nter the I! address of the master +,' 'ave the confi$uration

0estart the +,' 'erver ".<& Re/o*3 t6e DNS Ser1er

D service named restart #rndc reload

he# if the Fone file has been created in /1*r/n*-e3/2/*1e2 <& Wor, to 3o in (r*.6ic*/ -o3e %

onfi$ure 1our second +,' 'erver as a 'L(-. server for the VELOVERT.NET Lone Linux (Networking) Page 40

-erification& @@@@@@@@@@@

Linux (Networking)

Page 41

VIII % CON4IGURE AN APAC0E SERVER


O#$ECTIVES %

!& Install (!( H. 'erver 2& onfi$ure (!( H. confi$uration files "& Test a basic confi$uration of (!( H. 'erver <& onfi$ure virtual sites

=& Test (!( H. virtual sites

CONTEXT%

The compan1 has a website and also hosts other sites. It assi$ns to 1ou the responsibilit1 to install the service for confi$urin$ (!( H. and the mana$ement of websites

STEPS%

!& Mo2t i-.ort*nt 'i/e2 *n3 'o3er2

4ILE2 or 4OLDERS /etc/http0 /etc/http0/conf/http0.conf /etc/http0/conf.0

ROLE folder containing all configuration files Main configuration file folder containing the secondary configuration files and

Linux (Networking)

Page 42

extensions provided software using /v/r/log/http0 /v/r/log/http0/errorLlog /v/r/www /v/r/www/cgi-bin /v/r/www/error /v/r/www/ht3l /v/r/www/icons /v/r/www/3/n2/l Folder containing log files

pache!

"og containing all pages processed #y the server Folder for the default site information n $empty% folder for scripts Folder containing error messages pages n $&mplty% folder containing documents for the default site Folder containing some icons Folder containing documentation

2& CON4IGURATION

A& Co--*n3 Mo3e

ETAPES

RESULTATS . y23 inst/ll http0-3/n2/l

18 Installation

28 'tart " stop

. service http0 st/rt or stop or relo/0 Or 2se the following co33/n0 . /sbin/service http0 st/rt or stop or relo/0

Linux (Networking)

Page 43

38 %8

(utomatic startup of the 6tt.3 service hec#in$ for s1ntax1

. chkconfig http0 on

. service http0 configtest

;8 Test 1our (pache 'erver usin$ localhost5 or 1our I! (ddress or 1our domain name 98 onfi$urin$ a virtual site& site1
"o0ify the fileE /etc/http0/conf/http0.conf ,re/te the root fol0erE /v/r/www/site $et per3issions *& to /llow everyone to e>ec2te yo2r web p/ges Test yo2r virt2/l site with K'REKON

http&""12=.2.2.1

N/3ePirt2/lQost SE7! OPirt2/lQost SE7!R . ho3e 02 site E +R- = httpE//www.site .co3 $erverN/3e www.site .co3 . )ossier conten/nt les p/ges )oc23entRoot /v/r/www/ht3l/site O)irectory /v/r/www/ht3l/site R Options "2ltiPiews 'n0e>es $y3-inks'fOwner"/tch 'ncl20esNoE>ec #llowOverri0e Kile'nfo #2th,onfig -i3it O/)irectoryR . He2 0e c/r/ctTres A+TK-7 p/r 0:f/2tC #00)ef/2lt,h/rset '$O-77&5O/Pirt2/lQostR

);*$ < Repete OPirt2/lQostR /n0 O/Pirt2/lQostR /s 3/ny ti3e /s virt2/l sites hoste0

#& Gr*.6ic*/ -o3e

Linux (Networking)

Page 44

!& /pen the (!( H. confi$uration tool & '1stem " administration " server parameters de "http

2& (dd the I! address and the port of the web site

"& Tunin$ HTT! 'erver performance

<& To add "modif1 " delete virtual hots Oo) -)2t 'ir2t cre*te 'or+*r3 *n3 re1er2e /oo,). Lone2 in t6e DNS Ser1er

Virt)*/ 2ite2 con'i()r*tion E5*-./e


Linux (Networking) Page 45

.dit "etc"httpd"conf"6tt.3.con' )odif1 the sections S-irtualHostT S"-irtualHostT )odif1 +ocument0oot 'pecif1 'erver,ame Note2 % 0edo for the same for all virtual sites 1ou plan to host

0estart httpd reate the index.html files for each site& 18 "var"www"html 28 "home"fedora"public@html

Test 1our web sites with firefox

Linux (Networking)

Page 46

Wor, to 3o %
CON4IGURING APAC0E SERVER IN CONSOLE MODE

!& 3se the 1e/o1ert.net and Ai5i.co- Fones created in the +,'

!)

reate a 6.* site for 666.-.L/-.0T.,.T

'erver,ame www.velovert.net +ocument0oot "var"www"html"velovert

")

reate a virtual 6.* site for 666.*I4I. /)

'erver,ame www.bixi.com +ocument0oot "var"www"html"bixi

<&

reate 1our own index.html welcome pa$es in the root directories of each virtual site

Linux (Networking)

Page 47

=& Test 1our web sites 666.-.L/-.0T.,.T and 666.*I4I. /)

-erification @@@@@@@@@@@

Linux (Networking)

Page 48

Das könnte Ihnen auch gefallen