IPv6路由(学习日记)

Posted 人间忽晚,山河以秋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IPv6路由(学习日记)相关的知识,希望对你有一定的参考价值。

一、IPV6静态路由的配置

  • 在下面拓扑图的网络中使用IPV6时实现主机间的通信

  • 拓扑图

  • 配置过程
    PC1主机的配置

    PC2主机的配置

    路由器R1的配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]ipv6
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ipv6 enable
[R1-GigabitEthernet0/0/2]ipv6 address 2002::1/64
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
Info: Please enable IPv6 function in system view. 
[R1-GigabitEthernet0/0/1]ipv6 address 2001::1/64
Info: Please enable IPv6 function in system view. 
[R1-GigabitEthernet0/0/1]quit
[R1]ipv6 route-static 2003:: 64 2001::2

路由器R2的配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]ipv6
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
Info: Please enable IPv6 function in system view. 
[R2-GigabitEthernet0/0/1]ipv6 address 2001::2/64
Info: Please enable IPv6 function in system view. 
[R2-GigabitEthernet0/0/1]quit
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ipv6 enable 
Info: Please enable IPv6 function in system view. 
[R2-GigabitEthernet0/0/2]ipv6 address 2003::1/64
Info: Please enable IPv6 function in system view. 
[R2-GigabitEthernet0/0/2]quit
[R2]ipv6 route-static 2002:: 64 2001::1
  • 验证是否实现了主机间的通信
    PC1pingPC2

    PC2pingPC1

二、IPv6默认路由的配置

  • 在IPv6网络中,当路由器的出口仅有一个接口时,可以使用ipv6默认路由代替静态路由。

  • 拓扑图

  • 配置过程
    路由器R1的配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]ipv6
	
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
[R1-GigabitEthernet0/0/1]ipv6 address 2001::2/64
[R1-GigabitEthernet0/0/1]quit
	
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ipv6 enable
[R1-GigabitEthernet0/0/2]ipv6 address 2002::2/64
[R1-GigabitEthernet0/0/2]quit
[R1]
[R1]ipv6 route-static 2004:: 64 2002::1
[R1]ipv6 route-static 2003:: 64 2001::1
[R1]

路由器R2的配置

<Huawei>sys	
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]ipv6

[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ipv6 enable
[R2-GigabitEthernet0/0/2]ipv6 address 2003::1/64
[R2-GigabitEthernet0/0/2]quit
	
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
[R2-GigabitEthernet0/0/1]ipv6 address 2001::1/64
[R2-GigabitEthernet0/0/1]quit
[R2]ipv6 route-static :: 0 2001::2
[R2]

路由器R3的配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]ipv6

[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ipv6 enable
[R3-GigabitEthernet0/0/1]ipv6 address 2002::1/64
[R3-GigabitEthernet0/0/1]quit

[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ipv6 enable
[R3-GigabitEthernet0/0/2]ipv6 address 2004::1/64
[R3-GigabitEthernet0/0/2]quit
[R3]ipv6 route-static :: 0 2002::2

验证连通性

三、IPv6汇总路由器的配置

  • 在IPv6网络中,当多条路由的下一跳IP地址相同,且存在相同的前缀是,可以对路由进行汇总。
  • 拓扑图

  • 配置思路
    (1)创建VLAN并将相应接口划入VLAN
    (2)在交换机和路由器上启用IPv6功能
    (3)配置IPv6地址
    (4)配置IPv6汇总路由
  • 配置过程
    在交换机SW1上分别创建VLAN 10、VLAN 20、VLAN 30、VLAN 100,并将接口分别划入各VLAN,
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1

[SW1]vlan batch 100 10 20 30
Info: This operation may take a few seconds. Please wait for a moment...done.
	
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 100
[SW1-GigabitEthernet0/0/1]quit
	
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 10
[SW1-GigabitEthernet0/0/2]quit

[SW1]interface GigabitEthernet 0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 20
[SW1-GigabitEthernet0/0/3]quit

[SW1]interface GigabitEthernet 0/0/4
[SW1-GigabitEthernet0/0/4]port link-type access
[SW1-GigabitEthernet0/0/4]port default vlan 30
[SW1-GigabitEthernet0/0/4]quit

在交换机上启用IPv6,并且为每个VLAN配置IPv6地址

[SW1]ipv6
	
[SW1]int Vlanif 10
[SW1-Vlanif10]ipv6 enable
[SW1-Vlanif10]ipv6 address 2001:0:10::1/64
[SW1-Vlanif10]quit

[SW1]int Vlanif 20
[SW1-Vlanif20]ipv6 enable
[SW1-Vlanif20]ipv6 address 2001:0:20::1/64
[SW1-Vlanif20]quit

[SW1]int Vlanif 30
[SW1-Vlanif30]ipv6 enable
[SW1-Vlanif30]ipv6 address 2001:0:30::1/64
[SW1-Vlanif30]quit
	
[SW1]interface Vlanif 100
[SW1-Vlanif100]ipv6 enable
[SW1-Vlanif100]ipv6 address 2001::1/64
[SW1-Vlanif100]quit

配置路由器R1启用IPv6功能和接口地址

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]ipv6
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
[R1-GigabitEthernet0/0/1]ipv6 address 2001::2/64
[R1-GigabitEthernet0/0/1]

在交换机上配置默认路由,下一跳指向2001::2

[SW1]ipv6 route-static :: 0 2001::2

在路由器配置汇总后的静态路由,下一跳指向2001::1

[R1]ipv6 route-static 2001:: 32 2001::1
  • 查验
    查看R1的IPv6路由表信息

    测试连通性

以上是关于IPv6路由(学习日记)的主要内容,如果未能解决你的问题,请参考以下文章

IPv6路由(学习日记)

YESLAB 华为数通学霸日记 | IPv6配置实验

vue学习日记:vue路由搭建

学习ipv6基础学习笔记

学习ipv6基础学习笔记

学习ipv6基础学习笔记