使用NAT-PT技术,IPV6跟IPV4通信不了的问题
本帖最后由 紫水晶 于 2012-4-16 15:55 编辑今天使用NAT-PT技术想实现IPV6与IPV4通信,结果通信不了,求高人解答。
Preparation
a.两台装了linux的PC,NAT-PTbuild在PC1上,PC1通过有线eth0连接PC2,通过无线eth1连上外网。PC2作为internal IPV6的host
b.从http://tomicki.net/naptd.download.php 下载了nat-pt的源代码
c.网络拓扑:
pc2(internal IPV6 network) -----------(eth0)pc1(NAT-PT)pc1-(eth1)----- internet IPV4 network(DNS)
install
a. install radvd on pc1
i: configure radvd
#ip a a 2000:ffff:181:f100::1 dev eth0 #ip r a 2000:ffff:181:f100::/64 dev eth0
#sysctl –w net.ipv6.conf.all.forwarding=1
#vi /etc/radvd.conf
Interface eth0
{
AdvSendAdvert on;
MinRtrAdvInterval 5;
MaxRtrAdvInterval 15;
Prefix 2000:ffff:181:f100::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};
b. install nat-pt
按照http://tomicki.net/ipv6.router.php 来设置nat-pt
Interface Name Local Address
eth0(IPv6) 2000:ffff:181:f100::1/64eth1(IPv4) 10.255.223.66
Configure net-pt:
Enter the name of the first inside (IPv6) interface that you want NAT-PT to
listen on.
interface (eth0 eth1): eth0 {return}
Enter the name of the first outside (IPv4) interface that you want NAT-PT to
listen on.
interface (eth0 eth1): eth1 {return}
Enter the IPv6 prefix that will be used as the destination for translations.
prefix : {return}
Please enter the IPv4 address of the DNS server you are currently using.
IPv4 DNS server: 93.183.16.7 {return}
Result
a. PC1 设置好radvd后,pc2能够拿到global 的ipv6
PC1 :
PC2:
B.PC2访问外网失败。
红色部分为我不确定的设置
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从PC2开始确认:
1.PC2上的IPv6路由表确认:netstat -rn -A inet6
2.PC2上测试访问外网的方式,例如ping或其他测试
3.是否使用dns-alg?可先直接手工使用某个固定ipv4地址进行测试,确保nat-pt流程能正常工作。
如PC2侧没有问题,DNS-ALG也没有问题,再从PC1上确认是否nat-pt的参数或其他网络设置问题:
4.PC1上确保IPv4网络可达,路由、DNS能顺利使用,IPv4网络路由正确。
5.从你PC1的ipv4地址来看,需要做二次nat才能访问外网(理论上没什么影响,但最好确认下),如内网有server或pc,先试试内网,再确认二次nat之后的Internet地址。 PC2访问外网失败是指浏览网页失败。 满天星 发表于 2012-4-16 16:13 static/image/common/back.gif
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从PC2开始确认:
1.PC2上的IPv6路由表确认:net ...
1.PC2 上使用nestat -rn -A inet6显示如下:
Kernal IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2000:ffff:181:f100::/64 :: UAe 256 0 0 eth0
fe80::/64 :: U 256 0 0 eth0
::/0 :: !n -1 1 63 lo
::1/128 :: Un 0 1 11 lo
2000:ffff:181:f100:214:22ff:fec0:898a/128 :: Un 0 1 45 lo
fe80::214:22ff:fec0:898a/128 :: Un 0 1 2 lo
ff00::/8 :: U 256 0 0 eth0
::/0 :: !n -1 1 63 lo 满天星 发表于 2012-4-16 16:13 static/image/common/back.gif
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从PC2开始确认:
1.PC2上的IPv6路由表确认:net ...
2.PC2 上ping不通网络也无法浏览网页 radvd的配置如下:
configure radvd
#ip a a 2000:ffff:181:f100::1 dev eth0
#ip r a 2000:ffff:181:f100::/64 dev eth0
#sysctl –w net.ipv6.conf.all.forwarding=1
#vi /etc/radvd.conf
Interface eth0
{
AdvSendAdvert on;
MinRtrAdvInterval 30;
MaxRtrAdvInterval 100;
Prefix 2000:ffff:181:f100::/64 {
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr off;
};
};
iptables和ip6tables都配置ok,且设置符合nat-pt的配置文档。
另外:PC2的默认路由::/0指向了lo接口,试试tcpdump或wireshark在pc1的eth0接口抓个radvd发出的ra报文看看结构
PS:可以加个capture filter:icmp6,只抓RS/RA/NS/NA等ICMPv6报文。
页:
[1]