dhclient diz que é obrigatório endereçar - mas ifconfig não

1

Eu iniciei dhclient com:

syslog:

...
Dec 27 03:26:03 HOST dhclient[13412]: DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 3 (xid=0x859ef640)
Dec 27 03:26:03 HOST dhclient[13435]: DHCPREQUEST of 192.168.1.199 on enp4s0 to 255.255.255.255 port 67 (xid=0x40f69e85)
Dec 27 03:26:03 HOST dhclient[13435]: DHCPOFFER of 192.168.1.199 from 192.168.1.1
Dec 27 03:26:03 HOST dhclient[13435]: DHCPACK of 192.168.1.199 from 192.168.1.1
Dec 27 03:26:03 HOST dhclient[13435]: bound to 192.168.1.199 -- renewal in 1045201 seconds.

Parece que funcionou, mas ifconfig não mostra o endereço:

ifconfig enp4s0
enp4s0    Link encap:Ethernet  HWaddr 00:08:a2:48:48:48
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::208:a2ff:fe0c:f648/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:135707 (135.7 KB)  TX bytes:2264 (2.2 KB)
          Memory:dfd00000-dfd1ffff
  • Existe uma maneira de corrigir isso?
  • Para o meu teste atual, 192.168.1.199 responda a ping , mas às vezes não.

- Editar -

cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto enp4s0
iface enp4s0 inet manual
  • inicio dhclient manualmente

- Editar -

 ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
7: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:08:a2:48:48:48 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet 192.168.1.199/24 brd 192.168.1.255 scope global secondary enp4s0
       valid_lft forever preferred_lft forever
    inet6 fe80::208:a2ff:fe0c:f648/64 scope link
       valid_lft forever preferred_lft forever
    
por hudac 27.12.2017 / 10:03

1 resposta

1

Graças a @Johan Myréen percebi através do comando ip addr :

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
7: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:08:a2:48:48:48 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global enp4s0
       valid_lft forever preferred_lft forever
    inet 192.168.1.199/24 brd 192.168.1.255 scope global secondary enp4s0
       valid_lft forever preferred_lft forever
    inet6 fe80::208:a2ff:fe0c:f648/64 scope link
       valid_lft forever preferred_lft forever

Por algum motivo, a interface enp4s0 tem um endereço primário e secundário , onde dhcp ip está no secundário endereço por algum motivo desconhecido.

Embora eu não saiba o motivo - o que ajuda a resolver esse problema é chamar

ip addr flush dev enp4s0

Que liberam a interface - então eu inicio a limpeza ao alocar o endereço dhcp

    
por 28.12.2017 / 08:40