-
Notifications
You must be signed in to change notification settings - Fork 12
/
Install_guide
91 lines (63 loc) · 3.09 KB
/
Install_guide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Build a NAPT66 Router with GNU/Linux
This guide will help you build a NAPT66 router quickly if you have complete knowledge on IPv4 NAT and IPv6.
1. First, we have to modify the Linux kernel codes.
Since kernel team don't think NAPT66 is a good idea, they have made some limitations on IPv6. That is, an IPv6 device couldn't be a router and a host meanwhile.
The simplest way to cancel this limitation is deleting two lines in 'net/ipv6/ip6_output.c' and rebuilding the kernel.
/* if (net->ipv6.devconf_all->forwarding == 0)*/
/* goto error;*/
2. Build the NAPT66 module and install it.
Download the codes from SourceForge.net or our site napt66.buptcs.cn.
# make
# insmod napt66.ko wan_if=eth0
The 'eth0' is an interface connecting the external IPv6 network (e.g. provided by an ISP). Next, set an IPv6 address 'fc00:0101:0101::1' (just like '192.168.1.1' in IPv4) on 'eth1', the interface connecting the internal IPv6 network.
The device can do NAPT66 now but we have to manually edit the IPv6 connection on each host. Actually Radvd and Dnsmasq can help us do that.
3. Install Radvd.
IPv6 has involved two schemes to automatically configure hosts: the stateful one DHCPv6, and the stateless one Router Advertisement. Since the stateless one is more compatible, we had better turn to Radvd.
To cooperate the modification of Linux kernel, we have to modify the codes of Radvd too. Delete four lines in 'radvd-1.6/radvd.c'.
int
check_ip6_forwarding(void)
{
......
// if (value != 1) {
// flog(LOG_DEBUG, "IPv6 forwarding setting is: %u, should be 1", value);
// return(-1);
// }
......
}
Then build, install and configure Radvd. You can take this as a reference.
#/etc/radvd.conf
interface eth1
{
AdvSendAdvert on;
MinRtrAdvInterval 5;
MaxRtrAdvInterval 10;
#以下两个参数就是以前提到的M和O标记,作用是通知内网计算机网络的地址配置方式
AdvManagedFlag off;
AdvOtherConfigFlag off;
AdvDefaultPreference high;
#前缀信息
prefix fc00:0101:0101::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
};
#DNS信息
RDNSS fc00:0101:0101::1
{
AdvRDNSSPreference 15;
AdvRDNSSOpen on;
};
};
4. Install Dnsmasq.
Dnsmasq is a DNS forwarder for NAT firewalls. You have to Install Dnsmasq since we have define DNS server as 'fc00:0101:0101::1' in 'radvd.conf'. The newest version (maybe dndnsmasq-2.56test18 and later) supports IPv6 well. Build and install Dnsmasq now.
In addition, an advanced usage of Dnsmasq can help us redefine the records of domains.
For example, Dnsmasq will return a specific AAAA record but forward the A record query to the external DNS server due to the configuration below.
#/etc/dnsmasq.conf
address=/www.youtube.com/2404:6800:8005::65
server=/www.youtube.com/#
If your NAPT6 router still doesn't work, contact me please.
If you have no time to configure NAPT66, you can use a firmware provided by us. The firmware is NAPT66-ready for Broadcom BCM63xx device (e.g. Shanghai Bell RG100A). Download it from SourceForge.net.
Weilin Xu <mzweilin at gmail.com>
Beijing Univ. of Posts & Telecom.
Feb 23, 2011