完成公司网络系统集成设计(2000台电脑),总公司、分公司地跨两个不同城市
本次实验继续建立在实验三的基础之上,对其升级改造为地跨不同城市的总公司和分公司的大型局域网网建设。
实验三配置点击链接:基于ensp的小型局域网网络搭建及需求分析(二)
实验三的配置文件我已上传资源,可供大家下载参考(百度网盘):
链接:https://pan.baidu.com/s/1fOIr2ixMmrxYpD5PLP4tXQ?pwd=1111
提取码:1111
本次博客主要用到的技术是mpls vxn技术(vxn是什么自行脑补),mpls vxn技术非常复杂,具体原理不再多说,直接上配置,大家可以上网自行了解
本实验设计简单粗暴,即便使用了vxn,但是逻辑上有点抽象和考虑不周,主要思路如下:总公司的pc的流量通过出口路由器进入公网,然后公网上有一个vxn的专线,这个专线犹如一个隧道,能直通分公司。
设备名称 | 接口 | ip地址 |
AR1 | G0/0/1 | 12.1.1.1/24 |
AR2 | G0/0/0 | 12.1.1.2/24 |
G0/0/1 | 23.1.1.2/24 | |
loop0 | 2.2.2.2/32 | |
AR3 | G0/0/0 | 23.1.1.3/24 |
G0/0/1 | 34.1.1.3/24 | |
loop0 | 3.3.3.3/32 | |
AR4 | G0/0/0 | 34.1.1.4/24 |
G0/0/1 | 45.1.1.5/24 | |
loop0 | 4.4.4.4 |
配置ip实例:
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[Huawei-GigabitEthernet0/0/1]int lo0
[Huawei-LoopBack0]ip address 2.2.2.2 32
R2:
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
R3:
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
R4:
[Huawei]ospf 1
[Huawei-ospf-1]area 0
[Huawei-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[Huawei-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
在R2上show ip rou 查看路由表可以通过ospf学到4.4.4.4的路由
有4.4.4.4,说明ospf配的没问题
R2:
[Huawei]mpls lsr-id 2.2.2.2
[Huawei]mpls
Info: Mpls starting, please wait... OK!
[Huawei-mpls]mpls ldp
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]mpls
[Huawei-GigabitEthernet0/0/1]mpls ldp
R3:
[Huawei]mpls lsr-id 3.3.3.3
[Huawei]mpls
Info: Mpls starting, please wait... OK!
[Huawei-mpls]mpls ldp
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]mpls
[Huawei-GigabitEthernet0/0/1]mpls ldp
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/1]mpls
[Huawei-GigabitEthernet0/0/1]mpls ldp
R4:
[Huawei]mpls lsr-id 4.4.4.4
[Huawei]mpls
Info: Mpls starting, please wait... OK!
[Huawei-mpls]mpls ldp
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/1]mpls
[Huawei-GigabitEthernet0/0/1]mpls ldp
在R2上输入dis mpls lsp,如以下场景则证明mpls配置正确
R2:
[Huawei]ip -instance aaa
[Huawei--instance-aaa]route-distinguisher 1:1
[Huawei--instance-aaa-af-ipv4]-target 1:1
IVT Assignment result:
Info: VPN-Target assignment is successful.
EVT Assignment result:
Info: VPN-Target assignment is successful.
[Huawei--instance-aaa-af-ipv4]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip binding -instance aaa
[Huawei-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Apr 12 2023 10:36:41-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[3]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
R5:
[Huawei]ip -instance bbb
[Huawei--instance-bbb]route-distinguisher 1:2
[Huawei--instance-bbb-af-ipv4]-target 1:1
IVT Assignment result:
Info: VPN-Target assignment is successful.
EVT Assignment result:
Info: VPN-Target assignment is successful.
[Huawei--instance-bbb-af-ipv4]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip binding -instance bbb
[Huawei-GigabitEthernet0/0/0]ip address 45.1.1.5 24
Apr 12 2023 10:38:25-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
R1:
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ospf enable 1 area 0
[Huawei]bgp 100
[Huawei-bgp]network 192.168.10.0 255.255.255.0
[Huawei-bgp]network 192.168.20.0 255.255.255.0
[Huawei-bgp]network 192.168.30.0 255.255.255.0
[Huawei-bgp]network 192.168.40.0 255.255.255.0
[Huawei-bgp]peer 12.1.1.2 as-number 200
R2:
[Huawei]bgp 200
[Huawei-bgp]ipv4-family -instance aaa
[Huawei-bgp-aaa]peer 12.1.1.1 as-number 100
完成配置后,输入dis bgp peer会有如图以下效果:
如果是established,就说明总公司和运营商之间的bgp建立完成,注下图效果需要30s才能出效果,因为bgp建立时间是30s
R4:
[Huawei]bgp 200
[Huawei-bgp]ipv4-family -instance bbb
[Huawei-bgp-aaa]peer 45.1.1.5 as-number 300
R5:
[Huawei]bgp 300
[Huawei-bgp]network 172.25.250.0 255.255.255.0
[Huawei-bgp]peer 45.1.1.4 as-number 200
R5:
完成配置后,输入dis bgp peer会有如图以下效果:
如果是established,就说明总分公司和运营商之间的bgp建立完成,注下图效果需要30s才能出效果,因为bgp建立时间是30s
R2:
[Huawei]bgp 200
[Huawei-bgp]peer 4.4.4.4 as-number 200
[Huawei-bgp]peer 4.4.4.4 connect-interface lo0
[Huawei-bgp]ipv4-family v4
[Huawei-bgp-af-v4]peer 4.4.4.4 enable
R4:
[Huawei]bgp 200
[Huawei-bgp]peer 2.2.2.2 as-number 200
[Huawei-bgp]peer 2.2.2.2 connect-interface lo0
[Huawei-bgp]ipv4-family v4
[Huawei-bgp-af-v4]peer 2.2.2.2 enable
完成配置后,输入dis bgp v4 all peer会有如图以下效果:
如果是established,就说明运营的两头之间的bgp建立完成,注下图效果需要30s才能出效果,因为bgp建立时间是30s
此刻,你在R5上,输入dis ip routing-table ,发现总公司的路由都传递过来了,就说明你mpls vxn大体框架都完成了
然后在ospf中引入bgp
[Huawei]ospf 1
[Huawei-ospf-1]import-route bgp
pc5:
pc6:
如图: