Ubuntu 20.04 /etc/network/interfaces 및 ifupdown이 인터넷에 연결되지 않음

Ubuntu 20.04 /etc/network/interfaces 및 ifupdown이 인터넷에 연결되지 않음

많은 AskUbuntu 포럼 게시물에 설명된 대로 ifupdown을 설치하고 netplan.io를 제거/제거했습니다. 지금은 /etc/network/interfaces(2013년 경 Ubuntu 설치에서 복사되었으며 파일의 eth0만 enp4s0으로 업데이트됨)에서 설정을 제공하지만 ifconfig여전히 ip a인터넷이 없습니다. 하지만 일부 연결은 있는 것 같습니다. 즉, 로컬 네트워크의 프린터를 인식합니다.

ping google.com 

반환합니다 Temporary failure in name resolution. 그러나 ping 8.8.8.8잘 작동합니다.

시스템: Ubuntu 20.04.3 LTS(Focal Fossa)

여기서 무슨 일이 일어날 수 있습니까?

ifconfig:

enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.31  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x20<link>
        inet6 2607:fea8:3e80:64a:a6ba:dbff:fe03:2e44  prefixlen 64  scopeid 0x0<global>
        ether a4:ba:db:03:2e:44  txqueuelen 1000  (Ethernet)
        RX packets 3128  bytes 483360 (483.3 KB)
        RX errors 0  dropped 16  overruns 0  frame 0
        TX packets 482  bytes 84822 (84.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2836  bytes 217982 (217.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2836  bytes 217982 (217.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

답변1

/etc/resolv.conf 파일이 잘못 설정되었습니다. 이전 2013 Ubuntu 버전에서 /etc/resolv.conf 파일을 복사하기만 하면 됩니다. 즉:

domain 'URL address'
search 'URL address'
nameserver 'IP address'
nameserver 'IP address'

관련 정보