建立路由器AR1和AR2之间的IBGP,使AR2通过IBGP对等体(AR1)获得BGP路由,使AR2能够ping通PC1
system-view
sysname RouterA
#
interface LoopBack 0
ip address 1.1.1.1 32
quit
#
display router id
#
vlan 10
quit
interface Vlanif 10
ip address 2.1.1.11 24
quit
#
interface Ethernet0/0/0
port link-type trunk
port trunk allow-pass vlan 10
quit
#
bgp 100
peer 2.1.1.12 as-number 100
quit
system-view
sysname RouterB
#
interface LoopBack 0
ip address 2.2.2.2 32
quit
#
display router id
#
vlan 10
quit
interface Vlanif 10
ip address 2.1.1.12 24
quit
#
interface Ethernet0/0/0
port link-type trunk
port trunk allow-pass vlan 10
quit
#
bgp 100
peer 2.1.1.11 as-number 100
quit
使用命令display bgp peer
,如下出现Established
表示建立成功
vlan 20
quit
interface Vlanif 20
ip address 3.1.1.1 24
quit
#
interface Ethernet0/0/1
port link-type access
port default vlan 20
quit
从AR1 上ping 3.1.1.2
在AR1上添加BGP路由,发布给AR2,并查看BGP路由表
bgp 100
network 3.1.1.0 24
#
display bgp routing-table
在AR2上查看BGP路由表,并测试和PC1的网络连通性
ps:
还可以在AR1上发布直连路由