HCIP实验-

实验拓扑

实验需求

实验思路

配置IP地址

R2、3、4、5、6建立OSPF协议

配置BGP:

R2、3、4、5、6配置MPLP

实验步骤

配置IP地址

以r2为例

[Huawei]sys r2
[r2]int l0
[r2-LoopBack0]ip address 2.2.2.2 32
[r2-LoopBack0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Jan 28 2024 13:30:23-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
Jan 28 2024 13:30:58-08:00 r2 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]int g0/0/02
[r2-GigabitEthernet0/0/2]ip address 24.1.1.1 24
Jan 28 2024 13:31:11-08:00 r2 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 

R2、3、4、5、6建立OSPF协议

以R2为例:

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0

配置BGP:

以R2为例:

[r2]bgp 100
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 5.5.5.5 as-number 100
[r2-bgp]peer 5.5.5.5 connect-interface l0
[r2-bgp]peer 6.6.6.6 as-number 100
[r2-bgp]peer 6.6.6.6 connect-interface l0

R2、3、4、5、6配置MPLS

以r2为例

[r2]mpls
Warning: Please configure mpls lsr-id first.
[r2]mpls  lsr-id 2.2.2.2
[r2]mpls 
Info: Mpls starting, please wait... OK!
[r2-mpls]mpls ldp
[r2-mpls-ldp]q
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]mpls
[r2-GigabitEthernet0/0/1]mpls ldp
[r2-GigabitEthernet0/0/1]int g0/0/2
[r2-GigabitEthernet0/0/2]mpls
[r2-GigabitEthernet0/0/2]mpls ldp

[r2]bgp 100
[r2-bgp]ipv4	
[r2-bgp]ipv4-family vpnv4
[r2-bgp-af-vpnv4]peer 5.5.5.5 enable 	
[r2-bgp-af-vpnv4]peer 6.6.6.6 enable 
[r2-bgp-af-vpnv4]peer 5.5.5.5 next-hop-local
[r2-bgp-af-vpnv4]peer 6.6.6.6 next-hop-local

[r2]ip vpn-instance 1
[r2-vpn-instance-1]route-distinguisher 1:1
[r2-vpn-instance-1-af-ipv4]vpn-target 1:1 export-extcommunity 
 EVT Assignment result: 
Info: VPN-Target assignment is successful.
[r2-vpn-instance-1-af-ipv4]vpn-target 2:2 3:3 import-extcommunity 
 IVT Assignment result: 
Info: VPN-Target assignment is successful.

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]undo ip address 
Jan 28 2024 15:29:11-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the DOWN state. 
[r2-GigabitEthernet0/0/0]ip binding vpn-instance 1
Info: All IPv4 related configurations on this interface are removed!
Info: All IPv6 related configurations on this interface are removed!
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Jan 28 2024 15:29:36-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]ip route-static vpn-instance 1 1.1.1.1 32 12.1.1.1
相关推荐
网络安全-杰克43 分钟前
网络安全概论
网络·web安全·php
怀澈1221 小时前
高性能服务器模型之Reactor(单线程版本)
linux·服务器·网络·c++
耗同学一米八1 小时前
2024 年河北省职业院校技能大赛网络建设与运维赛项样题二
运维·网络·mariadb
skywalk81631 小时前
树莓派2 安装raspberry os 并修改成固定ip
linux·服务器·网络·debian·树莓派·raspberry
C++忠实粉丝2 小时前
计算机网络socket编程(3)_UDP网络编程实现简单聊天室
linux·网络·c++·网络协议·计算机网络·udp
黑客Ela2 小时前
网络安全中常用浏览器插件、拓展
网络·安全·web安全·网络安全·php
qdprobot2 小时前
ESP32桌面天气摆件加文心一言AI大模型对话Mixly图形化编程STEAM创客教育
网络·人工智能·百度·文心一言·arduino
hakesashou4 小时前
Python中常用的函数介绍
java·网络·python
C++忠实粉丝4 小时前
计算机网络socket编程(4)_TCP socket API 详解
网络·数据结构·c++·网络协议·tcp/ip·计算机网络·算法
九州ip动态4 小时前
做网络推广及游戏注册为什么要换IP
网络·tcp/ip·游戏