운영 체제: Linux Mint 18.2 Cinnamon + Windows 10 Pro 듀얼 부팅.
방금 이 웹사이트를 이용했어요http://test-ipv6.com/내 IPv6 준비 상태를 확인하세요.
Windows 10 Pro의 결과:
Linux Mint 18.2 Cinnamon의 결과:
보시다시피 저는일부내 Linux Mint의 DNS 설정에 문제가 있습니다. 그러나 예를 들어 네트워크 설정 - IPv6 섹션에서는 모든 것이 켜져 있는 것 같습니다.
실패한 DNS 설정을 어디서 찾을 수 있는지 잘 모르겠습니다. 아니면 Linux Mint 18은 아직 IPv6를 사용할 준비가 되어 있지 않습니까?
편집 1:
$ cat /etc/resolv.conf
nameserver 209.222.18.222
nameserver 209.222.18.218
하지만 Network Manager에서는 Google DNS가 기본 DNS로, 내 IPS가 보조 DNS로 표시됩니다. 이는 라우터 DHCP의 IPv4 섹션에서 구성했습니다.
내 노트북이 이것을 사용하고 있다고 생각합니다.
$ nmcli dev show | grep DNS
IP4.DNS[1]: 8.8.8.8
IP4.DNS[2]: 10.255.255.10
IP6.DNS[1]: 2a02:768:0:1010::3
IP6.DNS[2]: 2a02:768:0:1010::2
IPv6를 전혀 이해하지 못한다는 점은 인정하지만 Windows에서 테스트하는 이유를 이해하지 못하므로 IPv6는 완전히 작동하지만 Linux에서는 작동하지 않습니다.
$ cat /etc/gai.conf
# Configuration for getaddrinfo(3).
#
# So far only configuration for the destination address sorting is needed.
# RFC 3484 governs the sorting. But the RFC also says that system
# administrators should be able to overwrite the defaults. This can be
# achieved here.
#
# All lines have an initial identifier specifying the option followed by
# up to two values. Information specified in this file replaces the
# default information. Complete absence of data of one kind causes the
# appropriate default information to be used. The supported commands include:
#
# reload <yes|no>
# If set to yes, each getaddrinfo(3) call will check whether this file
# changed and if necessary reload. This option should not really be
# used. There are possible runtime problems. The default is no.
#
# label <mask> <value>
# Add another rule to the RFC 3484 label table. See section 2.1 in
# RFC 3484. The default is:
#
#label ::1/128 0
#label ::/0 1
#label 2002::/16 2
#label ::/96 3
#label ::ffff:0:0/96 4
#label fec0::/10 5
#label fc00::/7 6
#label 2001:0::/32 7
#
# This default differs from the tables given in RFC 3484 by handling
# (now obsolete) site-local IPv6 addresses and Unique Local Addresses.
# The reason for this difference is that these addresses are never
# NATed while IPv4 site-local addresses most probably are. Given
# the precedence of IPv6 over IPv4 (see below) on machines having only
# site-local IPv4 and IPv6 addresses a lookup for a global address would
# see the IPv6 be preferred. The result is a long delay because the
# site-local IPv6 addresses cannot be used while the IPv4 address is
# (at least for the foreseeable future) NATed. We also treat Teredo
# tunnels special.
#
# precedence <mask> <value>
# Add another rule to the RFC 3484 precedence table. See section 2.1
# and 10.3 in RFC 3484. The default is:
#
#precedence ::1/128 50
#precedence ::/0 40
#precedence 2002::/16 30
#precedence ::/96 20
#precedence ::ffff:0:0/96 10
#
# For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96 100
#
# scopev4 <mask> <value>
# Add another rule to the RFC 6724 scope table for IPv4 addresses.
# By default the scope IDs described in section 3.2 in RFC 6724 are
# used. Changing these defaults should hardly ever be necessary.
# The defaults are equivalent to:
#
#scopev4 ::ffff:169.254.0.0/112 2
#scopev4 ::ffff:127.0.0.0/104 2
#scopev4 ::ffff:0.0.0.0/96 14
따라서 거의 모든 것이 주석 처리되어 있습니다.
또한 내가 어떤 DHCP 클라이언트를 사용하고 있는지 물으셨습니다.
$ dhclient --help
Internet Systems Consortium DHCP Client 4.3.3
...
편집 2:
$ cat /etc/dhcp/dhclient.conf
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
timeout 300;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
편집 3:
위 줄 뒤에 IPv6 줄을 복사하여 붙여넣습니다.
cat /etc/dhcp/dhclient.conf
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
# few changes must be made to this file, if any.
#
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
domain-name, domain-name-servers, domain-search, host-name,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 127.0.0.1;
#require subnet-mask, domain-name-servers;
timeout 300;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;
#alias {
# interface "eth0";
# fixed-address 192.5.5.213;
# option subnet-mask 255.255.255.255;
#}
#lease {
# interface "eth0";
# fixed-address 192.33.137.200;
# medium "link0 link1";
# option host-name "andare.swiftmedia.com";
# option subnet-mask 255.255.255.0;
# option broadcast-address 192.33.137.255;
# option routers 192.33.137.250;
# option domain-name-servers 127.0.0.1;
# renew 2 2000/1/12 00:00:01;
# rebind 2 2000/1/12 00:00:01;
# expire 2 2000/1/12 00:00:01;
#}
편집 4:
어쩌면 내가 변경하지 않은 VPN 제공업체 앱일 수도 있습니다. 현재 VPN을 사용하고 있지 않기 때문에 내 Linux가 IPv6을 지원하는지 테스트하고 싶었습니다. resolv.conf의 이름 서버는 VPN 공급자인 Private Internet Access에 속합니다.
resolv.conf
업데이트되지 않는 이유를 찾으려고 노력 중입니다 .
$ lsattr /etc/resolv.conf
-------------e-- /etc/resolv.conf
편집 5:
$ sudo tcpdump -i eth0 udp port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
13:28:35.416720 IP 192.168.0.11.46858 > resolver1.privateinternetaccess.com.domain: 22927+ A? imap.gmail.com. (32)
13:28:35.416730 IP 192.168.0.11.46858 > resolver1.privateinternetaccess.com.domain: 8909+ AAAA? imap.gmail.com. (32)
13:28:35.416974 IP 192.168.0.11.39732 > resolver1.privateinternetaccess.com.domain: 35471+ PTR? 222.18.222.209.in-addr.arpa. (45)
13:28:35.436305 IP 192.168.0.11.52326 > resolver1.privateinternetaccess.com.domain: 65414+ A? live.mozillamessaging.com. (43)
13:28:35.436310 IP 192.168.0.11.52326 > resolver1.privateinternetaccess.com.domain: 30886+ AAAA? live.mozillamessaging.com. (43)
13:28:35.478049 IP 192.168.0.11.46175 > resolver1.privateinternetaccess.com.domain: 5292+ A? mx.endora.cz. (30)
13:28:35.478053 IP 192.168.0.11.46175 > resolver1.privateinternetaccess.com.domain: 16624+ AAAA? mx.endora.cz. (30)
13:28:35.815497 IP 192.168.0.11.50734 > resolver1.privateinternetaccess.com.domain: 17117+ A? clients1.google.com. (37)
13:28:35.815508 IP 192.168.0.11.50734 > resolver1.privateinternetaccess.com.domain: 34551+ AAAA? clients1.google.com. (37)
13:28:35.816481 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.46175: 5292 1/0/0 A 88.86.120.212 (46)
13:28:35.818739 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.46175: 16624 0/1/0 (86)
13:28:35.959874 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.50734: 17117 2/0/0 CNAME clients.l.google.com., A 172.217.12.142 (77)
13:28:35.959899 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.50734: 34551 2/0/0 CNAME clients.l.google.com., AAAA 2607:f8b0:4006:819::200e (89)
13:28:35.972396 IP 192.168.0.11.50409 > resolver1.privateinternetaccess.com.domain: 53313+ A? ocsp2.globalsign.com. (38)
13:28:35.972406 IP 192.168.0.11.50409 > resolver1.privateinternetaccess.com.domain: 62184+ AAAA? ocsp2.globalsign.com. (38)
13:28:36.145921 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.50409: 62184 3/0/0 CNAME cdn.globalsigncdn.com., AAAA 2400:cb00:2048:1::681f:4a7c, AAAA 2400:cb00:2048:1::681f:4b7c (126)
13:28:36.153394 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.50409: 53313 3/0/0 CNAME cdn.globalsigncdn.com., A 104.31.75.124, A 104.31.74.124 (102)
13:28:36.345446 IP 192.168.0.11.39036 > resolver1.privateinternetaccess.com.domain: 49155+ A? www.googleapis.com. (36)
13:28:36.345462 IP 192.168.0.11.39036 > resolver1.privateinternetaccess.com.domain: 10791+ AAAA? www.googleapis.com. (36)
13:28:36.483314 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.39036: 49155 13/0/0 CNAME googleapis.l.google.com., A 172.217.6.234, A 172.217.10.234, A 172.217.12.170, A 172.217.12.202, A 172.217.9.234, A 172.217.10.10, A 172.217.10.42, A 172.217.10.74, A 172.217.10.138, A 172.217.3.106, A 172.217.12.138, A 172.217.6.202 (262)
13:28:36.483344 IP resolver1.privateinternetaccess.com.domain > 192.168.0.11.39036: 10791 2/0/0 CNAME googleapis.l.google.com., AAAA 2607:f8b0:4006:812::200a (98)
^C
편집 6:
sudo dhclient -r
sudo dhclient -v eth0
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/d8:50:e6:05:e1:db
Sending on LPF/eth0/d8:50:e6:05:e1:db
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x3ede007c)
DHCPREQUEST of 192.168.0.11 on eth0 to 255.255.255.255 port 67 (xid=0x7c00de3e)
DHCPOFFER of 192.168.0.11 from 192.168.0.1
DHCPACK of 192.168.0.11 from 192.168.0.1
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
bound to 192.168.0.11 -- renewal in 2147483648 seconds.
편집 7:
$ sudo tcpdump -i eth0 -vvv -n port 68
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
14:30:18.135530 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from d8:50:e6:05:e1:db, length 300, xid 0x7a30842b, Flags [none] (0x0000)
Client-Ethernet-Address d8:50:e6:05:e1:db
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Request
Requested-IP Option 50, length 4: 192.168.0.11
Hostname Option 12, length 10: "vb-nb-mint"
Parameter-Request Option 55, length 18:
Subnet-Mask, BR, Time-Zone, Default-Gateway
Domain-Name, Domain-Name-Server, Option 119, Hostname
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
NTP, Classless-Static-Route, Classless-Static-Route-Microsoft, Static-Route
Option 252, NTP
END Option 255, length 0
PAD Option 0, length 0, occurs 18
14:30:18.136280 IP (tos 0x0, ttl 64, id 15220, offset 0, flags [none], proto UDP (17), length 576)
192.168.0.1.67 > 192.168.0.11.68: [udp sum ok] BOOTP/DHCP, Reply, length 548, xid 0x7a30842b, Flags [none] (0x0000)
Your-IP 192.168.0.11
Client-Ethernet-Address d8:50:e6:05:e1:db
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: ACK
Server-ID Option 54, length 4: 192.168.0.1
Lease-Time Option 51, length 4: 4294967295
Subnet-Mask Option 1, length 4: 255.255.255.0
Default-Gateway Option 3, length 4: 192.168.0.1
Domain-Name-Server Option 6, length 8: 8.8.8.8,10.255.255.10
END Option 255, length 0
PAD Option 0, length 0, occurs 270
^C
+
$ cat /run/resolvconf/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 10.255.255.10
nameserver 127.0.1.1
답변1
/etc/gai.conf에서 아래와 같이 IPv4보다 IPv6를 선호하는 줄을 주석 처리해야 합니다.
# precedence ::ffff:0:0/96 100
또한 /etc/dhclient/dhclient6.conf를 편집해야 하며 이것이 충분하지 않은 경우 -6 매개변수를 dhclient에 전달할 수 있습니다.
또한 resolv.conf 링크를 수정하는 것이 좋습니다.
또한 dhclient는 DHCP를 통과한 처음 두 개의 DNS 서버만 사용한다고 단언할 수도 있지만, 제가 틀렸을 수도 있습니다.
편집하다:
위의 단계는 정확합니다. 즉, 첫 번째 단계에서 다음 줄을 주석 처리합니다.
precedence ::ffff:0:0/96 100
다음 파일에서:
/etc/gai.conf
언급된 단계를 따르세요.마이크로소프트 문서에서Ubuntu 16.04 기반 Linux Mint 18.x의 경우:
다음 파일을 생성합니다:
/etc/dhcp/dhclient6.conf
콘텐츠:
timeout 10;
다음 파일을 생성합니다:
/etc/network/interfaces.d/50-cloud-init.cfg
콘텐츠:
iface eth0 inet6 auto up sleep 5 up dhclient -1 -6 -cf /etc/dhcp/dhclient6.conf -lf /var/lib/dhcp/dhclient6.eth0.leases -v eth0 || true
마지막으로 원래 링크를 덮어쓰면서 심볼릭 링크를 만듭니다
resolv.conf
.ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
재부팅하면 짜잔, DHCP의 IPv6이 작동합니다.
답변2
/etc/gai.conf 파일에 이 줄을 추가하고 주석을 달면 precedence 2001:470::/32 100
IPv4보다 IPv6에 우선순위를 부여 할 수 있습니다.precedence ::ffff:0:0/96 100