找回密码
 注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 10138|回复: 6

使用NAT-PT技术,IPV6跟IPV4通信不了的问题

[复制链接]
紫水晶 发表于 2012-4-16 15:46:07 | 显示全部楼层 |阅读模式
本帖最后由 紫水晶 于 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 [2000:ffff::]: {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访问外网失败。

红色部分为我不确定的设置

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
满天星 发表于 2012-4-16 16:13:04 | 显示全部楼层
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从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地址。
回复

使用道具 举报

 楼主| 紫水晶 发表于 2012-4-16 16:18:36 | 显示全部楼层
PC2访问外网失败是指浏览网页失败。
回复

使用道具 举报

 楼主| 紫水晶 发表于 2012-4-17 11:12:56 | 显示全部楼层
满天星 发表于 2012-4-16 16:13
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从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-17 11:27:02 | 显示全部楼层
满天星 发表于 2012-4-16 16:13
请补充一些访问外网失败的具体流程吧,以及一些思路说明:
先从PC2开始确认:
1.PC2上的IPv6路由表确认:net ...

2.PC2 上ping不通网络也无法浏览网页
回复

使用道具 举报

 楼主| 紫水晶 发表于 2012-4-17 11:29:59 | 显示全部楼层
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;
                        };
                    };
回复

使用道具 举报

满天星 发表于 2012-4-17 11:39:48 | 显示全部楼层
iptables和ip6tables都配置ok,且设置符合nat-pt的配置文档。
另外:PC2的默认路由::/0指向了lo接口,试试tcpdump或wireshark在pc1的eth0接口抓个radvd发出的ra报文看看结构
PS:可以加个capture filter:icmp6,只抓RS/RA/NS/NA等ICMPv6报文。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|IPv6BBS ( 京ICP备13024693号 | 京公网安备11010802012238 )

GMT+8, 2024-3-29 21:49 , Processed in 0.020445 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表