Aggiungere IP aggiuntivi ad un server

Indirizzi IP (host)


Aggiungere utletiori indirizzi IPv4

Gli indirizzi IP possono essere messi provvisoriamente in due modi diversi:

    ifconfig eth0: 1 192.0.2.10 netmask 255.255.255.255

    oppure

    ip addr add 192.0.2.10/32 dev eth0

CentOS

Una configurazione permanente è possibile solo per default tramite interfacce alias (eth0: 1, eth0: 2, ecc). È necessariocreare un file per ogni indirizzo IP.

/etc/sysconfig/network-scripts/ifcfg-eth0:1
/etc/sysconfig/network-scripts/ifcfg-eth0:2

Questi file devono contenere le seguenti informazioni:
 

DEVICE=eth0:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=<IP Address>
NETMASK=255.255.255.255


Infine occorre riavviare il serverizio network "service network restart" oppure riavviare il server ("reboot").

Aggiunta di subnet IPv4

Le sottoreti vengono instradate sull'IP principale di un server. In generale, il primo (IP Network) e l'ultimo (Broadcast IP) non possono essere utilizzati. Questo lascia sei indirizzi utilizzabili per una subnet /29

Una sottorete /29 è composta da 8 indirizzi IP sarà simile a questa:

aaa.aaa.aaa.aaa (Network IP)
bbb.bbb.bbb.bbb
ccc.ccc.ccc.ccc
ddd.ddd.ddd.ddd
eee.eee.eee.eee
fff.fff.fff.fff
ggg.ggg.ggg.ggg
hhh.hhh.hhh.hhh (Broadcast IP)

Da "b" IP a "g" possono essere configurati e utilizzato come singoli indirizzi IP. In alternativa, è possibile creare un file:

/etc/sysconfig/network-scripts/ifcfg-eth0-range0

IPADDR_START=<Your Network Address + 1>
IPADDR_END=<Your Network Address + 6>
BROADCAST=<Your Network Address + 7>
CLONENUM_START=0
NETMASK=255.255.255.248


Riavviare il servizio utilizzando "service restart network".

  • 1 Utenti hanno trovato utile questa risposta
Hai trovato questa risposta utile?

Articoli Correlati

Ho to connect to Windows Server in RDP

To connect to our Windows Servers you need to set a Custom RDP Port on you R ClientDP, this to...