本文以实例介绍CISCO路由器IPV6的相关配置。
拓扑如图:设备全部需要支持IPv6
IPV6基本配置
R1配置
hostname R1
ipv6 unicast-routing
//开启IPv6支持
interface GigabitEthernet0/0
ipv6 address 2001::1/64
//接口配置地址
ipv6 route ::/0 2001::2
//配置默认路由
R2 配置
hostname R2
ipv6 unicast-routing
interface GigabitEthernet0/0
ipv6 address 2001::2/64
interface GigabitEthernet0/1
ipv6 address 2002::2/64
R3 配置
hostname R3
ipv6 unicast-routing
interface GigabitEthernet0/1
ipv6 address 2002::3/64
ipv6 route ::/0 2002::2
配置完成后查看
接口下自动生成链路本地地址
IPv6路由表中的静态默认路由和直连路由
PING测试R3正常
OSPF V3 (IPv6的OSPF)快速配置
各台路由器配置环回口,并宣告进OSPFV3,全网互通。
R1
ipv6 router ospf 110
router-id 1.1.1.1
//配置OSPFv3,手动配置RID
interface Loopback0
ipv6 address 2010::1/128
ipv6 ospf 110 area 0
//配置Loo0地址,宣告进OSPFV3
interface GigabitEthernet0/0
ipv6 address 2001::1/64
ipv6 ospf 110 area 0
ipv6 ospf network point-to-point
////配置几口地址,宣告进OSPFV3,接口类型修改为p2p加快收敛
R2
ipv6 router ospf 110
router-id 2.2.2.2
interface Loopback0
ipv6 address 2011::1/128
ipv6 ospf 110 area 0
interface GigabitEthernet0/0
ipv6 address 2001::2/64
ipv6 ospf 110 area 0
ipv6 ospf network point-to-point
interface GigabitEthernet0/1
ipv6 address 2002::2/64
ipv6 ospf 110 area 0
R3配置
ipv6 router ospf 110
router-id 3.3.3.3
interface Loopback0
ipv6 address 2012::1/128
ipv6 ospf 110 area 0
interface GigabitEthernet0/1
ipv6 address 2002::3/64
ipv6 ospf 110 area 0
配置完成后,检查路由器OSPFV3邻居
查看OSPFV3路由表
查看系统路由表,链路本地地址不会加表,路由的下一跳是对端接口的链路本地地址。
全网互通正常。
IPV6 Eigrp的快速配置
R1
ipv6 router eigrp 90
eigrp router-id 1.1.1.1
//配置IPV6 Eigrp,手工配置RID
interface Loopback0
ipv6 address 2010::1/128
ipv6 eigrp 90
interface GigabitEthernet0/0
ipv6 address 2001::1/64
ipv6 eigrp 90
//配置接口IPV6地址,宣告进Eigrp
R2
ipv6 router eigrp 90
eigrp router-id 2.2.2.2
interface Loopback0
ipv6 address 2011::1/128
ipv6 eigrp 90
interface GigabitEthernet0/0
ipv6 address 2001::2/64
ipv6 eigrp 90
ipv6 ospf network point-to-point
interface GigabitEthernet0/1
ipv6 address 2002::2/64
ipv6 eigrp 90
R3
ipv6 router eigrp 90
eigrp router-id 3.3.3.3
interface Loopback0
ipv6 address 2012::1/128
ipv6 eigrp 90
interface GigabitEthernet0/1
ipv6 address 2002::3/64
ipv6 eigrp 90
配置完成后检查Eigrp邻居表 拓扑表 路由表
PING测全网互通正常
IPV6穿越IPV4快速配置
拓扑中三台设备组成传统IPV4网络,R1 R3各配置一个IPv6d Loo0口模拟IPv6末节网络,两LO口穿越IPv4互通。
R1配置
hostname R1
interface Loopback0
ipv6 address 2001::1/128
interface GigabitEthernet0/0
ip address 12.0.0.1 255.255.255.0
router eigrp 90
network 12.0.0.0
//配置基础接口IP,Eigrp协议互通
interface Tunnel0
ipv6 address 2010::1/64
tunnel source 12.0.0.1
tunnel mode ipv6ip
tunnel destination 23.0.0.2
//配置GRE tunnel接口,接口源目IPV4地址,IPv6地址,模式ipv6穿越ipv4
ipv6 route ::/0 Tunnel0
//配置ipv6默认路由下一跳出口为Tunnel口
R2配置
hostname R2
interface GigabitEthernet0/0
ip address 12.0.0.2 255.255.255.0
interface GigabitEthernet0/1
ip address 23.0.0.1 255.255.255.0
router eigrp 90
network 12.0.0.0
network 23.0.0.0
R3配置
hostname R3
interface Loopback0
ipv6 address 2002::1/128
interface Tunnel0
ipv6 address 2010::2/64
tunnel source 23.0.0.2
tunnel mode ipv6ip
tunnel destination 12.0.0.1
interface GigabitEthernet0/1
ip address 23.0.0.2 255.255.255.0
router eigrp 90
network 23.0.0.0
ipv6 route ::/0 Tunnel0
配置完成后检查R1路由表
测试两Loo0口IPv6地址互通正常。