Configuration d’une machine Centos dans le réseau
Configuration
les fichiers à modifier ou vérifier se trouvent tous dans le répertoire /etc
* hosts * nsswitch.conf * ntp.conf * resolv.conf * yp.conf * sysconfig/network * sysconfig/network-scripts/ifcfg-eth0
– Fichier hosts :
root@srvlinux:/etc# cat hosts 127.0.0.1 localhost # 172.16.xxx.xxx srvlinux.peltier-net.fr srvlinux 172.16.xxx.xxx srvlinux.peltier-net.fr srvlinux
– Fichier nsswitch.conf :
root@srvlinux:/etc# cat nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: files nis group: files nis shadow: files nis hosts: files dns networks: files protocols: files services: files nis ethers: files rpc: files netgroup: nis
– Fichier resolv.conf:
root@srvlinux:/etc# cat resolv.conf search peltier-net.fr
nameserver 172.16.17.13 nameserver 172.16.16.100
– Fichier ntp.conf :
# /etc/ntp.conf, configuration for ntpd driftfile /var/lib/ntp/ntp.drift # Enable this if you want statistics to be logged. #statsdir /var/log/ntpstats/ statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable # You do need to talk to an NTP server or two (or three). server ntp.peltier-net.fr # By default, exchange time with everybody, but don't allow configuration. # See /usr/share/doc/ntp-doc/html/accopt.html for details. restrict -4 default kod notrap nomodify nopeer noquery restrict -6 default kod notrap nomodify nopeer noquery # Local users may interrogate the ntp server more closely. restrict 127.0.0.1 restrict ::1
– Fichier yp.conf :
domain peltier-net server nisserver.peltier-net.fr
– Fichier sysconfig/network :
NETWORKING=yes HOSTNAME=srvlinux NISDOMAIN=peltier-net
– Fichier sysconfig/network-scripts/ifcfg-eth0 :
IP Fixe
DEVICE=eth0 BOOTPROTO=none HWADDR=00:0F:1F:99:92:98 ONBOOT=yes TYPE=Ethernet IPADDR=172.16.xxx.xxx NETWORK=172.16.0.0 NETMASK=255.255.0.0 GATEWAY=172.16.1.254 BROADCAST=172.16.255.255 USERCTL=no IPV6INIT=no PEERDNS=yes
IP DHCP
DEVICE=eth0 ONBOOT=yes BOOTPROTO=dhcp DHCP_HOSTNAME=${HOSTNAME} HWADDR=00:50:56:8d:57:56
0 commentaire