IP地址规划:
* 2002::/16-----------6to4 tunnel 专用地址
1.80.154.7
1----0000 00001----01
80---0101 00000----50
144--1001 00000----90
167--1010 01001----a7
2002:0150:9a07:0000:0000:0000:0000:0000/48 可简写为 2002:150:9a07::/48
2002:150:9a07::/49 2002:150:9a07:8000:/49
2002:150:9a07::/49
2002:150:9a07:1::/64 R1-R2
2002:150:9a07:2::/64 tunel
2002:150:9a07:8000::/49
2002:150:9a07:8001::/65 R1环回1
2002:150:9a07:8002::/65 R1环回2
61.134.1.4
61---0011 1100----3d
134--1000 0110----86
1----0000 0001----01
4----0000 0100----04
2002:3d86:0104:0000:0000:0000:0000:0000/48 可简写为 2002:3d86:104::/48
划分为2段 2002:3d86:104::/49 2002:3d86:104:8000::49
2002:3d86:104::/49
2002:3d86:104:1::/64 tunel
2002:3d86:104:4::/64 R4客户
2002:3d86:104:5::/64 R5客户
2002:3d86:104:6::/64 R6客户
2002:3d86:104:7::/64 R7客户
2002:3d86:104:8::/64 R7客户
2002:3d86:104:8000::/49
2002:3d86:104:8001::/64 R4-R5
2002:3d86:104:8002::/64 R5-R6
2002:3d86:104:8003::/64 R6-R7
2002:3d86:104:8004::/64 R7-R8
* site-local 本地站点地址----私有地址 私网地址
FEC0::/16 用来OSPF建邻
FEC0::4/128 R4环回
FEC0::5/128 R4环回
FEC0::6/128 R6环回
FEC0::7/128 R7环回
FEC0::8/128 R8环回
R1:
ipv4: 192.168.1.1/24 lo0 192.168.2.1/24
ipv6:2002:150:9a07:1::1/64 lo1: 2002:150:9a07:8001::1/64 lo1:2002:150:9a07:2:8002:1/64
R2:
ipv4:1.80.154.7/24
ipv6:ipv6:2002:150:9a07:1::2/64
R3:
ipv4:1.80.154.8/24 61.134.1.3/24 lo:3.3.3.3/24
R4:
ipv4: 61.134.1.4/24
ipv6: 2002:3d86:104:8001::1/64 lo: FEC0::4/128 lo1:2002:3d86:104:4::/64
R5:
ipv6: 2002:3d86:104:8001::2/64 2002:3d86:104:8002::1/64 lo: FEC0::5/128 lo1:2002:3d86:104:5::1/64
R6:
ipv6:2002:3d86:104:8002::2/64 2002:3d86:104:8003::1/64 lo: FEC0::6/128 lo1:2002:3d86:104:6::1/64
R7:
ipv6:2002:3d86:104:8003::2/64 2002:3d86:104:8004::1/64 lo: FEC0::7/128 lo1:2002:3d86:104:7::1/64
R8:
ipv6:2002:3d86:104:8004::2/64 lo: FEC0::8/128 lo1:2002:3d86:104:8::1/64
左边基础配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0
[R1-ui-console0]q
[R1]
[R1]ipv6 开启IPV6转发功能
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ipv6 enable
[R1-GigabitEthernet0/0/0]ipv6 addr 2002:150:9a07:1::1 64
[R1-GigabitEthernet0/0/0]q
[R1]int l01
[R1-LoopBack1]ipv6 enable
[R1-LoopBack1]ipv6 addr 2002:150:9a07:8001::1 64
[R1-LoopBack1]int lo2
[R1-LoopBack2]ipv6 enable
[R1-LoopBack2]ipv6 addr 2002:150:9a07:8002::1 64
[R1-LoopBack2]
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]user-interface console 0
[Huawei-ui-console0]idle-timeout 0
[Huawei-ui-console0]q
[Huawei]sys r2
[r2]ipv6
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ipv6 en
[r2-GigabitEthernet0/0/1]ipv6 enable
[r2-GigabitEthernet0/0/1]ipv6 addr 2002:150:9a07:1::2 64
[r2-GigabitEthernet0/0/1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip addr 1.80.154.7 24
配置RIPNG
[R1]ripng 1
[R1-ripng-1]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ripng 1 enable
[R1-GigabitEthernet0/0/0]int lo1
[R1-LoopBack1]ripng 1 enable
[R1-LoopBack1]int lo2
[R1-LoopBack2]ripng 1 enable
[R1-LoopBack2]
[r2]ripng 1
[r2-ripng-1]q
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ripng 1 enable
[r2-GigabitEthernet0/0/1]q
[r2]
[r2-GigabitEthernet0/0/1]ripng default-route ?
only Advertises IPv6 default route only //只发缺省,不会发环回
originate Originate default route //
[r2-GigabitEthernet0/0/1]ripng default-route only
验证RIPNG
[R1]dis ipv6 routing-table protocol ripng
Public Routing Table : RIPng
Summary Count : 1
RIPng Routing Table's Status : < Active >
Summary Count : 1
Destination : :: PrefixLength : 0
NextHop : FE80::2E0:FCFF:FEDF:1C9D Preference : 100
Cost : 1 Protocol : RIPng
RelayNextHop : :: TunnelID : 0x0
Interface : GigabitEthernet0/0/0 Flags : D
RIPng Routing Table's Status : < Inactive >
Summary Count : 0
[R1]
[r2]dis ripng 1 route
Route Flags: R - RIPng
A - Aging, G - Garbage-collect
----------------------------------------------------------------
Peer FE80::2E0:FCFF:FEE8:452B on GigabitEthernet0/0/1 //Link-local
Dest 2002:150:9A07:8001::/64,
via FE80::2E0:FCFF:FEE8:452B, cost 1, tag 0, RA, 18 Sec
Dest 2002:150:9A07:8002::/64,
via FE80::2E0:FCFF:FEE8:452B, cost 1, tag 0, RA, 18 Sec
[r2]
* Link-local地址--------------网络位FE80::/64 后64位使用EUI-64补充
EUI-64简易的用户界面:
以太网接口MAC地址----ca00.0a60.0000
在MAC的前24位和后24位之间强行插入FFFE
ca00.0aFF.FE60.0000
U位转换
将合成后的地址,从左往右第7位自反 若该位为0,变为1;为1变为0;
Ca00=1100 1010 0000 0000 第七位自反
1100 1000 0000 0000=c800
link-local地址为
FE80::c800.aff.fe60.0
配置R2 6to4 tunel
[r2]int Tunnel 1
[r2-Tunnel0/0/0]ipv6 enable
[r2-Tunnel0/0/0]ipv6 addr 2002:150:9a07:2::1 64
[r2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[r2-Tunnel0/0/0]source 1.80.144.167
[r2-Tunnel0/0/0]q
[r2]ipv6 route-static 2002:: 16 Tunnel 0/0/0
配置R4 6to4 Trunel
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ipv6 enable
[r4-Tunnel0/0/1]ipv6 addr 2002:3d86:104:1::1 64
[r4-Tunnel0/0/1]tunnel-protocol ipv6-ipv4 6to4
[r4-Tunnel0/0/1]source 61.134.1.4
[r4]ipv6 route-static 2002:: 16 Tunnel 0/0/1
配置ISP
[r3]dis ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 61.134.1.3/24 up up
GigabitEthernet0/0/1 1.80.154.8/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 3.3.3.3/24 up up(s)
LoopBack1 unassigned up up(s)
NULL0 unassigned up up(s)
[r3]
右边基础配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r4
[r4]user-interface console 0
[r4-ui-console0]idle-timeout 0
[r4-ui-console0]q
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip addr 61.134.1.4 24
[r4-GigabitEthernet0/0/1]
[r4]ipv6
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ipv6 enable
[r4-GigabitEthernet0/0/0]ipv6 addr 2002:3d86:104:8001::1 64
[r4-GigabitEthernet0/0/0]q
[r4]int lo0
[r4-LoopBack0]ipv6 enable
[r4-LoopBack0]ipv6 addr 2002:3d86:104:4::1 64
[r4-LoopBack0]ipv6 addr FEC0::4 128
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ipv6 enable
[r5-GigabitEthernet0/0/1]ipv6 addr 2002:3d86:104:8001::2 64
[r5-GigabitEthernet0/0/1]int g0/0/0
[r5-GigabitEthernet0/0/0]ipv6 enable
[r5-GigabitEthernet0/0/0]ipv6 addr 2002:3d86:104:8002::1 64
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ipv6 enable
[r5-LoopBack0]ipv6 addr fec0::5 128
[r5-LoopBack0]ipv6 addr 2002:3d86:104:5::1 64
[r6]ipv6
[r6]int g0/0/1
[r6-GigabitEthernet0/0/1]ipv6 en
[r6-GigabitEthernet0/0/1]ipv6 enable
[r6-GigabitEthernet0/0/1]ipv6 addr 2002:3d86:104:8002::2 64
[r6-GigabitEthernet0/0/1]int g0/0/0
[r6-GigabitEthernet0/0/0]ipv6 enable
[r6-GigabitEthernet0/0/0]ipv6 addr 2002:3d86:104:8003::1 64
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ipv6 enable
[r6-LoopBack0]ipv6 addr 2002:3d86:104:6::1 64
[r6-LoopBack0]ipv6 addr fec0::6 128
[r7]ipv6
[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ipv6 enable
[r7-GigabitEthernet0/0/1]ipv6 addr 2002:3d86:104:8003::2 64
[r7-GigabitEthernet0/0/1]int g0/0/0
[r7-GigabitEthernet0/0/0]ipv6 enable
[r7-GigabitEthernet0/0/0]ipv6 addr 2002:3d86:104:8004::1 64
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ipv6 addr fec0::7 128
[r7-LoopBack0]ipv6 addr 2002:3d86:104:7::1 64
[r7-LoopBack0]
[r8]ipv6
[r8]int g0/0/1
[r8-GigabitEthernet0/0/1]ipv6 enable
[r8-GigabitEthernet0/0/1]ipv6 addr 2002:3d86:104:8004::2 64
[r8-GigabitEthernet0/0/1]int lo0
[r8-LoopBack0]ipv6 enable
[r8-LoopBack0]ipv6 addr fec0::8 128
[r8-LoopBack0]ipv6 addr 2002:3d86:104:8::1 64
配置OSPF
[r5-ospfv3-1]route-tag
[r5-ospfv3-1]router-id 5.5.5.5
[r5-ospfv3-1]q
[r5-GigabitEthernet0/0/0]ospfv3 1 area 0
[r5-GigabitEthernet0/0/0]int lo0
[r5-LoopBack0]ospfv
[r5-LoopBack0]ospfv3 1 are
[r5-LoopBack0]ospfv3 1 area 0
[r5-LoopBack0]
[r6]ospfv3 1
[r6-ospfv3-1]router-id 6.6.6.6
[r6-ospfv3-1]q
[r6]int g0/0/1
[r6-GigabitEthernet0/0/1]ospfv3 1 area 0
[r6-GigabitEthernet0/0/1]int g0/0/0
[r6-GigabitEthernet0/0/0]ospfv3 1 area 0
[r6-GigabitEthernet0/0/0]int lo0
[r6-LoopBack0]ospfv3 1 area 0
[r6-LoopBack0]
[r7]ospfv3 1
[r7-ospfv3-1]router-id 7.7.7.7
[r7-ospfv3-1]int g0/0/1
[r7-GigabitEthernet0/0/1]ospfv3 1 area 0
[r7-GigabitEthernet0/0/1]int g0/0/0
[r7-GigabitEthernet0/0/0]ospfv3 1 area 0
[r7-GigabitEthernet0/0/0]int lo0
[r7-LoopBack0]ospfv3 1 area 0
[r7-LoopBack0]
[r8]ospfv3 1
[r8-ospfv3-1]rou
[r8-ospfv3-1]route-tag
[r8-ospfv3-1]router-id 8.8.8.8
[r8-ospfv3-1]int g0/0/1
[r8-GigabitEthernet0/0/1]ospfv3 1 area 0
[r8-GigabitEthernet0/0/1]int lo0
[r8-LoopBack0]ospfv3 1 area 0
[r8-LoopBack0]
验证OSPF
[r7]dis ospfv3 peer
OSPFv3 Process (1)
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
8.8.8.8 1 Full/Backup 00:00:31 GE0/0/0 0
6.6.6.6 1 Full/DR 00:00:36 GE0/0/1 0
[r6-LoopBack0]dis ospfv3 peer
OSPFv3 Process (1)
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
7.7.7.7 1 Full/Backup 00:00:37 GE0/0/0 0
5.5.5.5 1 Full/DR 00:00:30 GE0/0/1 0
[r6]dis ospfv3 routing
Codes : E2 - Type 2 External, E1 - Type 1 External, IA - Inter-Area,
N - NSSA, U - Uninstalled
OSPFv3 Process (1)
Destination Metric
Next-hop
2002:3D86:104:5::1/128 1
via FE80::2E0:FCFF:FE22:6D5C, GigabitEthernet0/0/1
2002:3D86:104:6::1/128 0
directly connected, LoopBack0
2002:3D86:104:7::1/128 1
via FE80::2E0:FCFF:FE4C:6E8B, GigabitEthernet0/0/0
2002:3D86:104:8::1/128 2
via FE80::2E0:FCFF:FE4C:6E8B, GigabitEthernet0/0/0
2002:3D86:104:8002::/64 1
directly connected, GigabitEthernet0/0/1
2002:3D86:104:8003::/64 1
directly connected, GigabitEthernet0/0/0
2002:3D86:104:8004::/64 2
via FE80::2E0:FCFF:FE4C:6E8B, GigabitEthernet0/0/0
FEC0::5/128 1
via FE80::2E0:FCFF:FE22:6D5C, GigabitEthernet0/0/1
FEC0::6/128 0
directly connected, LoopBack0
FEC0::7/128 1
via FE80::2E0:FCFF:FE4C:6E8B, GigabitEthernet0/0/0
FEC0::8/128 2
via FE80::2E0:FCFF:FE4C:6E8B, GigabitEthernet0/0/0
[r6]
配置BGP
[r4]ipv6 route-static FEC0::5 128 2002:3D86:104:8001::2 因为没有使用对端接口IP建邻,所以需要添加到对端的路由
[r4]bgp 1
[r4-bgp]rou
[r4-bgp]route-select
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer FEC0::5 as-number 2
[r4-bgp]peer FEC0::5 ebgp-max-hop 2
[r4-bgp]peer FEC0::5 connect-interface LoopBack0 FEC0::4
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]peer FEC0::5 enable
#
[r5]dis cu
[V200R003C00]
#
sysname r5
#
ipv6 route-static FEC0::4 128 2002:3D86:104:8001::1
#
bgp 64512
router-id 5.5.5.5
confederation id 2
peer FEC0::4 as-number 1
peer FEC0::4 ebgp-max-hop 2
peer FEC0::4 connect-interface LoopBack0
peer FEC0::6 as-number 64512
peer FEC0::6 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv6-family unicast
undo synchronization
peer FEC0::4 enable
peer FEC0::6 enable
peer fec0::6 next-hop-local
#
return
[r6]bgp 64512
[r6-bgp]router-id 6.6.6.6
[r6-bgp]peer feco::5 as-number 64512
[r6-bgp]peer fec0::7 as-number 64512
[r6-bgp]peer fec0:::7 connect-interface LoopBack 0 fec0::6 //因为lo0配置了多个IP,所以指定与对方建邻的IP
[r6-bgp]peer fec0::7 connect-interface LoopBack 0 fec0::6
[r6-bgp]ipv6-family
[r6-bgp-af-ipv6]peer fec0::5 enable
[r6-bgp-af-ipv6]peer fec0::5 reflect-client //设置本地为RR,5.5.5.5为客户端
[r6-bgp-af-ipv6]peer fec0::7 enable
[r6-bgp-af-ipv6]
[r7]bgp 64512
[r7-bgp]confederation id 2
[r7-bgp]router-id 7.7.7.7
[r7-bgp]confederation peer-as 64513
[r7-bgp]peer fec0::6 as-number 64512
[r7-bgp]peer fec0::6 connect-interface LoopBack 0 fec0::7
[r7-bgp]peer fec0::8 as-number 64513
[r7-bgp]peer fec0::8 connect-interface LoopBack 0 fec0::7
[r7-bgp]peer fec0::8 ebgp-max-hop 2
[r7-bgp]ipv6-family
[r7-bgp-af-ipv6]peer fec0::6 enable
[r7-bgp-af-ipv6]peer fec0::8 enable
[r7-bgp-af-ipv6]
[r8]bgp 64513
[r8-bgp]router-id 8.8.8.8
[r8-bgp]confederation id 2
[r8-bgp]confederation peer-as 64512
[r8-bgp]peer fec0::7 as-number 64512
[r8-bgp]peer fec0::7 connect-interface LoopBack 0 fec0::8
[r8-bgp]peer fec0::7 ebgp-max-hop 2
[r8-bgp]ipv6-family
[r8-bgp-af-ipv6]peer fec0::7 enable
[r8-bgp-af-ipv6]q
[r8-bgp]
验证GBP建邻
[r5-bgp]dis bgp ipv6 peer
BGP local router ID : 5.5.5.5
Local AS number : 64512
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
FEC0::4 4 1 118 119 0 01:56:15 Established
0
FEC0::6 4 64512 12 21 0 00:10:30 Established
0
[r5-bgp]
[r6-bgp]dis bgp ipv6 peer
BGP local router ID : 6.6.6.6
Local AS number : 64512
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
FEC0::5 4 64512 12 12 0 00:10:51 Established
0
FEC0::7 4 64512 8 12 0 00:06:53 Established
0
[r6-bgp]
[r7]dis bgp ipv6 peer
BGP local router ID : 7.7.7.7
Local AS number : 64512
Total number of peers : 2 Peers in established state : 2
Peer V AS MsgRcvd MsgSent OutQ Up/Down State Pre
fRcv
FEC0::6 4 64512 9 9 0 00:07:28 Established
0
FEC0::8 4 64513 4 9 0 00:02:19 Established
0
[r7]
路由汇总及宣告
因为前期IP地址规划问题,需要宣告2条汇总:
2002:3d86:104:4::/62
2002:3d86:104:8::/62
[r5]ipv6 route-static 2002:3d86:104:4:: 62 null 0
[r5]ipv6 route-static 2002:3d86:104:8:: 62 null 0
[r5]bgp 64512
[r5-bgp]ipv6-family
[r5-bgp-af-ipv6]network 2002:3d86:104:4:: 62
[r5-bgp-af-ipv6]network 2002:3d86:104:8:: 62
[r4]ipv6 route-static 2002:: 16 Tunnel 0/0/1
[r4]bgp 1
[r4-bgp]ipv6-family
[r4-bgp-af-ipv6]network 2002:: 16
r4]dis bgp ipv6 routing-table
BGP Local router ID is 4.4.4.4
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2
*> Network : 2002:3D86:104:4:: PrefixLen : 62
NextHop : FEC0::5 LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : 2 i
*> Network : 2002:3D86:104:8:: PrefixLen : 62
NextHop : FEC0::5 LocPrf :
MED : 0 PrefVal : 0
Label :
Path/Ogn : 2 i
[r4]
验证
<r8>dis ipv6 interface LoopBack 0
LoopBack0 current state : UP
Line protocol current state : UP (spoofing)
IPv6 is enabled, link-local address is FE80::600:0
Global unicast address(es):
FEC0::8, subnet is FEC0::8/128
2002:3D86:104:8::1, subnet is 2002:3D86:104:8::/64
Joined group address(es):
FF02::1:FF00:1
FF02::2
FF02::1
FF02::1:FF00:8
FF02::1:FF00:0
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
Hosts use stateless autoconfig for addresses
<r8>
<R1>ping ipv6 2002:3D86:104:8::1
PING 2002:3D86:104:8::1 : 56 data bytes, press CTRL_C to break
Request time out
Reply from 2002:3D86:104:8::1
bytes=56 Sequence=2 hop limit=59 time = 60 ms
Reply from 2002:3D86:104:8::1
bytes=56 Sequence=3 hop limit=59 time = 40 ms
Reply from 2002:3D86:104:8::1
bytes=56 Sequence=4 hop limit=59 time = 60 ms
Reply from 2002:3D86:104:8::1
bytes=56 Sequence=5 hop limit=59 time = 60 ms