要求:
1、该拓扑为公司网络,其中包括公司总部、公司分部以及公司骨干网,不包含运营商公网部分。
1.地址规划
都给了规划啥呀
2.ip地址配置
R1
interface GigabitEthernet0/0/0
ip address 192.168.100.9 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.41 255.255.255.252
interface GigabitEthernet0/0/2
ip address 192.168.100.17 255.255.255.252
interface GigabitEthernet1/0/0
ip address 10.10.10.1 255.255.255.252
interface GigabitEthernet2/0/0
ip address 10.10.10.5 255.255.255.252
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
R2
interface GigabitEthernet0/0/0
ip address 192.168.100.13 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.42 255.255.255.252
interface GigabitEthernet0/0/2
ip address 192.168.100.5 255.255.255.252
interface GigabitEthernet1/0/0
ip address 10.10.10.13 255.255.255.252
interface GigabitEthernet2/0/0
ip address 10.10.10.9 255.255.255.252
interface loopback 0
ip address 2.2.2.2 32
R3
interface GigabitEthernet0/0/0
ip address 192.168.100.10 255.255.255.252
interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0
interface GigabitEthernet0/0/2
ip address 192.168.100.1 255.255.255.252
interface GigabitEthernet1/0/0
ip address 192.168.100.6 255.255.255.252
R4
interface GigabitEthernet0/0/0
ip address 192.168.100.14 255.255.255.252
interface GigabitEthernet0/0/1
ip address 192.168.2.254 255.255.255.0
interface GigabitEthernet0/0/2
ip address 192.168.100.2 255.255.255.252
interface GigabitEthernet1/0/0
ip address 192.168.100.18 255.255.255.252
R5
interface GigabitEthernet0/0/0
ip address 10.10.10.2 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.10 255.255.255.252
interface GigabitEthernet0/0/2
ip address 10.10.10.21 255.255.255.252
interface GigabitEthernet1/0/0
ip address 10.10.10.17 255.255.255.252
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
R6
interface GigabitEthernet0/0/0
ip address 10.10.10.14 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.6 255.255.255.252
interface GigabitEthernet0/0/2
ip address 10.10.10.25 255.255.255.252
interface GigabitEthernet1/0/0
ip address 10.10.10.18 255.255.255.252
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
R7
interface GigabitEthernet0/0/0
ip address 10.10.10.22 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.26 255.255.255.252
interface GigabitEthernet0/0/2
ip address 10.10.10.29 255.255.255.252
interface GigabitEthernet1/0/0
ip address 10.10.10.33 255.255.255.252
interface LoopBack0
ip address 7.7.7.7 255.255.255.255
R8
interface GigabitEthernet0/0/0
ip address 10.10.10.30 255.255.255.252
interface GigabitEthernet0/0/1
ip address 10.10.10.34 255.255.255.252
interface GigabitEthernet0/0/2
ip address 10.10.10.37 255.255.255.252
interface LoopBack0
ip address 8.8.8.8 255.255.255.255
R9
interface GigabitEthernet0/0/0
ip address 10.10.10.38 255.255.255.252
interface GigabitEthernet0/0/1
ip address 192.168.200.2 255.255.255.252
interface LoopBack0
ip address 9.9.9.9 255.255.255.255
R10
interface GigabitEthernet0/0/0
ip address 192.168.200.1 255.255.255.252
interface LoopBack0
ip address 1.1.1.10 255.255.255.255
3.交换与单臂路由
R10
interface GigabitEthernet0/0/1.1----VLAN间路由
dot1q termination vid 10——定义子接口管理的vlan
ip address 192.168.3.254 255.255.255.0——配置接口IP地址
arp broadcast enable——开启ARP广播(华为需要手工开启子接口的ARP接口应答)
interface GigabitEthernet0/0/1.2----VLAN间路由
dot1q termination vid 20——定义子接口管理的vlan
ip address 192.168.4.254 255.255.255.0 ——配置接口IP地址
arp broadcast enable——开启ARP广播(华为需要手工开启子接口的ARP接口应答)
SW4
vlan batch 10 20
interface GigabitEthernet0/0/2----将0/0/2划分到VLAN20
port link-type access
port default vlan 20
interface GigabitEthernet0/0/3----将0/0/3划分到VLAN10
port link-type access
port default vlan 10
interface GigabitEthernet0/0/1----开启主干道
port link-type trunk
port trunk allow-pass vlan 10 20——最少透传原则
4.OSPF
R1
ospf 100 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 192.168.100.9 0.0.0.0
network 192.168.100.17 0.0.0.0
R2
ospf 100 router-id 2.2.2.2
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 192.168.100.5 0.0.0.0
network 192.168.100.13 0.0.0.0
后面配置相同文章来源:https://www.toymoban.com/news/detail-629420.html
5.BGP
R1
bgp 100
router-id 1.1.1.1
peer 2.2.2.2 as-number 100 ——与R2建立IBGP对等体
Peer 2.2.2.2 connect-interface loopBack 0——在建立IBGP对等体的过程中使用环回接口建立,需要修改发送的地址
peer 10.10.10.2 as-number 200 ——与R5建立EBGP对等体
peer 10.10.10.6 as-number 200 ——与R6建立EBGP对等体
因AS-PATH属性原因,总部与分部路由会学习不到,使用命令如(peer 10.10.10.10 allow-as-loop,仅在总部与分部设备上配置即可),将允许AS号重复。
Peer 10.10.10.2 allow-as-loop——R5
Peer 10.10.10.2 allow-as-loop——R6
ospf
import-route bgp
R2
bgp 100
router-id 2.2.2.2
peer 1.1.1.1 as-number 100 ——与R1建立IBGP对等体
peer 1.1.1.1 connect-interface LoopBack0——更改发送地址
peer 10.10.10.10 as-number 200 ——与R5建立EBGP对等体
peer 10.10.10.14 as-number 200 ——与R6建立EBGP对等体
因AS-PATH属性原因,总部与分部路由会学习不到,使用命令如(peer 10.10.10.10 allow-as-loop,仅在总部与分部设备上配置即可),将允许AS号重复。
Peer 10.10.10.10 allow-as-loop——R5
Peer 10.10.10.14 allow-as-loop——R6
ospf
import-route bgp
R5
bgp 200
router-id 5.5.5.5
peer 10.10.10.1 as-number 100 ——与R1建立EBGP对等体
peer 10.10.10.9 as-number 100 ——与R2建立EBGP对等体
peer 6.6.6.6 as-number 200 ——与R6建立IBGP对等体
peer 6.6.6.6 connect-interface LoopBack0——更改发送地址
peer 7.7.7.7 as-number 200 ——与R7建立IBGP对等体
peer 7.7.7.7 connect-interface LoopBack0——更改发送地址
peer 8.8.8.8 as-number 200 ——与R8建立IBGP对等体
peer8.8.8.8 connect-interface LoopBack0——更改发送地址
peer 7.7.7.7 next-hop-local
peer 8.8.8.8 next-hop-local
R6
bgp 200
router-id 6.6.6.6
peer 10.10.10.5 as-number 100 ——与R1建立EBGP对等体
peer 10.10.10.13 as-number 100 ——与R1建立EBGP对等体
peer 5.5.5.5 as-number 200 ——与R5建立BGP对等体
peer 5.5.5.5connect-interface LoopBack0
peer 7.7.7.7 as-number 200 ——与R7建立BGP对等体
peer 7.7.7.7 connect-interface LoopBack0
Peer 8.8.8.8 as-number 200 ——与R7建立BGP对等体
peer 8.8.8.8 connect-interface LoopBack0
peer 7.7.7.7 next-hop-local
peer 8.8.8.8 next-hop-local
R7
bgp 200
router-id 7.7.7.7
peer 5.5.5.5 as-number 200
peer 5.5.5.5 connect-interface LoopBack0
peer 6.6.6.6 as-number 200
peer 6.6.6.6 connect-interface LoopBack0
peer 8.8.8.8 as-number 200
peer 8.8.8.8 connect-interface LoopBack0
R8
bgp 200
router-id 8.8.8.8
peer 5.5.5.5 as-number 200 ——IBGP
peer 5.5.5.5 connect-interface LoopBack0
peer 6.6.6.6 as-number 200 ——IBGP
peer 6.6.6.6 connect-interface LoopBack0
peer 7.7.7.7 as-number 200 ——IBGP
peer 7.7.7.7 connect-interface LoopBack0
peer 10.10.10.38 as-number 100——EBGP
peer 5.5.5.5 next-hop-local
peer 6.6.6.6 next-hop-local
peer 7.7.7.7 next-hop-local
R9
bgp 100
router-id 9.9.9.9
peer 10.10.10.37 as-number 200
因AS-PATH属性原因,总部与分部路由会学习不到,使用命令如(peer 10.10.10.10 allow-as-loop,仅在总部与分部设备上配置即可),将允许AS号重复。
peer 10.10.10.37 allow-as-loop
R10
bgp 300
router-id 1.1.1.10
peer 9.9.9.9 as-number 300
peer 9.9.9.9 connect-interface LoopBack0
network 192.168.3.0
network 192.168.4.0
peer 9.9.9.9 next-hop-local
network 1.1.1.10 0.0.0.0
通过import router文章来源地址https://www.toymoban.com/news/detail-629420.html
6.策略
R1
[R1-ospf-100]import-route bgp type 1
[R1-bgp]ipv4-family
[R1-bgp]ipv4-family unicast
[R1-bgp-af ipv4]preterence 140 255 255
[R1]ip ip-prefix policy-1 permit 192.168.2.0 24
[R1]route-poliey policy-1 permit node 10
[R1-route-policy]if-match ip-prefix policy-1
[R1-route-policy]apply cost 10
[R1]route-pollcy policy-1 permit node 20----空表
[R1-bgp]peer 10.10.10.2 route-policy policy-1 export
[R1-bgp]peer 10.10.10.6 route-policy policy-1 export
R2
[R2-ospf-100]import-route bgp type 1
[R2-bgp]ipv4-family
[R2-bgp]ipv4-family unicast
[R2-bgp-af ipv4]preterence 140 255 255
[R2]ip ip-prefix policy-1 permit 192.168.1.0 24
[R2]route-poliey policy-1 permit node 10
[R2-route-policy]if-match ip-prefix policy-1
[R2-route-policy]apply cost 10
[R2]route-pollcy policy-1 permit node 20
[R2-bgp]peer 10.10.10.10 route-policy policy-1 export
[R2-bgp]peer 10.10.10.14 route-policy policy-1 export
R6
[R6]route-poliey policy-1 permit node 10
[R6-route-policy]apply cost 10
[R6]route-pollcy policy-1 permit node 20----空表
[R6-bgp]peer 10.10.10.5 route-policy policy-1 export
[R6-bgp]peer 10.10.10.13 route-policy policy-1 export
到了这里,关于hcip——期中小试的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!