IP中期实验

一、实验拓扑 

二、实验要求

1、该拓扑为公司网络,其中包括公司总部、公司分部以及公司骨干网,不包含运营商公网部分。
2、设备名称均使用拓扑上名称改名,并且区分大小写。
3、整张拓扑均使用私网地址进行配置。
4、整张网络中,运行OSPF协议或者BGP协议的设备,其Router-id值为设备名数字号,例如R1
Router-id1.1.1.1
5OSPF路由宣告部分选择接口宣告方式,例如192.168.100.1 0.0.0.0BGP仅宣告用户网段。
6IBGP部分使用环回建立邻居,EBGP部分使用直连链路建立邻居,所有运行BGP的设备都需要建立邻
居。
7R1R2R5R6R7R8R9R10需要配置环回接口,环回接口IP为设备名数字号,掩码为
32,例如R2的环回接口为2.2.2.2/32
8、所有PCIP地址均手工配置。
公司分部:
1PC5PC6属于不同VLAN
2SW4是一个二层交换机
3SW3是一个三层交换机
4R9是分部出口路由器
5、分部使用OSPF进程200达到分部网络全网可达
6、公司分部出口设备运行BGP协议连接骨干网络,AS号为100
7、因AS-PATH属性原因,总部与分部路由会学习不到,使用命令如(peer 10.10.10.10 allow-as
loop,仅在总部与分部设备上配置即可),将允许AS号重复。
公司总部:
1、交换机为二层交换机
2PC1PC2属于一个网段,PC3PC4是一个网段
3R3R4分别是下方PC的网关路由器
4、为保障公司总部到骨干网络的连通性,公司总部使用双路由器双出口的方式接入骨干网
5、为保障公司总部网络内部具备负载,R1R2R3R4设备均作为设备冗余,并使用全连接的方式进
行路由选路
6、总部内网使用OSPF进程100达到全网可达,OSPF需要宣告环回。7、公司总部双出口设备运行BGP协议连接骨干网络,AS号为100
8、因为R1R2重发布时会出现次优路径,需要修改BGP路由优先级,使用命令(preference 140 255
255,仅在总部设备上配置即可),配置位置在iPv4-family unicast中。
公司骨干网:
1、为保障公司网络连通性,骨干网络考虑设备冗余操作,连接总部使用双路由器,骨干网络部分路由器
之间使用双链路路方式
2、骨干网设备运行OSPF协议达到骨干网全网可达,进程号为10
3、骨干网设备运行BGP协议,AS号为200。使用全连接方式建邻。
优化:
1、为达到分流互备效果,公司总部业务部访问分部流量走R1R2做备份;公司总部工程部访问分部流
量走R2R1做备份,并要求来回路径一致。
2、公司总部双出口流量均流向R5R6做备份。来回路径一致。
3OSPF重发布时,更改类型为Type-1
4、所有策略名称为policy-1
5、更改开销时,全部更改为10

三、实验配置

1.IP划分

 

 2.VLAN划分配置

[LSW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.	
[LSW1]interface g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type trunk 	
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
 
[LSW1]int	
[LSW1]interface g0/0/2	
[LSW1-GigabitEthernet0/0/2]port link-type access 
[LSW1-GigabitEthernet0/0/2]port default vlan 10
	
[LSW1]interface G0/0/3	
[LSW1-GigabitEthernet0/0/3]port link-type access 	
[LSW1-GigabitEthernet0/0/3]port default vlan 20

3.OSPF配置

[R1]ospf 100 router-id 1.1.1.1
[R1-ospf-100]a 0
[R1-ospf-100-area-0.0.0.0]network 192.168.100.9 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 10.10.10.41  0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 192.168.100.17 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0
 
	
[R2]ospf 100 router-id 2.2.2.2
[R2-ospf-100]a 0
[R2-ospf-100-area-0.0.0.0]network 192.168.100.13 0.0.0.0	
[R2-ospf-100-area-0.0.0.0]network 10.10.10.42 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 192.168.100.5 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0
	
[R3]ospf 100 router-id 3.3.3.3
[R3-ospf-100]a 0
[R3-ospf-100-area-0.0.0.0]network 192.168.100.10 0.0.0.0	
[R3-ospf-100-area-0.0.0.0]network 192.168.1.254 0.0.0.0	
[R3-ospf-100-area-0.0.0.0]network 192.168.100.1 0.0.0.0	
[R3-ospf-100-area-0.0.0.0]network 192.168.100.6 0.0.0.0
 
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]network 192.168.100.14 0.0.0.0 
[R4-ospf-1-area-0.0.0.0]network 192.168.2.254 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 192.168.100.2 0.0.0.0	
[R4-ospf-1-area-0.0.0.0]network 192.168.100.18 0.0.0.0
 
[R5]ospf 10 router-id 5.5.5.5
[R5-ospf-10]a 0	
[R5-ospf-10-area-0.0.0.0]network 10.10.10.21 0.0.0.0	
[R5-ospf-10-area-0.0.0.0]network 10.10.10.17 0.0.0.0 	
[R5-ospf-10-area-0.0.0.0]network 5.5.5.5 0.0.0.0
 
 
[R6]ospf 10 router-id 6.6.6.6
[R6-ospf-10]a	
[R6-ospf-10]area 0
[R6-ospf-10-area-0.0.0.0]network 10.10.10.25 0.0.0.0	
[R6-ospf-10-area-0.0.0.0]network 10.10.10.18 0.0.0.0
[R6-ospf-10-area-0.0.0.0]network 6.6.6.6 0.0.0.0
 
[R7]ospf 10 router-id 7.7.7.7
[R7-ospf-10]area 0	
[R7-ospf-10-area-0.0.0.0]network 10.10.10.22 0.0.0.0
[R7-ospf-10-area-0.0.0.0]network 10.10.10.26 0.0.0.0
[R7-ospf-10-area-0.0.0.0]network 10.10.10.29 0.0.0.0	
[R7-ospf-10-area-0.0.0.0]network 10.10.10.33 0.0.0.0
[R7-ospf-10-area-0.0.0.0]network 7.7.7.7 0.0.0.0
 
[R8]ospf 10 router-id 8.8.8.8
[R8-ospf-10]area 0	
[R8-ospf-10-area-0.0.0.0]network 8.8.8.8 0.0.0.0	
[R8-ospf-10-area-0.0.0.0]network 10.10.10.30 0.0.0.0
[R8-ospf-10-area-0.0.0.0]network 10.10.10.34 0.0.0.0
 
[R9]ospf 200 router-id 9.9.9.9	
[R9-ospf-200]area 0
[R9-ospf-200-area-0.0.0.0]network 192.168.200.2 0.0.0.0
 
[R10]ospf 200 router-id 10.10.10.10
[R10-ospf-200]area 0
[R10-ospf-200-area-0.0.0.0]network 192.168.200.1 0.0.0.0
[R10-ospf-200-area-0.0.0.0]network 192.168.3.254 0.0.0.0
[R10-ospf-200-area-0.0.0.0]network 192.168.4.254 0.0.0.0

4.配置BGP

[R1]bgp 100
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 2.2.2.2 as-number 100	
[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R1-bgp]peer 10.10.10.2 as-number 200
[R1-bgp]peer 10.10.10.6 as-number 200
 
[R2]bgp 100
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 1.1.1.1 as-number 100	
[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[R2-bgp]peer 10.10.10.10 as-number 200
[R2-bgp]peer 10.10.10.14 as-number 200
 
[R5]bgp 200
[R5-bgp]router-id  5.5.5.5
[R5-bgp]peer 10.10.10.1 as-number 100
[R5-bgp]peer 10.10.10.9 as-number 100
[R5-bgp]peer 6.6.6.6 as-number 200	
[R5-bgp]peer 6.6.6.6 connect-interface LoopBack 0 
[R5-bgp]peer 6.6.6.6 next-hop-local 
[R5-bgp]peer 7.7.7.7 as-number 200	
[R5-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R5-bgp]peer 7.7.7.7 next-hop-local 
[R5-bgp]peer 8.8.8.8 as-number 200	
[R5-bgp]peer 8.8.8.8 connect-interface LoopBack 0
[R5-bgp]peer 8.8.8.8 next-hop-local 
 
[R6]bgp 200
[R6-bgp]router-id 6.6.6.6
[R6-bgp]peer 5.5.5.5 as-number 100
[R6-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R6-bgp]peer 5.5.5.5 next-hop-local 
[R6-bgp]peer 10.10.10.5 as-number 100
[R6-bgp]peer 10.10.10.13 as-number 100
[R6-bgp]peer 7.7.7.7 as-number 200	
[R6-bgp]peer 7.7.7.7 connect-interface l	
[R6-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R6-bgp]peer 7.7.7.7 next-hop-local 
[R6-bgp]peer 8.8.8.8 as-number 200	
[R6-bgp]peer 8.8.8.8 connect-interface LoopBack 0
 
[R7]bgp 200
[R7-bgp]router-id 7.7.7.7	
[R7-bgp]peer 5.5.5.5 as-number 200	
[R7-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R7-bgp]peer 6.6.6.6 as-number 200
[R7-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[R7-bgp]peer 8.8.8.8 as-number 200	
[R7-bgp]peer 8.8.8.8 connect-interface LoopBack 0
 
[R8]bgp 200
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 5.5.5.5 as-number 200	
[R8-bgp]peer 5.5.5.5 connect-interface LoopBack 0
[R8-bgp]peer 5.5.5.5 next-hop-local 
[R8-bgp]peer 6.6.6.6 as-number 200	
[R8-bgp]peer 6.6.6.6 connect-interface LoopBack 0
[R8-bgp]peer 6.6.6.6 next-hop-local 
[R8-bgp]peer 7.7.7.7 as-number 200	
[R8-bgp]peer 7.7.7.7 connect-interface LoopBack 0
[R8-bgp]peer 7.7.7.7 next-hop-local 
[R8-bgp]peer 10.10.10.38 as-number 100
 
[R9]bgp 100
[R9-bgp]router-id 9.9.9.9
[R9-bgp]peer 10.10.10.37 as-number 200
 

5.BGP的宣告

[R1]bgp 100
[R1-bgp]network 192.168.1.0 24
[R1-bgp]network 192.168.2.0 24
 
[R2]bgp 100
[R2-bgp]network 192.168.1.0 24
[R2-bgp]network 192.168.2.0 24
 
[R9]bgp 100
[R9-bgp]network 192.168.3.0 24
[R9-bgp]network 192.168.4.0 24
 
[R1-bgp]peer 10.10.10.2 allow-as-loop 
[R1-bgp]peer 10.10.10.6 allow-as-loop 
 
[R2-bgp]peer 10.10.10.10 allow-as-loop 	
[R2-bgp]peer 10.10.10.14 allow-as-loop 
 
[R9-bgp]peer 10.10.10.37 allow-as-loop 

 因为R1和R2重发布时会出现次优路径,需要修改BGP路由优先级,使用命令(preference 140 255 255,仅在总部设备上配置即可)

[R1]bgp 100
[R1-bgp]ipv4-family unicast 
[R1-bgp-af-ipv4]preference 140 255 255
 
[R2]bgp 100
[R2-bgp]ipv4-family unicast 
[R2-bgp-af-ipv4]preference 140 255 255

6.为达到分流互备效果,公司总部业务部访问分部流量走R1,R2做备份;公司总部工程部访问分部流 量走R2,R1做备份,并要求来回路径一致

[R1]ip ip-prefix 1 permit 192.168.2.0 24
[R1]route-policy 1 permit node 10 
[R1-route-policy]if-match ip-prefix 1
[R1-route-policy]apply cost 10
[R1-route-policy]q
[R1]route-policy 1 permit node 20 
[R1]bgp 100
[R1-bgp]peer 10.10.10.2 route-policy 1 export
[R1-bgp]peer 10.10.10.6 route-policy 1 export
 
 
 
 
[R2]ip ip-prefix 1 permit 192.168.1.0 24
[R2]route-policy 1 permit node 10 
[R2-route-policy]if-match ip-prefix 1
[R2-route-policy]apply cost 10
[R2-route-policy]q
[R2]route-policy 1 permit node 20 
[R2]bgp 100
[R1-bgp]peer 10.10.10.10 route-policy 1 export
[R1-bgp]peer 10.10.10.14 route-policy 1 export

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

哈hhhh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值