Como aplicar o endereço IP estático
Oi lá,
Tenho um servidor Debian 5,0 recém-instalado.
Por padrão, o endereço IP é dado por dhcp.
Código:
pegase:~# grep '^[^#]' /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
pegase:~# head -2 /etc/hosts
127.0.0.1 localhost
127.0.1.1 pegase.apltest pegase
Então eu modificar os arquivos de modo que eles olham como este:
Código:
pegase:~# grep '^[^#]' /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.251
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
pegase:~# head -2 /etc/hosts
127.0.0.1 localhost
192.168.1.251 pegase.apltest pegase
Então eu tento aplicar as alterações, com:
Código:
pegase:~# /etc/init.d/networking restart
Mas nesse momento, eu solto eth0:
Código:
pegase:~# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 B) TX bytes:560 (560.0 B)
E a única forma de aplicar as alterações é necessário reiniciar o servidor.
Será isto normal? Como eu posso mudar de DHCP para endereço estático sem reiniciar?
Obrigado por sua ajuda.
Santiago
|