IPV6—6to4 experiment

Experimental requirements

insert image description here

Experimental procedure

1. IP Planning

Because the title does not specify a specific IP plan, for the convenience of routing summary, I plan the address as follows.

公网部分
23.1.1.0 24
34.1.1.0 24
3.3.3.3  24

IPV4/V6部分
IPV4部分
192.168.1.0 25 两个环回
192.168.0.0 30 骨干链路
192.168.2.1 24 AR的环回
IPV6部分
因为题目要求使用6to4tunnel,所以通过ipv4地址换算生成。
23.1.1.1 化成16进制为
0001 0111 0000 0001 0000 0001 0000 0001 
1701:0101 最后填上2002和前缀生成ipv6地址
2002:1701:0101::/48162002:1701:0101:0000::64——2002:1701:0101:FFFF::64
因为环回有两个所以再借一位分配给环回
2002:1701:0101:0000:0000 0000 0000 0000::/65
2002:1701:0101:1000:0000 0000 0000 0000::/65
化简后为
2002:1701:101::/65
2002:1701:101:0:8000::/65

右边IPV6部分
通过IPV4地址34.1.1.2 进行换算
2002:2201:0102::/48
借一位
2002:2201:0102::/49 AS1
再借162002:2201:0102::/64——2002:2201:0102:7FFF::/64

2002:2201:0102:8000::/49 AS2
再借162002:2201:0102:8000::/64——2002:2201:0102:FFFF::/64

After planning, the topology is shown in the figure
insert image description here

2. Configure the public network part

First of all, it is necessary to realize the reachability of the entire public network.
Take AR2 as an example

[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 255.255.255.0 
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.0.2 30
[r2]int lo0
[r2-LoopBack0]ip address 192.168.2.1 255.255.255.0 

Use ospf protocol to achieve network reachability, take AR3 as an example

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0

test connectivity
insert image description here

3. Configure the IPV4/V6 part

IPV4 part

[r1]int lo0
[r1-LoopBack0]ip address 192.168.1.1 25
[r1]int lo1
[r1-LoopBack0]ip address 192.168.1.129 25

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.0.1 30

Use rip protocol to achieve network reachability

[r1]rip 1
[r1-rip-1]undo summary
[r1-rip-1] version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.0.0

summary route

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip summary-address 192.168.1.0 255.255.255.0

Set up empty interface anti-loop

[r1]ip route-static 192.168.1.0 24 NULL 0

Send a default message to AR1 on AR2

[r2]rip 1
[r2-rip-1]default-route originate 

Use ACL to enable AR1 to access the Internet normally

[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.0.0 0.0.255.255
[r2-acl-basic-2000]int g0/0/0
[r2-GigabitEthernet0/0/1]nat outbound 2000

test connectivity
insert image description here

IPV6 part

[r1]ipv6 
[r1]int lo0
[r1-LoopBack0]ipv6 enable 
[r1-LoopBack0]ipv6 address 2002:1701:101::1 65

[r1-LoopBack0]int lo1
[r1-LoopBack1]ipv6 enable 
[r1-LoopBack1]ipv6 address 2002:1701:101:0:8000::1 65

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ipv6 enable 
[r1-GigabitEthernet0/0/0]ipv6 address 2002:1701:0101:1::1 64

Use RIPNG to achieve network reachability

[r1]ripng 1
[r1-ripng-1]int lo0
[r1-LoopBack0]ripng 1 enable 
[r1-LoopBack0]int lo1
[r1-LoopBack1]ripng 1 enable 
[r1-LoopBack1]int g0/0/0
[r1-GigabitEthernet0/0/0]ripng 1 enable 

display ipv6 routing-table protocol ripngAfter the configuration, you can view the
insert image description here
summary route through the command

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip	
[r1-GigabitEthernet0/0/0]ripng summary-address 2002:1701:101:: 64

Set up empty interface anti-loop

[r1]ip route-static 2002:1701:0101:0000::64 NULL 0

A default message is sent on AR2 to AR1.
When using ipv6 to send a default message, it is configured on the interface of the border router connected to the internal network.

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ripng default-route only

Configure 6to4tunnel

[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ipv6 enable 
[r2-Tunnel0/0/0]ipv6 address 2002:1701:0101:3::1 64
[r2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4 
[r2-Tunnel0/0/0]source 23.1.1.1
注:配置tunnel时需注意使用转换ipv6地址的ipv4地址

[r2]ipv6 route-static 2002:: 16 Tunnel 0/0/0
设置出口

4. Configure the IPV6 section

Configure the base part
in AS1

[r4]ipv6 
[r4]int lo0
[r4-LoopBack0]ipv6 address 2002:2201:0102::1 64
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ipv6 enable 
[r4-GigabitEthernet0/0/1]ipv6 address 2002:2201:0102:1::1 64

Take AR5 as an example in AS2

[r5]ipv6 
[r5]int lo0
[r5-LoopBack0]ipv6 address 2002:2201:102:8000::1
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ipv6 enable 
[r5-GigabitEthernet0/0/0]ipv6 address 2002:2201:102:1::2
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ipv6 enable 
[r5-GigabitEthernet0/0/1]ipv6 address 2002:2201:102:8001::1

OSPFv3 section

Use ospfv3 to achieve full network reachability of AS2
Taking AR5 as an example

[r5]ospfv3 1	
[r5-ospfv3-1]router-id 5.5.5.5
[r5-ospfv3-1]int lo0
[r5-LoopBack0]ospfv3 1 area 0
[r5-LoopBack0]int g0/0/1
[r5-GigabitEthernet0/0/1]ospfv3 1 area 0

After configuring all routers, you can display ospfv3 peerview the neighbor relationship through the command
insert image description here

BGP section

Configure EBGP neighbor relationship between AR4 and AR5

[r4]bgp 1 
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 2002:2201:102:1::2 as-number 2
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]peer 2002:2201:102:1::2 enable 

[r5]bgp 64512
[r5-bgp]router-id 5.5.5.5
[r5-bgp]confederation id 2
[r5-bgp]peer 2002:2201:102:1::1 as-number 1
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]peer 2002:2201:102:1::1 enable 

When configuring the bgp neighbors of the AR5-AR8 routers, since loopbacks are required to establish neighbors, but their loopback addresses are complex, for the convenience of future management, we can use private addresses as loopback addresses to establish neighbors.

[r5]int lo0
[r5-LoopBack0]ipv6 address 5::5 64
[r6]int lo0
[r6-LoopBack0]ipv6 address 6::6 64
[r7]int lo0
[r7-LoopBack0]ipv6 address 7::7 64
[r8]int lo0
[r8-LoopBack0]ipv6 address 8::8 64

Establishing an IBGP Neighborhood
Using AR5 and AR7 as an Example

[r5]bgp 64512
[r5-bgp]peer 6::6 as-number 64512
[r5-bgp]peer 6::6 connect-interface LoopBack 0 5::5
注:若不在环回接口后不添加建邻的环回地址会以默认第一个环回地址建立邻居
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]peer 6::6 enable

[r7]bgp 64512
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation id 2
[r7-bgp]confederation peer-as 64513
[r7-bgp]peer 6::6 as-number 64512
[r7-bgp]peer 6::6 connect-interface LoopBack 0 7::7
[r7-bgp]peer 8::8 as-number 64513
[r7-bgp]peer 8::8 connect-interface LoopBack 0 7::7
[r7-bgp]peer 8::8 ebgp-max-hop 2
[r7-bgp]ipv6-family 
[r7-bgp-af-ipv6]peer 6::6 enable 
[r7-bgp-af-ipv6]peer 8::8 enable 

Achieve full network reachability between AS1 and AS2, and optimize

[r4]bgp 1
注:在ipv6中,bgp宣告一定要在ipv6家族模式中宣告
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]network 2002:: 16

Summarize routes for AS2

[r5]ipv6 route-static 2002:2201:0102:8000:: 49 NULL 0
[r5]bgp 64512
注:在ipv6中,bgp宣告一定要在ipv6家族模式中宣告
[r5-bgp]ipv6-family 
[r5-bgp-af-ipv6]network 2002:2201:0102:8000:: 49

[r5]bgp 64512
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]peer 6::6 next-hop-local 
修改下一跳

[r6]bgp 64512
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer 7::7 reflect-client 
设置反射器

Configure 6to4tunnel

[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]ipv6 enable 
[r4-Tunnel0/0/0]ipv6 address 2002:2201:0101:2::1 64
[r4-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4 
[r4-Tunnel0/0/0]source 34.1.1.2
注:配置tunnel时需注意使用转换ipv6地址的ipv4地址

[r4]ipv6 route-static 2002:: 16 Tunnel 0/0/0

test connectivity

Using loopback in AR1pingAS2
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/m0_46467017/article/details/122920017