Defina o IP estático quando o servidor DHCP estiver inacessível

2

Eu posso configurar o RPi para o cliente DHCP. Mas quando o servidor DHCP está inacessível, eu quero definir o IP específico. Como posso configurar o dhclient para isso?

    
por SimaWB 15.09.2015 / 16:32

1 resposta

2

Existe uma declaração de concessão . Uma citação do manual :

The DHCP client may decide after some period of time (see PROTOCOL TIMING) that it is not going to succeed in contacting a server. At that time, it consults its own database of old leases and tests each one that has not yet timed out by pinging the listed router for that lease to see if that lease could work. It is possible to define one or more fixed leases in the client configuration file for networks where there is no DHCP or BOOTP service, so that the client can still automatically configure its address. This is done with the lease statement.

Então, você poderia adicionar à sua declaração dhclient.conf a algo assim

lease {
    interface "eth0";
    fixed-address 192.168.1.1;
    option subnet-mask 255.255.255.0;
    renew 2 2022/1/1 00:00:01;
    rebind 2 2022/1/1 00:00:01;
    expire 2 2022/1/1 0:00:01;
}
    
por 15.09.2015 / 19:25