IPv6 static routing for data communication networks

Articles and resources are archived to the public account [AIShareLab] and can be obtained through the reply communication system and network .

First, the purpose

  1. Master the basic IPv6 configuration of the router.
  2. Master the basic configuration of static IPv6 routing.
  3. Understand the routing process of IPv6 data packets.

2. Topology

As shown in Figure 1, three routers R1, R2 and R3 are connected through corresponding physical interfaces. Among them, R1 and
R3 are each connected to a network segment. For simplicity, only two computers PC1 in these network segments are shown here. and PC2, PC1 and PC2 use R1 and R3 as their default gateways respectively. Among them, routers R1, R2 and R3 are recommended to use AR2220 and above devices.

Insert image description here

Figure 1 IPv6 static routing basic experimental topology diagram

3. Demand

  1. Complete the configuration on R1, R2 and R3 so that the three routers can communicate with each other.
  2. Complete the configuration on R1, R2 and R3 so that the network segments where PC1 and PC2 are located can communicate with each other.

4. Steps

(1) Complete the basic configuration of R1, R2 and R3
. Complete the following configuration on R1. The configuration result is shown in Figure 2:

<Huawei> system-view
[Huawei] sysname R1 
[R1] ipv6 
[R1] interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0] ipv6 enable 
[R1-GigabitEthernet0/0/0] ipv6 address fc00:12::1 64
[R1-GigabitEthernet0/0/0] quit 

Insert image description here

Figure 2 Basic IPv6 configuration of R1
② Complete the following configuration on R2. The configuration results are shown in Figure 3:

<Huawei> system-view
[Huawei] sysname R2
[R2] ipv6 
[R2] interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0] ipv6 enable 
[R2-GigabitEthernet0/0/0] ipv6 address fc00:12::2 64
[R2-GigabitEthernet0/0/0] quit 
[R2] interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/1] ipv6 enable 
[R2-GigabitEthernet0/0/1] ipv6 address fc00:23::2 64
[R2-GigabitEthernet0/0/1] quit 

Insert image description here

Figure 3 Basic IPv6 configuration of R2

③ Complete the following configuration on R3. The configuration result is shown in Figure 4:

<Huawei> system-view
[Huawei] sysname R3
[R3] ipv6 
[R3] interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0] ipv6 enable 
[R3-GigabitEthernet0/0/0] ipv6 address fc00:23::3 64
[R3-GigabitEthernet0/0/0] quit 

Insert image description here
Figure 4 Basic IPv6 configuration of R2

(2) Complete the configuration on R1, R2 and R3 so that these three routers can communicate with each other.

Phased verification:
⑴ Ping R2 GE0/0/0 on R1. The specific command format is ping ipv6 the IPv6 address of the corresponding interface to verify whether R1 can successfully communicate with R2.
Insert image description here

Figure 5 R1 and R2 communicate successfully.
As can be seen from Figure 5, verification shows that R1 and R2 communicate successfully.
⑵ Ping R3 GE0/0/0 on R2. The specific command format is ping the IPv6 address of the corresponding interface to verify whether R2 can successfully communicate with R3.

Insert image description here

Figure 6 R2 and R3 communicate successfully.
As can be seen from Figure 6, verification shows that R2 and R3 communicate successfully.
⑶ Ping R3 GE0/0/0 on R1. The specific command format is ping ipv6 the IPv6 address of the corresponding interface to verify whether R1 can successfully communicate with R3.

Insert image description here

Figure 7 R1 and R3 cannot communicate.
From Figure 7, it can be seen that R1 and R3 cannot communicate.
⑷ Execute the display ipv6 routing-table command in the R1 system view to view the current routing table and display the corresponding results. Verify whether the routing table of R1 currently contains the static route to the R3 GE0/0/0 interface.

Insert image description here

Figure 8 R1 routing table
From Figure 8, it can be verified that the routing table of R1 currently does not contain a static route to the R3 GE0/0/0 interface.

Note: It can be found from the phased verification results that after the above configuration is completed, R1 and R2, R2 and R3 can communicate with each other. Take R1 and R2 as an example. There is a direct link between the devices. For R1, when we configure the IPv6 address of the GE0/0/0 interface on the device, the device will automatically generate the IPv6 address in its routing table. The directly connected route of the network segment where the interface is located, so it can reach R2 directly through the directly connected route without manual intervention in routing information. On the contrary, R1 cannot communicate with R3 at this time. This phenomenon occurs because there is no routing information in the routing table of R1 to reach the R3 GE0/0/0 interface (IPv6 address is FC00:23::3). .

① Configure the route to FC00:23::/64 for R1:
[R1] ipv6 route-static FC00:23::64 FC00:12::2
Note: The ipv6 route-static command is used to configure IPv6 static on Huawei routers. Routing, the common command format is ipv6 route-static dest-ipv6-address prefix-length nexthop-ipv6-address, where the parameter dest-ipv6-address is used to specify the destination IPv6 address, and the parameter prefix-length is used to specify the length of the IPv6 prefix. , the parameter nexthop-ipv6-address is used to specify the next hop IPv6 address of the device.

Phased verification:
⑴ Execute the display ipv6 routing-table command in the R1 system view, view the current routing table and display the corresponding results, and verify whether the routing table of R1 currently contains the static route to the R3 GE0/0/0 interface.

Insert image description here

Figure 9 R1 routing table
From Figure 9, it can be verified that the routing table of R1 contains a static route to the R3 GE0/0/0 interface, and the route to FC00:23::/64 has been successfully added.

⑵ Ping R3 GE0/0/0 on R1. The specific command format is ping ipv6 the IPv6 address of the corresponding interface to verify whether R1 can
successfully communicate with R3.

Insert image description here

Figure 10 R1 cannot communicate with R3.
From Figure 10, it can be verified that R1 still cannot communicate with R3.
Note: From the phased verification results, it can be found that the route to FC00:23::/64 has been successfully added to the routing table of R1.
However, R1 still cannot ping R3. This is because the data interaction process triggered by an application is often bidirectional.
At this time, the request message sent by R1 to R3 can reach the next hop R2, and R2 can forward the message to
R3 according to the direct route, but R3 At this time, there is no routing information reaching R1 GE0/0/0 interface (IPv6 address is FC00:12::1), so the
response packet from R1 pinging R3 cannot reach R1.

②Add route on R3:
[R3] ipv6 route-static FC00:12:: 64 FC00:23::2

Phased verification:
Ping R3 GE0/0/0 on R1. The specific command format is ping the IPv6 address of the corresponding interface to verify that R1 can
successfully communicate with R3.

Insert image description here

Figure 11 R1 and R3 successfully communicate
. Figure 11 can verify that R1 and R3 communicate successfully.

(3) Complete the configuration on R1, R2, R3, PC1 and PC2 so that the network segments where PC1 and PC2 are located can communicate with each other. Next,
we add a new network segment under R1 and R3 respectively to connect user terminal devices. And enable these
user terminal devices to communicate with each other.

① R1 adds the following configuration:

[R1] interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1] ipv6 enable
[R1-GigabitEthernet0/0/1] ipv6 address FC00:1::FFFF 64
[R1-GigabitEthernet0/0/1] quit

Insert image description here

Figure 12 New configuration of R1

② R3 adds the following configuration:

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

Insert image description here

Figure 13 New configuration of R3
③ Staticly configure the IPv6 address, prefix length and gateway information of PC1. The specific parameters are shown in Figure 14.
Insert image description here

Figure 13 IPv6 static address configuration of PC1

④ Staticly configure the IPv6 address, prefix length and gateway information of PC2. The specific parameters are shown in Figure 14.

Insert image description here

Figure 14 IPv6 static address configuration of PC2
⑤ Right-click on the Ethernet0/0/1 interface of PC1 and start packet capture, trying to capture the incoming and outgoing packets on the Ethernet0/0/1 interface of PC1.

Phased verification:
⑴ Ping PC2 on PC1, the specific command format is ping the IPv6 address of PC2 -6 (Note: When
testing the connectivity with the IPv6 destination address through the ping command, the command format on the computer and network device is slightly different. This The parameter "-6"
indicates forced use of IPv6), verify whether PC1 can successfully communicate with PC2.

Insert image description here

Figure 15 PC2 and PC1 cannot communicate normally
(2) In the Wireshark interface, check the information captured after turning on the packet capture earlier, and verify
whether PC1 can receive the corresponding ICMPv6 Echo Reply message after sending out the ICMPv6 Echo Request message, and Do the test results match?

Insert image description here

Figure 16 PC2 and PC1 cannot communicate normally.
As can be seen from Figure 16, PC1 currently cannot receive the corresponding ICMPv6 Echo Reply message after sending an ICMPv6 Echo Request message. Note:
From the phased verification results, it can be found that when PC1 pings PC2, PC1 sends The source IPv6 address of the ICMPv6 Echo Request
message is PC1's address FC00:1::1, and the destination address is PC2's address FC00:2::1. The message is sent
from PC1 to its default gateway FC00:1 ::FFFF, that is, R1. However, R1 does not have a route to the destination network segment
, so the packet is discarded.

⑥ In order for PC1 and PC2 to communicate with each other, the following conditions need to be met:
let R1 know how to reach the FC00:2::/64 network segment;
let R2 know how to reach FC00:1::/64 and FC00:2::/64 Network segment;
let R3 know how to reach the FC00:1::/64 network segment.
Therefore, add the following configuration on R1:
[R1] ipv6 route-static FC00:2:: 64 FC00:12::2
Add the following configuration on R2:
[R2] ipv6 route-static FC00:1:: 64 FC00:12::1
[R2] ipv6 route-static FC00:2:: 64 FC00:23::3

Add the following configuration on R3:
[R3] ipv6 route-static FC00:1:: 64 FC00:23: :2

(4) Connectivity test
: Ping PC2 on PC1. The specific command format is ping the IPv6 address of PC2 -6 to verify whether PC1 can
successfully communicate with PC2.

Insert image description here

Figure 17 Successful communication between PC2 and PC1
(5) Packet capture analysis
① Start packet capture. In this experiment, you can continue to capture packets on the Ethernet0/0/1 interface of PC1. During this period, various phased
test commands and status updates between devices will trigger the generation and interaction of multiple data packets. In addition, you can also stop packet capture after preliminary phase
packet capture analysis and restart packet capture here.
②Run the command.
Execute the following commands on PC1 in sequence: ping fc00:2::1 -6; tracert fc00:2::1 -6 to complete the
connectivity test with PC2 and complete the tracking of routing information to PC2.

Insert image description here

Figure 18 PC1 executes commands in sequence

Insert image description here

Figure 19 PC1 capture results

Note: It is worth noting that there are usually three ways to detect the intermediate routers that a data packet passes from the source to the destination, namely: route detection based on record routing options, route detection based on UDP protocol, and route detection based on UDP protocol. Route detection for ICMP Echo Request. Among them, the route detection method based on the record routing option is reflected in the process of displaying intermediate routes with the command "ping -r destination node address", and the route detection method based on UDP protocol and ICMP Echo Request is reflected in the process of displaying data with the command "Tracert" The process of the path that the packet takes to reach the destination host.

As shown in Figure 5, the Tracert command is initiated by the PC as an example. The implementation principle and process of Tracert are as follows (note that the network topology based on IPv4 is used in Figure 20. The principle is similar in the network based on IPv6, and the ICMP protocol is correspondingly changed to ICMPv6. ):

⑴When the PC initiates the Tracert command, it uses the local IP address as the source and the router address as the destination address to encapsulate the ICMPEcho Request message. The ICMP message sent first has TTL=1. After the switch receives it, it decrements the TTL by 1. At this time, TTL=0, the switch discards the packet and sends back a Time Exceeded packet, with the source address being the switch's address. After the PC receives the message, it knows its next hop address.
⑵PC sends Echo Request message again, TTL=2. After receiving the packet, the switch decrements the TTL by 1 and forwards it to the firewall. Reduce the firewall by 1 and TTL=0. The firewall discards the packet and sends back a Time Exceeded packet. The source address is the address of the firewall and the payload is the Echo Request packet sent by the PC. After the PC receives the message, it knows the address of the second hop.
⑶PC repeats this process until the Echo Request message reaches the real destination address. At this time, the router sends back an EchoReply message to the PC.

In summary, Tracert uses three ICMP messages: Echo Reply, Echo Request and Time Exceeded.

It should be noted that the above working process is only applicable to Tracert under Windows system. The corresponding tool in UNIX-like operating systems is Traceroute. Traceroute uses UDP packets to detect the destination address by default (for specific principles and examples, please refer to the packet capture analysis section of the second unit software experiment handout), and deliberately selects the destination port between 33434~33534 (usually 33434 is used for the first detection, and 33434 is used for the second detection). Use 33435, and so on). Because these ports do not exist, the target host will send back a port unreachable message (Port Unreachable) after receiving the message. The processing methods of many network devices are similar to UNIX-like operating systems, such as Huawei firewalls and switch products, which initiate detection using UDP packets. The Traceroute command of some UNIX-like operating systems also provides parameter options, and ICMP Echo Request or other protocol messages can be used to initiate detection.

Insert image description here

Figure 20 Example of the working principle of Tracert based on ICMP Echo request
③Analyze the message.
Ⅰ Analyze ping messages
In the Wireshark interface, check the multiple pairs of ICMPv6 Echo Request and Echo Reply messages captured when PC1 pings PC2 (that is, execute the corresponding command ping fc00:2::1 -6), indicating that the current PC1 and PC2 Already connected.
Answer the following questions:
a. How many ICMPv6 Echo Request and Echo Reply messages appear here? Are the results consistent with the results displayed by the test command?
Answer: As shown in Figure 21, 5 ICMPv6 Echo Request and Echo Reply messages appear here, which is consistent with the results displayed by the test command.

Insert image description here

Figure 21 PC1 message capture results

b. Check the Echo Request message. What are the ICMPv6 type and code number values?
What are the source and destination addresses of the IPv6 datagram containing this message ? What are the source and destination addresses of the Ethernet frame containing this message?
Answer: As shown in Figure 22, check the Echo Request message. The ICMPv6 type is Echo (ping) request (128) and the code number value is 0. The source address of the IPv6 datagram containing the message is fc00:1: :1 , the destination address is fc00:2:1, the source address of the Ethernet frame containing this message is HuaweiTe_49: 04:d1 (54:89:98:49:04:d1) and the destination address is HuaweiTe_0d: 72:e0 (00 :e0:fc:0d: 72:e0).

Insert image description here

Figure 22 Echo Request message related information

c. Check the Echo Reply message. What are the ICMPv6 type and code numbers?
What are the source and destination addresses of the IPv6 datagram containing this message ? What are the source and destination addresses of the Ethernet frame containing this message?
Answer: As shown in Figure 23, check the Echo Request message. The ICMPv6 type is Echo (ping) reply (129) and the code number is 0. The source address of the IPv6 datagram containing the message is fc00:2: :1 , the destination address is fc00:1:1, the source address of the Ethernet frame containing this message is HuaweiTe_0d: 72:e0 (00:e0:fc:0d: 72:e0) and the destination address is HuaweiTe_49: 04:d1 (54 :89:98:49:04:d1).

Insert image description here

Figure 22 Echo Reply message related information

Ⅱ Analyze Tracert messages
In the Wireshark interface, view the
multiple ICMPv6 Echo Request, ICMPv6 Echo Reply and ICMPv6 Time Exceeded messages captured when PC1 tracert PC2 (that is, execute the corresponding command tracert fc00:2::1 -6).
As shown in Figure 23.

Insert image description here

Figure 23 Captured Tracert message
Based on the actual captured data, answer the following questions: a. How many ICMPv6 Echo Request, ICMPv6 Echo Reply and ICMPv6 Time Exceeded
appear in the actual capture result ?
Are the results consistent with the results displayed by the test command?
Answer: As shown in Figure 24, there are 12 ICMPv6 Echo Request and 3 Echo Reply messages, and 9 ICMPv6 Time Exceeded messages, which are consistent with the results displayed by the test command.

Insert image description here

Figure 24 Captured Tracert message

b. Select an ICMPv6 Echo Request message and check, what are the ICMPv6 type and code number values? What are the source and destination addresses of the IPv6 datagram containing this message? What are the source and destination addresses of the Ethernet frame containing this message? Compare all ICMPv6 Echo Request messages. In different IPv6 datagrams containing these messages, are the Next Header and Hop Limit values ​​the same?

Answer: As shown in Figure 25, check the Echo Request message. The ICMPv6 type is Echo (ping) request (128) and the code number value is 0. The source address of the IPv6 datagram containing the message is fc00:1: :1 , the destination address is fc00:2:1, the source address of the Ethernet frame containing this message is HuaweiTe_49: 04:d1 (54:89:98:49:04:d1) and the destination address is HuaweiTe_0d: 72:e0 (00 :e0:fc:0d: 72:e0). Compare all ICMPv6 Echo Request messages. In different IPv6 datagrams containing these messages, the Next Header is the same, but the Hop Limit value is different.

Insert image description here

Figure 25 Echo Request message related information

c. Select an ICMPv6 Time Exceeded message and view it. What are the values ​​of the ICMPv6 type and code number? Compare and view all ICMPv6 Time Exceeded messages. What are the source addresses and destination addresses in different IPv6 datagrams containing these messages? Are they the same?
Answer: As shown in Figure 26, select an ICMPv6 Time Exceeded message and view it. The ICMPv6 type is Time Exceeded (3) and the code number value is 0 (hop limit exceeded in transit). Compare and view all ICMPv6 Time Exceeded messages. In the different IPv6 datagrams containing these messages, the source address fc00:23::3 and the destination address fc00:1::1, the source address fc:1::ffff and the destination address fc00:1::1, the source address fc00 :12: The source address of :2 and the destination address fc00:1::1 are different, but the destination address is the same.

Insert image description here

Figure 26 Time Exceeded message related information

d. Select an ICMPv6 Echo Reply message and check, what are the ICMPv6 type and code number values? What are the source and destination addresses of the IPv6 datagram containing this message? What are the source and destination addresses of the Ethernet frame containing this message? Compare and view all ICMPv6 Echo Reply messages. In the different IPv6 datagrams containing these messages, what are the Next Header and Hop Limit values? Are they the same?
Answer: As shown in Figure 27, check the Echo Request message. The ICMPv6 type is Echo (ping) reply (129) and the code number is 0. The source address of the IPv6 datagram containing the message is fc00:2: :1 , the destination address is fc00:1:1, the source address of the Ethernet frame containing this message is HuaweiTe_0d: 72:e0 (00:e0:fc:0d: 72:e0) and the destination address is HuaweiTe_49: 04:d1 (54 :89:98:49:04:d1). Compare all ICMPv6 Echo Reply messages. In the different IPv6 datagrams containing these messages, Next Header: ICMPv6 (58), and Hop Limit value is 252, which is the same.

Insert image description here
Figure 27 Echo Reply message related information

おすすめ

転載: blog.csdn.net/m0_52316372/article/details/132774475