1、该拓扑为公司网络,其中包括公司总部、公司分部以及公司骨干网,不包含运营商公网部分。
都给了规划啥呀
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
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
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
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
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
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
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
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
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
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
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——最少透传原则
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
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
后面配置相同
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
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
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
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
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
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
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
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
[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-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]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