Di seguito alcune brevi indicazioni su come impostare e gestire la rete su macchine Centos
Attivazione scheda di rete
The /etc/sysconfig/network file should contain the following line:
NETWORKING=yes
The NETWORKING variable must be set to yes if you want networking to start at boot time.
The /etc/sysconfig/network-scripts/ifcfg-eth0 file should contain the following lines:
DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
BOOTPROTO=dhcp
ONBOOT=yes
Se si vuole abilitare altre scehde di rete basta modifcare il file relativo:
/etc/sysconfig/network-scripts/ifcfg-eth1 (wth2, eth3 …)
eseguire il comando
#service network restart
Attenzione: rispettare gli spazi, dopo = (uguale) non ci vanno gli spazi
Rename HostName
Come modificare l’hostName del sistema operativo centOS
modifcare l file /etc/hosts
$ vi /etc/hosts
127.0.0.1 NEWNAME localhost.localdomain localhost
Modifcare il file /etc/sysconfig/network
Inserire l’attributo HOSTNAME. (se c’è già modificare il valore)
# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=NEWNAME
4. Restart the Network
# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]