DOMANDA IP statico CentOS

DiegoMilito

Nuovo Utente
32
0
Salve a tutti, ho la necessità di impostare un IP statico su macchina virtuale virtualbox con CentOS. Devo fare in modo che sia a casa che all'università quando avvio la VM questa abbia sempre lo stesso IP. Qualche suggerimento?
 

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
lo devi impostare via cli o gui?
 

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
Che versione di centos?? la 7??
 

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
Prima di tutto la schede di rete (nelle impostazioni di virtualbox) deve essere impostata come scheda con bridge.

1) individua il nome della scheda di rete con
Codice:
ip addr
(dovrebbe essere una cosa del tipo enp..)
2) edita il file di configurazione della scheda con
Codice:
sudo nano /etc/sysconfig/network-scripts/ifcfg-NOMESCHEDADIRETE
3) sul file di configurazione devi modificare le seguenti voci come segue:
Codice:
BOOTPROTO=static
ONBOOT=yes
4) aggiungi al file di configurazione l'indirizzo ip da assegnare, netmask, gateway, dns:
Codice:
IPADDR=192.168.x.xxx
NETMASK=255.255.255.0
GATEWAY=192.168.x.xxx
DNS1=x.x.x.x
DNS2=x.x.x.x
5) riavvia il network con
Codice:
sudo systemctl restart network
 
  • Mi piace
Reazioni: DiegoMilito

DiegoMilito

Nuovo Utente
32
0
Ho seguito questa procedura, tuttavia testando la rete provando ad effettuare un ping a google.com mi da nome o servizio sconosciuto. Soluzioni?
 

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
Quali dns hai impostato??
 

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
controlla con ip addr che sia stato assegnato l'ip statico giusto.
se pinghi il gateway oppure i dns (8.8.8.8) hai errori??

postami il risultato di
Codice:
cat /etc/resolv.conf
e di
Codice:
cat /etc/sysconfig/network-scripts/ifcfg-NOMESCHEDADIRETE
 

DiegoMilito

Nuovo Utente
32
0
cat /etc/resolv.conf

#Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

cat /etc/sysconfig/network-scripts/ifcfg-NOMESCHEDADIRETE (in allegato)
 

Allegati

  • Schermata 2017-10-16 alle 12.27.02.jpg
    Schermata 2017-10-16 alle 12.27.02.jpg
    47.1 KB · Visualizzazioni: 166

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
cat /etc/resolv.conf

#Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

cat /etc/sysconfig/network-scripts/ifcfg-NOMESCHEDADIRETE (in allegato)

Se non pinghi nemmeno il gateway: o la scheda è down, o il servizio è down oppure è sbagliato il gateway e/o l'ip.
Sei sicuro che la classe di indirizzi sia corretta??
Nei SOHO in genere è 192.168.1.x o 192.168.0.x

il servizio network è up?? e la scheda di rete??
Codice:
sudo systemctl status network
Codice:
ip addr show dev enp0s3
Puoi postarmi i risultati??

PS. do per scontato che la VM abbia la rete impostata come scheda con bridge.
 

DiegoMilito

Nuovo Utente
32
0
Si la VM è impostata come scheda con bridge.
Allego i risultati ai due comandi.
 

Allegati

  • Schermata 2017-10-16 alle 13.00.41.jpg
    Schermata 2017-10-16 alle 13.00.41.jpg
    77.2 KB · Visualizzazioni: 158
  • Schermata 2017-10-16 alle 13.01.20.jpg
    Schermata 2017-10-16 alle 13.01.20.jpg
    36.8 KB · Visualizzazioni: 120

cdtux

Utente Èlite
1,829
911
CPU
I7 3770
Scheda Madre
Asrock Z77 Extreme 4
HDD
Samsung 850 pro 250GB
RAM
Corsair Vengeance LP 16GB
GPU
Gigabyte GTX1060 6GB
Monitor
Dell U2412M
PSU
Seasonic Focus Plus 650
Case
Corsair Graphite 760T
OS
Debian / Ubuntu
spero vivamente che tu abbia modificato il file con il nome della scheda giusto e non letteralmente /etc/sysconfig/network-scripts/ifcfg-NOMESCHEDADIRETE
quindi /etc/sysconfig/network-scripts/ifcfg-enp0s3 :D

ip addr dice che l'indirizzo ip assegnato è 192.168.0.100 e probabilmente questo è il motivo per cui non raggiungi il gateway (che sarebbe il router).
Ora, per assegnare l'ip giusto, o riavvi la VM o il solo network (sudo systemctl restart network).
 

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!

Discussioni Simili