BGP的一网双平面规划
Posted networking
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了BGP的一网双平面规划相关的知识,希望对你有一定的参考价值。
网络拓扑:
XRV1
=====================================================================
#
sysname XRV1
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.1000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.1.1 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
ip address 10.201.1.1 255.255.255.252
#
interface GigabitEthernet0/0/2
shutdown
ip address 10.201.3.1 255.255.255.252
#
interface LoopBack0
ip address 10.255.255.1 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.3.2 source-ip 10.201.3.1
#
bfd 20 bind peer-ip 10.201.1.2 source-ip 10.201.1.1
#
bgp 65001
router-id 10.255.255.1
graceful-restart
peer 10.201.1.2 as-number 65002
peer 10.201.1.2 password simple cisco
peer 10.201.1.2 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.1.2 bfd enable
peer 10.201.3.2 as-number 65004
peer 10.201.3.2 password simple cisco
peer 10.201.3.2 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.3.2 bfd enable
peer 10.255.255.2 as-number 65001
peer 10.255.255.2 connect-interface LoopBack0
peer 10.255.255.2 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.1.2 enable
peer 10.201.3.2 enable
peer 10.255.255.2 enable
peer 10.255.255.2 next-hop-local
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV2
=====================================================================
#
sysname XRV2
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.2000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.1.2 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
ip address 10.201.2.1 255.255.255.252
#
interface GigabitEthernet0/0/2
ip address 10.201.4.1 255.255.255.252
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
interface LoopBack0
ip address 10.255.255.2 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.4.2 source-ip 10.201.4.1
#
bfd 20 bind peer-ip 10.201.2.2 source-ip 10.201.2.1
#
bgp 65001
router-id 10.255.255.2
graceful-restart
peer 10.201.2.2 as-number 65002
peer 10.201.2.2 password simple cisco
peer 10.201.2.2 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.2.2 bfd enable
peer 10.201.4.2 as-number 65006
peer 10.201.4.2 password simple cisco
peer 10.201.4.2 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.4.2 bfd enable
peer 10.255.255.1 as-number 65001
peer 10.255.255.1 connect-interface LoopBack0
peer 10.255.255.1 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.2.2 enable
peer 10.201.4.2 enable
peer 10.255.255.1 enable
peer 10.255.255.1 next-hop-local
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV3
=====================================================================
#
sysname XRV3
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.3000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.2.1 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
ip address 10.201.1.2 255.255.255.252
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
ip address 10.201.3.5 255.255.255.252
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
interface LoopBack0
ip address 10.255.255.3 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.1.1 source-ip 10.201.1.2
#
bfd 20 bind peer-ip 10.201.3.6 source-ip 10.201.3.5
#
bgp 65002
router-id 10.255.255.3
graceful-restart
peer 10.201.1.1 as-number 65001
peer 10.201.1.1 password simple cisco
peer 10.201.1.1 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.1.1 bfd enable
peer 10.201.3.6 as-number 65004
peer 10.201.3.6 password simple cisco
peer 10.201.3.6 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.3.6 bfd enable
peer 10.255.255.4 as-number 65002
peer 10.255.255.4 connect-interface LoopBack0
peer 10.255.255.4 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.1.1 enable
peer 10.201.3.6 enable
peer 10.255.255.4 enable
peer 10.255.255.4 next-hop-local
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV4
=====================================================================
#
sysname XRV4
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.4000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.2.2 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
ip address 10.201.2.2 255.255.255.252
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
ip address 10.201.4.5 255.255.255.252
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
interface LoopBack0
ip address 10.255.255.4 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.4.6 source-ip 10.201.4.5
#
bfd 20 bind peer-ip 10.201.2.1 source-ip 10.201.2.2
#
bgp 65002
router-id 10.255.255.4
graceful-restart
peer 10.201.2.1 as-number 65001
peer 10.201.2.1 password simple cisco
peer 10.201.2.1 bfd enable
peer 10.201.4.6 as-number 65006
peer 10.201.4.6 password simple cisco
peer 10.201.4.6 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.4.6 bfd enable
peer 10.255.255.3 as-number 65002
peer 10.255.255.3 connect-interface LoopBack0
peer 10.255.255.3 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.2.1 enable
peer 10.201.4.6 enable
peer 10.255.255.3 enable
peer 10.255.255.3 next-hop-local
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV5
=====================================================================
#
sysname XRV5
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.5000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.3.1 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
ip address 10.201.3.2 255.255.255.252
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
ip address 10.201.3.6 255.255.255.252
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
interface LoopBack0
ip address 10.255.255.5 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.3.1 source-ip 10.201.3.2
#
bfd 20 bind peer-ip 10.201.3.5 source-ip 10.201.3.6
#
bgp 65004
router-id 10.255.255.5
graceful-restart
peer 10.201.3.1 as-number 65001
peer 10.201.3.1 password simple cisco
peer 10.201.3.1 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.3.1 bfd enable
peer 10.201.3.5 as-number 65002
peer 10.201.3.5 password simple cisco
peer 10.201.3.5 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.3.5 bfd enable
peer 10.255.255.7 as-number 65004
peer 10.255.255.7 connect-interface LoopBack0
peer 10.255.255.7 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.3.1 enable
peer 10.201.3.1 route-policy as65004-shengchan export
peer 10.201.3.5 enable
peer 10.201.3.5 route-policy as65004-bangong export
peer 10.255.255.7 enable
peer 10.255.255.7 next-hop-local
#
route-policy as65004-bangong permit node 10
if-match ip-prefix as65004-bangong
apply as-path 65004 65004 65004 additive
#
route-policy as65004-bangong permit node 20
#
route-policy as65004-shengchan permit node 10
if-match ip-prefix as65004-shengchan
apply as-path 65004 65004 65004 additive
#
route-policy as65004-shengchan permit node 20
#
ip ip-prefix as65004-bangong index 10 permit 10.158.1.0 24
ip ip-prefix as65004-bangong index 20 permit 10.158.2.0 24
ip ip-prefix as65004-shengchan index 10 permit 10.133.1.0 24
ip ip-prefix as65004-shengchan index 20 permit 10.133.2.0 24
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV6
=====================================================================
#
sysname XRV6
#
board add 0/1 1GEC
board add 0/2 1GEC
board add 0/3 1GEC
board add 0/4 1GEC
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
bfd
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.6000.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.10.4.1 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
ip address 10.201.4.2 255.255.255.252
#
interface GigabitEthernet1/0/0
#
interface GigabitEthernet2/0/0
#
interface GigabitEthernet3/0/0
ip address 10.201.4.6 255.255.255.252
#
interface GigabitEthernet4/0/0
#
interface NULL0
#
interface LoopBack0
ip address 10.255.255.6 255.255.255.255
isis enable 100
#
bfd 10 bind peer-ip 10.201.4.1 source-ip 10.201.4.2
#
bfd 20 bind peer-ip 10.201.4.5 source-ip 10.201.4.6
#
bgp 65006
router-id 10.255.255.6
graceful-restart
peer 10.201.4.1 as-number 65001
peer 10.201.4.1 password simple cisco
peer 10.201.4.1 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.4.1 bfd enable
peer 10.201.4.5 as-number 65002
peer 10.201.4.5 password simple cisco
peer 10.201.4.5 bfd min-tx-interval 250 min-rx-interval 250
peer 10.201.4.5 bfd enable
peer 10.255.255.8 as-number 65006
peer 10.255.255.8 connect-interface LoopBack0
peer 10.255.255.8 password simple cisco
#
ipv4-family unicast
undo synchronization
peer 10.201.4.1 enable
peer 10.201.4.1 route-policy as65006-shengchan export
peer 10.201.4.5 enable
peer 10.201.4.5 route-policy as65006-bangong export
peer 10.255.255.8 enable
peer 10.255.255.8 next-hop-local
#
route-policy as65006-bangong permit node 10
if-match ip-prefix as65006-bangong
apply as-path 65006 65006 65006 additive
#
route-policy as65006-bangong permit node 20
#
route-policy as65006-shengchan permit node 10
if-match ip-prefix as65006-shengchan
apply as-path 65006 65006 65006 additive
#
route-policy as65006-shengchan permit node 20
#
ip ip-prefix as65006-bangong index 10 permit 10.79.1.0 24
ip ip-prefix as65006-bangong index 20 permit 10.79.2.0 24
ip ip-prefix as65006-shengchan index 10 permit 10.37.1.0 24
ip ip-prefix as65006-shengchan index 20 permit 10.37.2.0 24
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
XRV7
=====================================================================
#
sysname XRV7
#
vlan batch 2 to 4 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.7000.00
#
interface Vlanif1
ip address 10.158.1.254 255.255.255.0
#
interface Vlanif2
ip address 10.158.2.254 255.255.255.0
#
interface Vlanif3
ip address 10.133.1.254 255.255.255.0
#
interface Vlanif4
ip address 10.133.2.254 255.255.255.0
#
interface Vlanif100
ip address 10.10.3.2 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
#
interface LoopBack0
ip address 10.255.255.7 255.255.255.255
isis enable 100
#
bgp 65004
router-id 10.255.255.7
graceful-restart
peer 10.255.255.5 as-number 65004
peer 10.255.255.5 password simple cisco
#
ipv4-family unicast
undo synchronization
network 10.133.1.0 255.255.255.0
network 10.133.2.0 255.255.255.0
network 10.158.1.0 255.255.255.0
network 10.158.2.0 255.255.255.0
peer 10.255.255.5 enable
#
user-interface con 0
user-interface vty 0 4
#
return
XRV8
=====================================================================
#
sysname XRV8
#
vlan batch 2 to 4 100
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
isis 100
is-level level-2
network-entity 49.0000.1025.5255.8000.00
#
interface Vlanif1
ip address 10.79.1.254 255.255.255.0
#
interface Vlanif2
ip address 10.79.2.254 255.255.255.0
#
interface Vlanif3
ip address 10.37.1.254 255.255.255.0
#
interface Vlanif4
ip address 10.37.2.254 255.255.255.0
#
interface Vlanif100
ip address 10.10.4.2 255.255.255.252
isis enable 100
isis circuit-level level-2
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
#
interface LoopBack0
ip address 10.255.255.8 255.255.255.255
isis enable 100
#
bgp 65006
router-id 10.255.255.8
graceful-restart
peer 10.255.255.6 as-number 65006
peer 10.255.255.6 connect-interface LoopBack0
peer 10.255.255.6 password simple cisco
#
ipv4-family unicast
undo synchronization
network 10.37.1.0 255.255.255.0
network 10.37.2.0 255.255.255.0
network 10.79.1.0 255.255.255.0
network 10.79.2.0 255.255.255.0
peer 10.255.255.6 enable
#
user-interface con 0
user-interface vty 0 4
#
return
在XRV7上通过源10.158.1.254 tracert 10.79.1.254
=====================================================================
<XRV7>tracert -a 10.158.1.254 10.79.1.254
traceroute to 10.79.1.254(10.79.1.254), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.10.3.1 30 ms 30 ms 50 ms
2 10.201.3.1 50 ms 40 ms 40 ms
3 10.10.1.2 70 ms 70 ms 30 ms
4 10.201.4.2 80 ms 30 ms 60 ms
5 10.10.4.2 80 ms 60 ms 60 ms
<XRV7>
在XRV7上通过源10.133.1.254 tracert 10.37.1.254
=====================================================================
<XRV7>tracert -a 10.133.1.254 10.37.1.254
traceroute to 10.37.1.254(10.37.1.254), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.10.3.1 50 ms 40 ms 30 ms
2 10.201.3.5 50 ms 50 ms 50 ms
3 10.10.2.2 60 ms 60 ms 50 ms
4 10.201.4.6 60 ms 60 ms 60 ms
5 10.10.4.2 70 ms 60 ms 60 ms
<XRV7>
在XRV1上将g0/0/2接口shutdown后在XRV7上通过源 10.158.1.254 tracert 10.79.1.254
=====================================================================
<XRV7>tracert -a 10.158.1.254 10.79.1.254
traceroute to 10.79.1.254(10.79.1.254), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.10.3.1 30 ms 50 ms 30 ms
2 10.201.3.5 40 ms 50 ms 30 ms
3 10.201.1.1 80 ms 60 ms 70 ms
4 10.10.1.2 60 ms 60 ms 60 ms
5 10.201.4.2 70 ms 60 ms 60 ms
6 10.10.4.2 90 ms 80 ms 80 ms
<XRV7>
在XRV1上将g0/0/2和g1/0/1接口同时shutdown后在XRV7上通过源 10.158.1.254 tracert 10.79.1.254
=====================================================================
<XRV7>tracert -a 10.158.1.254 10.79.1.254
traceroute to 10.79.1.254(10.79.1.254), max hops: 30 ,packet length: 40,press CTRL_C to break
1 10.10.3.1 20 ms 40 ms 30 ms
2 10.201.3.5 50 ms 50 ms 40 ms
3 10.10.2.2 70 ms 40 ms 40 ms
4 10.201.2.1 70 ms 30 ms 80 ms
5 10.201.4.2 30 ms 100 ms 60 ms
6 10.10.4.2 90 ms 80 ms 80 ms
<XRV7>
以上是关于BGP的一网双平面规划的主要内容,如果未能解决你的问题,请参考以下文章