IPV6协议

 IPV6的配置

一、接口配置IPV6的单播地址

     1、link-local

(1)

           R1(config)#interface fastEthernet 0/0

           R1(config-if)#ipv6 enable

  (2)手工或自动配置一个IPV6的AGUA,均会生成一个link-local地址;但无论配置多少个AGUA地址,也只能生产一个link-local地址。

 

   2、手工或自动配置接口ipv6的AGUA地址

  (1)手工

            R1(config)#interface serial 1/1

            R1(config-if)#ipv6 address 2002::2/64

或者

            R1(config-if)#interface serial 1/1

            R1(config-if)#ipv6 address 2009::/64 eui-64

   (2)自动配置

            Auto-config        DHCPV6

切记:IPV6协议存在多宿主特征----可以在一个接口上同时配置多个ip地址来标示该接口;

      但注意该接口可以配置多个相同或不同网段的地址;但同一路由器上不同的接口不能

配置相同网段的ip地址;

二、IPV6ACL

可以配置N张表,但一台设备上一个需求点只能调用一张表;从上往下逐一匹配,若上条匹配中就按上条执行,不再查看下条;没有标准列表,只有扩展列表,且写法也只有命名写法;由于仅使用扩展列表,故放置的位置尽量靠近源,但不能在源上,因为不能限制自身的产生的流量。

R2(config)#ipv6 access-list ccie

R2(config-ipv6-acl)#deny tcp host 12::1 host 12::2 eq 23   //拒绝一个host对另一个主机的telnet

R2(config-ipv6-acl)#deny IPV6 12::/64 12::/64  //拒绝一段地址到另一地址的所有通信

R2(config-ipv6-acl)#permit ipv6 any any   //允许所有

注:在IPV6 ACL中不使用反掩码,直接使用掩码;

R2(config-ipv6-acl)#iinterface serail1/1

R2(config-if)#ipv6 traffic-filter ccie in 接口调用时注意方向

在IPV6下的ACL

开头隐含

R2(config-ipv6-acl)#permit icmp any any nd-na

R2(config-ipv6-acl)#permit icmp any any nd-ns

默认隐含

R2(config-ipv6-acl)#deny ipv6 any any

 

三、IV6的单播路由协议

在使用路由协议前一定需要开启IPV6的单播路由功能,否则不转发IPV6的流量

1、IPV6静态路由协议

(1)普通静态路由

R1(config)#ipv6 route 2::/64    serial 1/1

R1(config)#ipv6 route 2::/64    12::2 

                  目标网络号   出接口或下一跳

MA网络建议下一跳,点到点网络建议出接口

 (2)浮动静态路由--修改默认管理距离

R1(config)#ipv6 route 3::/64 12::2 ?

  <1-254>  Administrative distance

  <cr>

 (3)空接口防环

R2(config)#ipv6 route 2::/63 null 0     //在更新源路由器上,空接口指向汇总地址;

  (4)缺省路由

R2(config)#ipv6 route ::/0 12::1

注:带源ping 时,只能使用接口;或者使用扩展追踪;

R3#ping 2::2 source loopback 0

注:由于IPV6存在多宿主,使用接口为源时,默认使用第一地址来访问,建议扩展追踪

R3#traceroute

Protocol [ip]: ipv6

Target IPv6 address: 2::2

Source address: 3::3

四、RIPNG

使用同RIPV2一样的算法;组播更新地址FF02::9  基于UDP 521传播

R1(config)#ipv6 unicast-routing      //开启单播路由功能

R1(config)#ipv6 router rip ?       //启动协议时需配置进程号,进程号仅具有本地意义

  WORD  User selected string identifying this process

R1(config)#ipv6 router rip a

宣告的含义:1、激活接口 2.路由

R1(config)#interface serail1/1

R1(config-if)#ipv6 rip a enable

R1(config-if)#exit

R1(config)#interface loopback 0

R1(config-if)#ipv6 rip a enable

注:IPV6下到所有接口上进行配置

 

手工汇总:更新源路由器上所有更新发出的接口上进行配置

R1(config)#interface serail1/1

R1(config-if)#ipv6 rip a summary-address 1::/63

 

缺省路由:在边界路由器上所有同内网相连的接口上配置,使其向内网所有邻居发出一条缺省信息

R1(config)#interface serail1/1

R1(config-if)#ipv6 rip a default-information ?

  only       Advertise only the default route

  originate  Originate the default route

选择only将发出缺省路由,同时其他的路由不会被转发;选择originate 缺省和明细均发送。

 

五、OSPF V3  

在原有OSPFV2的基础上,使用新的LSA来专门携带V6的信息;区域规则,SPF算法同IPV4下完全一致。

R1(config)#ipv6 unicast-routing

R1(config)#ipv6 router ospf 1    //启动时需要配置进程号

R1(config-rtr)#              

R1(config-rtr)#router-id 1.1.1.1    //RID依然使用IPV4地址,规则同OSPF V2一致

宣告:1、激活接口  2、传递路由 3、区域划分

R1(config)#interface loopback 0

R1(config-if)#ipv6 ospf 1 area 0

R1(config-if)#interface serail1/1

R1(config-if)#ipv6 ospf 1 area 0

R1(config-if)#interface loopback1

R1(config-if)#ipv6 ospf 1 area 0

配置完成后生成邻居表,MA网络存在DR/BDR选举,选举规则同OSPFV2一致;另各个邻居间状态也一致。

R1#show ipv6 ospf neighbor 邻居表

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface

2.2.2.2               1   FULL/  -        00:00:30             3            Serial1/1

 

R2#show ipv6 ospf database       //数据库表

R1#show ipv6 route                   //路由表

IPv6 Routing Table - 13 entries

Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP

       U - Per-user Static route

       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary

       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

缺省路由配置:在边界路由器上配置

R3(config)#ipv6 router ospf 1

R3(config-rtr)#default-information originate ?     

  always       Always advertise default route        //强制发出

  metric       OSPF default metric                         //修改起始度量

  metric-type  OSPF metric type for default routes         //修改度量类型,默认2

  route-map    Route-map reference                 //关联route-map

  <cr>

 

六、BGPV4+ 

在BGPV4的基础上配置IPV6关系

R2(config)#router b 2

R2(config-router)#b router-id 2.2.2.2

R2(config-router)#neighbor 12::1 remote-as 1

R2(config-router)#neighbor 3::3 remote-as 3

R2(config-router)#neighbor 3::3 update-source loopback 0                  

R2(config-router)#neighbor 3::3 ebgp-multihop

此时邻居间仅存在V4下的邻居关系,没有V6关系;不能传递V6路由

故需要在已经建立的V4邻居关系基础上再来建立V6的邻居关系,传递V6的信息

注:BGP V4+使用家族模式来配置IPV6的信息,原理为在原有BGPV4的协议中开发出的扩展配置模式;

R1(config-router)#address-family ipv6    //进入IPV6家族模式

R1(config-router-af)#neighbor 12::2 activate   //和该邻居建立IPV6的邻居关系

注:关于IPV6建邻以后所有配置必须全部在家族模式中进行。

 

R1# show bgp ipv6 summary    //查看BGP的邻居关系

BGP router identifier 1.1.1.1, local AS number 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12::2                4     2      15                 16        2          0    0     00:00:28        0

R1(config)#router b 1

R1(config-router)#address-family ipv6

R1(config-router-af)#network 1::/64     //宣告路由

查看IPV6的BGP表

R1#show bgp ipv6

BGP table version is 2, local router ID is 1.1.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

              r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete

 

   Network          Next Hop            Metric LocPrf Weight Path

    *> 1::/64              ::                        0                  32768 i

IPV6下的其他配置:

R2(config)#router bgp 2

R2(config-router)#address-family ipv6

R2(config-router-af)#neighbor 3::3 next-hop-self

R2(config-router-af)#neighbor 3::3 route-reflector-client

R2(config-router-af)#neighbor 3::3 route-map ccie out

 

七、IPV4和IPV6共存

1、普通tunnel

R1(config)#interface tunnel 0

R1(config-if)#ipv6 address 10::1/64     //该tunnel接口必须工作于V6环境

R1(config-if)#tunnel source 12.1.1.1

R1(config-if)#tunnel destination 23.1.1.2 

R1(config-if)#tunnel mode ipv6ip   //必须修改模式为ipv6ip

注:普通的tunnel需要基于所有的ipv6网络配置一条隧道,且均需再配置一条静态路由;

 

2、6to4tunnel

仅需配置一条隧道,一条静态即可访问所有IPV6网络;将边界路由器的公网IPV4地址换算为IPV4兼容性地址,然后将该地址应用到内网;再配置一条到兼容性地址的静态路由,通过隧道传递;传输数据时,一旦路由到达隧道口,隧道将根据目标IPV6地址计算对应的IPV4地址。

优点:1、不需要指定tunnel 目标   2、一条静态路由即可

12.1.1.1 兼容性地址:2002:C01:101::/48

23.1.1.2 兼容性地址:2002:1701:102::/48

注:该地址在使用时,一般将其划分为64位;

配置

R1(config)#interface loopback 0

R1(config-if)#ipv6 address 2002:c01:101::1/64

R1(config-if)#exit

R1(config)#interface tunnel 0

首先需要配置隧道接口的IPV6地址----4种方法

R1(config-if)#ipv6 address 2002:c01:101:1::1/64         //使用一个6TO4地址

R1(config-if)#ipv6 address 2002:c01:101:2::/64 eui-64   //使用6to4地址

R1(config-if)#ipv6 enable     //相当于不配地址

R1(config-if)#ipv6 unnumbered loopback 0   // 借内网某个IPv6接口的地址

 

R1(config-if)#tunnel source s1/1      //定义IPV6源地址所在接口

R1(config-if)#tunnel mode ipv6ip 6to4     //模式标记

R1(config)#ipv6 route 2002::/16 tunnel 0

 

3、双栈

一台设备同时连接IPV4/IPV6网络,若目标IP为V6地址使用V6的源IP,通过V6的路由表传递;V4同理;当进行DNS查询时,优先查询V6网络中的DNS 服务器。

发布了43 篇原创文章 · 获赞 50 · 访问量 7971

猜你喜欢

转载自blog.csdn.net/weixin_43997530/article/details/90710436