IPv6 router guide/ko
This guide provides details on setting up IPv6 routing on a Gentoo Linux system.
준비
기본 커널 설정
젠투에 있는 임의의 2.6 버전대 커널 트리에는 IPv6 연결을 손쉽게 지원합니다. 새 USAGI IPv6 스택을 리눅스 커널 버전 2.6.0부터 통합했습니다.
root #
emerge --ask sys-kernel/gentoo-sources
'"`UNIQ--pre-00000001-QINU`"'
Emerge
root #
emerge --ask sys-apps/iproute2
root #
emerge --ask net-misc/radvd
계속 진행하기 전 make.conf의 USE 변수에 ipv6
플래그를 추가했는지 확인하셔서 앞으로 이머지할 꾸러미에 IPv6 기능을 추가할 수 있도록 하십시오.
Additional software
IPv6를 따로 다루는 꾸러미가 몇가지 있긴 합니다. 이들 대부분은 /usr/portage/net-misc에 있습니다.
Package | Description |
---|---|
net-misc/radvd | Router advertisement daemon |
net-misc/dhcpd | ISC DHCP server, DHCPv4 and DHCPv6 capability |
net-misc/dibbler | DHCPv6 server |
net-misc/ipv6calc | Converts an IPv6 address to a compressed format |
dev-perl/Socket6 | IPv6 related part of the C socket.h defines and structure manipulators |
Confirming IPv6 status
IPv6rk 동작한다면, 루프백 장치에서 IPv6 주소를 보여줘야 합니다:
root #
ip -6 addr show lo
1: lo: <LOOPBACK,UP> mtu 16436 inet6 ::1/128 scope host valid_lft forever preferred_lft forever ## (The above lines show things are working)
IPv6 라우터
Obtaining an address and prefix
dhcpcd can be used to obtain a single, host only, /128 IPv6 address for the WAN interface, and a /64 IPv6 prefix for the LAN interface.
/etc/dhcpcd.conf
Request a IPv6 prefix for eth0.lan and eth0.management to be routed publicly with eth0.wan.# Disable router solicitations for all interfaces, enable only for selected ones
noipv6rs
# Interface configuration for the wan vlan on the eth0 interface
interface eth0.wan
# Enable router solicitation for this interface
ipv6rs
# Request a normal address usins iaid 1 for interface eth0.wan
ia_na 1
# Request a prefix using iaid 2 and assign it to the eth0.lan interface using sla_id 0 and prefix size of 64
ia_pd 2 eth0.lan/0/64
Dhcpcd
rfc6177 is barely seen as a recommendation by residential ISPs, Prefix Delegation may not work.
라우팅 설정
IPv6를 통해 클라이언트 머신이 외부 망에 연결할 라우터로 사용하려 한다면 설정을 더 진행해야합니다. IPv6 패킷 전달을 활성화해야합니다. 아래와 같은 방식으로 진행할 수 있습니다.
root #
sysctl -w net.ipv6.conf.all.forwarding=1
radvd 초기화 스크립트는 다음 절에서 포워딩을 활성화하는 방법으로 설명하므로, 다음 단계 진행은 필요치 않습니다.
IPv6 주소를 클라이언트에 할당할 때, IPv6 명세에 따르면, 무상태 기반과 상태 기반 두가지 방식의 IP 할당을 허용합니다. 무상태 기반 할당은 라우터 알림 과정을 거치며 클라이언트에서 IP를 얻고 인터페으스를 띄우는 방식만으로 기본 라우터 정보를 가져올 수 있습니다. IP 할당 기록을 하지 않고, 할당할 IP를 제공하므로 "무상태 기반"이라고 합니다. 상태 기반 할당은 DHCPv6에서 처리합니다. "상태 기반"이라고 하는 이유는 IP를 요청한 클라이언트의 상태를 서버에서 유지하며 해당 정보를 받기 때문입니다.
The IPv6 Stateless Address Autoconfiguration configures IP routing and connectivity, the DHCPv6 is required to assign IPv6 addresses, and provide information such as DNS servers.
무상태 기반 설정
라우터 알림 데몬 또는 radvd를 사용하면 무상태 기반 설정을 쉽게 처리할 수 있습니다.
radvd를 이머지하고나면, 어떤 IP 블록에서 IP를 할당할지에 대한 정보가 들어있는 /etc/radvd/radvd.conf 설정 파일을 만들어야합니다. 자체 터널 브로커에서 할당한 프리픽스를 넣은 radvd.conf 파일 예제를 보여드리도록 하겠습니다.
interface eth1
{
## (Send advertisement messages to other hosts)
AdvSendAdvert on;
## (Fragmentation is bad(tm))
AdvLinkMTU 1280;
MaxRtrAdvInterval 300;
## (IPv6 subnet prefix we've been assigned by our PoP)
prefix 2001:470:1F00:296::/64
{
AdvOnLink on;
AdvAutonomous on;
};
};
첫번째 줄의 인터페이스를 올바르게 설정하여 라우터 알림이 ISP가 아닌 내부 네트워크로 동작하는지 확인하십시오!
Further information is available in man radvd.conf.
상태 기반 설정
Dibbler project is concluded.
상태 기반으로 설정하려면 net-misc/dibbler 꾸러미를 설치하고 설정해야합니다.
root #
emerge --ask dibbler
이제 /etc/dibbler/client.conf 파일을 편집하여 dibbler 클라이언트를 설정해야합니다.
iface ppp0 {
rapid-commit yes
pd
option dns-server
}
이제 dibbler 클라이언트를 시작할 수 있고 부팅할 때 시작하도록 설정할 수 있습니다.
root #
/etc/init.d/dibbler-client start
root #
rc-update add dibbler-client default
Service
OpenRC
To start radvd and start it on boot:
root #
/etc/init.d/radvd start
root #
rc-update add radvd default
DNS 설정
IPv6과 DNS
IPv4 DNS는 A 레코드를 활용하지만 IPv6 DNS는 AAAA 레코드를 활용합니다(IPv4는 2^32 개 주소공간을 활용하지만 IPv6는 2^128개 주소공간을 활용하기 대문입니다). 역방향 DNS를 활용할때는 INT 표준이 낡긴 했지만 여전히 널리 지원합니다 APRA는 최종 표준입니다. APRA 형식은 여기에 설명해드리겠습니다.
연결 시험
최근 BIND 버전에서는 최상의 IPv6 기능을 갖추고 있습니다. 이 장을 살펴보려면 BIND 설정 및 활용에 대한 최소한의 지식을 갖추고 있어야합니다. 루트를 전환한 상황에서 bind를 실행하지 않는다고 가정하겠습니다. 만약 이 가정이 잘못됐다면, 다음 장의 대부분의 내용에서 나타나듯 각 경로에 앞 부분을 추가하십시오.
우선 /etc/bind/named.conf에 있는 순방향, 역방향 DNS 존 파일에 항목을 추가하십시오.
/etc/bind/named.conf
named.conf 항목## (We allow bind to listen to IPv6 addresses.
## Using 'any' is the only way to do it prior to bind-9.3)
options {
[...]
listen-on-v6 { any; }
[...]
};
## (This will provide the forward DNS for the domain 'ipv6-rules.com':)
zone "ipv6-rules.com" IN {
type master;
file "pri/ipv6-rules.com";
};
## (This format for reverse DNS is "bitwise." It's done by taking the IPv6 prefix,
## reversing the order of the numbers and putting a period between each number)
zone "6.9.2.0.0.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa" {
type master;
file "pri/rev-ipv6-rules.com.arpa";
};
이제 zone 파일을 만들고 모든 호스트 정보를 추가해야합니다:
/etc/bind/pri/ipv6-rules.com
$TTL 2h
@ IN SOA ipv6-rules.com. webmaster.ipv6-rules.com. (
2003052501 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
NS ns1.ipv6-rules.com
IN AAAA 2001:470:1f00:296::1 ; address for ipv6-rules.com
host1 IN AAAA 2001:470:1f00:296::2 ; address for host1.ipv6-rules.com
host2 IN AAAA 2001:470:1f00:296::3:3 ; address for host2.ipv6-rules.com
/etc/bind/pri/ipv6-rules.com.arpa
$TTL 3d ; Default TTL (bind 8 needs this, bind 9 ignores it)
@ IN SOA ipv6-rules.com. webmaster.ipv6-rules.com. (
2003052501 ; Serial number (YYYYMMdd)
24h ; Refresh time
30m ; Retry time
2d ; Expire time
3d ) ; Default TTL
IN NS ns1.ipv6-rules.com.
; IPv6 PTR entries
$ORIGIN 6.9.2.0.0.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa.
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR ipv6-rules.com.
2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR host1.ipv6-rules.com.
3.0.0.0.3.0.0.0.0.0.0.0.0.0.0.0 IN PTR host2.ipv6-rules.com.
DJBDNS 설정
IPv6 이름 서비스를 가능케하는 DJBDNS의 서드파티 패치가 현재 http://www.fefe.de/dns/에 있습니다. USE 변수에 ipv6
값을 설정하면, DJBDNS에서 이 패치를 끌어와서 함께 설치할 수 있습니다.
이 패치에서는 모든 레코드 형식을 지원하지 않습니다. 일부분에서는, NS 레코드와 MX 레코드를 지원하지 않습니다.
root #
emerge --ask djbdns
djbdns를 설치하고 나면 tinydns-setup을 실행하고 어떤 IP 주소를 바인딩할지 어디에 tinydns를 설치할지 등에 대한 몇가지 질문에 답하여 설치할 수 있습니다.
root #
tinydns-setup
/var/tinydns에 tinydns를 설치했다면, /var/tinydns/root/data를 편집할 수 있습니다. 이 파일에는 tinydns가 IPv6 기능을 대신 수행하는 DNS 서비스를 다룰 때 필요한 모든 데이터가 들어있습니다.
## (*.ipv6-rules.com is authoritatively handled by 192.168.0.1)
.ipv6-rules.com:192.168.0.1:a:259200
## (Authoritative reverse DNS for 2001:470:1f00:296::/64)
.6.9.2.0.0.0.f.1.0.7.4.0.1.0.0.2.ip6.arpa:192.168.0.1:a
## (Specify the IPs for host1 and host2)
6host1.ipv6-rules.com:200104701f0002960000000000000001:86400
6host2.ipv6-rules.com:200104701f0002960000000000000002:86400
## (Point www to host1)
3www.ipv6-rules.com:200104701f0002960000000000000002:86400
6
이 앞에 붙어있는 줄은 AAAA와 PTR 레코드가 붙어있어야합니다. 3
이 앞에 붙어있는 줄에는 AAAA 레코드만 만들어져있습니다. data 파일을 직접 편집할 때, add-host6와 add-alias6 스크립트를 활용하여 새 항목을 추가할 수 있습니다. data 파일 편집이 끝나면 간단하게 /var/tinydns/root에서 make 명령을 실행하십시오. 이 명령을 실행하면 DNS 요청시 tinydns에서 정보를 가져올 /var/tinydns/root/data.cfb 파일을 만듭니다.
IPv6 클라이언트
radvd 사용하기
이 라우터 안에 있는 클라이언트는 IPv6로 다른 네트워크에도 연결할 수 있어야합니다. radvd를 사용한다면 인터페이스를 띄우는 방법만큼 호스트 설정이 쉽습니다(아마도 거의 net.ethX 초기화 스크립트로 끝냈을겁니다).
root #
ip link set eth0 up
root #
ip addr show eth0
1: eth0: <BROADCAST,MULTICAST,UP> mtu 1400 qdisc pfifo_fast qlen 1000 link/ether 00:01:03:2f:27:89 brd ff:ff:ff:ff:ff:ff inet6 2001:470:1f00:296:209:6bff:fe06:b7b4/128 scope global valid_lft forever preferred_lft forever inet6 fe80::209:6bff:fe06:b7b4/64 scope link valid_lft forever preferred_lft forever inet6 ff02::1/128 scope global valid_lft forever preferred_lft forever
IPv6 방화벽에서 ICMPv6 패킷을 허용하지 않도록 해야 합니다:
root #
ip6tables -A INPUT -p icmpv6 -j ACCEPT
Troubleshooting
Package is missing IPv6 support
Packages will typically emerge with the ipv6
USE flag, but if IPv6 is not working on a specific program, checking that it is built with that is a good first step.
There is no issue adding
USE="ipv6"
to /etc/portage/make.conf, but this is often unnecessary.일부 꾸러미는 IPv6 지원 기능을 자동으로 (잘못) 발견하므로 굳이 ipv6 USE 플래그를 설정하지 않아도 됩니다. 따라서 IPv6를 지원해야 하는 일부 꾸러미에서는, 커널에서 IPv6 지원을 활성화 한 상태로 컴파일하지 않았다면 자체적으로 IPv6를 지원하도록 합니다
See Also
- IPv6 — the most recent version of the Internet Protocol (IP)
- IPv6 tunnels
외부 자료
IPv6 내용을 다루는 훌륭한 자료는 온라인에 많이 있습니다.
- www.ipv6.org - 일반 IPv6 정보
- www.linux-ipv6.org/ - USAGI 프로젝트
- www.deepspace6.net - Linux/IPv6 사이트
- www.kame.net - *BSD 구현체
IRC에서 프리노드의 #ipv6 (webchat) 대화방에 들어가보실 수 있습니다. 또한 irc.ipv6.freenode.net 서버를 이용하시면 IPv6로 프리노드 서버에 접속하실 수 있습니다.
This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Peter Johanson, Jorge Paulo, Camille Huot, Pasi Valminen, , Markos Chandras (Hwoarang)
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.