【案例分享】丨小型企业如何从IPv4迁移至IPv6
学习目标· 掌握基本IPv6地址的配置方法· 掌握OSPFv3路由协议的配置方法· 掌握DHCPv6服务器功能的配置方法· 掌握IPv6 display命令的使用拓扑图图8.1 部署IPv6网络实验拓扑图场景目前企业网络还是IPv4网络但是随着技术的进步与更迭企业的网络需要从IPv4迁移至IPv6作为管理员的您首先需要在现有网络上进行IPv6网络的设计改造。在本实验中您需要部署有状态IPv6地址分配方案以及IPv6路由协议。操作步骤步骤一实验环境准备如果本任务中您使用的是空配置设备则从步骤1开始配置。如果使用的设备包含上一个实验的配置请直接从步骤2开始配置。huaweisystem-view [huawei]sysname R1 huaweisystem-view [huawei]sysname R2 huaweisystem-view [huawei]sysname R3步骤二配置IPv6地址在路由器的环回接口上配置IPv6全球单播地址在所有路由器的G0/0/0接口配置本地链路地址。[R1]ipv6 [R1]interfaceloopback 0 [R1-LoopBack0]ipv6 enable [R1-LoopBack0]ipv6 address 2001:1::A 64 [R1]interfaceGigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ipv6 enable [R1-GigabitEthernet0/0/0]ipv6 address fe80::1 link-local [R2]ipv6 [R2]interfaceloopback 0 [R2-LoopBack0]ipv6 enable [R2-LoopBack0]ipv6 address 2001:2::B 64 [R2]interfaceGigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ipv6 enable [R2-GigabitEthernet0/0/0]ipv6 address fe80::2 link-local [R3]ipv6 [R3]interfaceloopback 0 [R3-LoopBack0]ipv6 enable [R3-LoopBack0]ipv6 address 2001:3::C 64 [R3]interfaceGigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ipv6 enable [R3-GigabitEthernet0/0/0]ipv6 address fe80::3 link-local配置完成后查看IPv6接口信息。R1displayipv6 interface GigabitEthernet 0/0/0 GigabitEthernet0/0/0current state : UP IPv6protocol current state : UP IPv6is enabled, link-local address is FE80::1 Noglobal unicast address configured Joinedgroup address(es): FF02::1:FF00:1 FF02::2 FF02::1 MTUis 1500 bytes NDDAD is enabled, number of DAD attempts: 1 NDreachable time is 30000 milliseconds NDretransmit interval is 1000 milliseconds Hostsuse stateless autoconfig for addressesIPv6接口可以通过加入多个组播组如FF02::1和FF02::2来进行重复地址检测DAD证实本地链路地址是独一无二的以支持无状态地址自动配置SLAAC。步骤三配置OSPFv3在路由器上开启OSPFv3进程并指定R1、R2和R3的路由器ID。然后在接口下使能OSPFv3进程并指定所属区域。[R1]ospfv3 1 [R1-ospfv3-1]router-id 1.1.1.1 [R1-ospfv3-1]quit [R1]interfaceGigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ospfv3 1 area 0 [R1-GigabitEthernet0/0/0]quit [R1]interfaceloopback 0 [R1-LoopBack0]ospfv3 1 area 0 [R2]ospfv3 1 [R2-ospfv3-1]router-id 2.2.2.2 [R2-ospfv3-1]quit [R2]interfaceGigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ospfv3 1 area 0 [R2-GigabitEthernet0/0/0]quit [R2]interfaceloopback 0 [R2-LoopBack0]ospfv3 1 area 0 [R3]ospfv3 1 [R3-ospfv3-1]router-id 3.3.3.3 [R3-ospfv3-1]quit [R3]interfaceGigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ospfv3 1 area 0 [R3-GigabitEthernet0/0/0]quit [R3]interfaceloopback 0 [R3-LoopBack0]ospfv3 1 area 0在R1和R3上执行display ospfv3 peer命令查看OSPFv3的邻居关系。R1displayospfv3 peer OSPFv3Process (1) OSPFv3Area (0.0.0.0) NeighborID Pri State Dead Time Interface Instance ID 2.2.2.21 Full/Backup 00:00:30 GE0/0/0 0 3.3.3.31 Full/DROther 00:00:40 GE0/0/0 0 R3displayospfv3 peer OSPFv3Process (1) OSPFv3Area (0.0.0.0) NeighborID Pri State Dead Time Interface Instance ID 1.1.1.11 Full/DR 00:00:32 GE0/0/0 0 2.2.2.21 Full/Backup 00:00:38 GE0/0/0 0可以观察到邻居关系为Full其中如果1.1.1.1不是DR可以执行下面的命令重启OSPFv3进程。R1reset ospfv3 1 graceful-restart使用Ping ipv6检测对端本地链路地址和LoopBack 0接口的全球单播地址是否可达。R1pingipv6 fe80::3 -i GigabitEthernet 0/0/0 PINGfe80::3 : 56 data bytes, press CTRL_C to break Replyfrom FE80::3 bytes56 Sequence1 hop limit64 time 2 ms Replyfrom FE80::3 bytes56 Sequence2 hop limit64 time 2 ms Replyfrom FE80::3 bytes56 Sequence3 hop limit64 time 11 ms Replyfrom FE80::3 bytes56 Sequence4 hop limit64 time 2 ms Replyfrom FE80::3 bytes56 Sequence5 hop limit64 time 2 ms ---fe80::3 ping statistics --- 5packet(s) transmitted 5packet(s) received 0.00%packet loss round-tripmin/avg/max 2/3/11 ms R1pingipv6 2001:3::C PING2001:3::C : 56 data bytes, press CTRL_C to break Replyfrom 2001:3::C bytes56 Sequence1 hop limit64 time 11 ms Replyfrom 2001:3::C bytes56 Sequence2 hop limit64 time 6 ms Replyfrom 2001:3::C bytes56 Sequence3 hop limit64 time 2 ms Replyfrom 2001:3::C bytes56 Sequence4 hop limit64 time 2 ms Replyfrom 2001:3::C bytes56 Sequence5 hop limit64 time 6 ms ---2001:3::C ping statistics --- 5packet(s) transmitted 5packet(s) received 0.00%packet loss round-tripmin/avg/max 2/5/11 ms步骤四配置DHCPv6分配IPv6地址在R2上开启DHCPv6服务器功能为其它设备配置IPv6地址。然后创建IPv6地址池并指定地址池中IPv6地址的前缀和前缀长度再配置IPv6地址池中不参与自动分配的IPv6地址通常为网关地址以及DNS服务器的IPv6地址。[R2]dhcp enable [R2] dhcpv6 duid ll Warning: The DHCP unique identifier should be globally-unique and stable. Are you sure to change it? [Y/N]y [R2]dhcpv6 pool pool1 [R2-dhcpv6-pool-pool1]address prefix 2001:FACE::/64 [R2-dhcpv6-pool-pool1]dns-server 2001:444e:5300::1 [R2-dhcpv6-pool-pool1]excluded-address 2001:FACE::1 [R2-dhcpv6-pool-pool1]quit在G0/0/0接口配置IPv6地址为地址池中网关地址并配置DHCPv6服务器功能和指定的地址池名称。[R2]interfaceGigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ipv6 address 2001:FACE::164 [R2-GigabitEthernet0/0/0]dhcpv6 server pool1在R1和R3上配置DHCPv6客户端功能并在相应接口下配置通过DHCPv6自动获取IPv6地址功能。[R1]dhcp enable [R1] dhcpv6 duid ll Warning: The DHCP unique identifier should be globally-unique and stable. Are you sure to change it? [Y/N]y [R1]interface Gigabitethernet 0/0/0 [R1-GigabitEthernet0/0/0]ipv6 address auto dhcp [R3]dhcp enable [R3] dhcpv6 duid ll Warning: The DHCP unique identifier should be globally-uniqueand stable. Are you sure tochange it? [Y/N]y [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ipv6 address auto dhcp在R2上执行displaydhcpv6 pool命令查看DHCPv6地址池的信息。 R2displaydhcpv6 pool DHCPv6pool: pool1 Addressprefix: 2001:FACE::/64 Lifetimevalid 172800 seconds, preferred 86400 seconds 2in use, 0 conflicts Excluded-address2001:FACE::1 1excluded addresses Informationrefresh time: 86400 DNSserver address: 2001:444E:5300::1 Conflict-addressexpire-time: 172800 Activenormal clients: 2 在R1和R3上执行displayipv6 interface brief命令查看通过DHCPv6获取的IPv6地址。 [R1]displayipv6 interface brief *down: administratively down (l): loopback (s): spoofing InterfacePhysical Protocol GigabitEthernet0/0/0up up [IPv6Address] 2001:FACE::2 LoopBack0up up(s) [IPv6Address] 2001:1::A [R3]displayipv6 interface brief *down: administratively down (l): loopback (s): spoofing InterfacePhysical Protocol GigabitEthernet0/0/0up up [IPv6Address] 2001:FACE::3 LoopBack0up up(s) [IPv6Address] 2001:3::C配置文件R1display current-configuration R2display current-configuration R3display current-configuration