1. 实验目的
建立路由器AR1和AR2之间的IBGP,使AR2通过IBGP对等体(AR1)获得BGP路由,使AR2能够ping通PC1
2. 组网图
- 路由器AR1和AR2互联,建立IBGP。同时通过vlan10三层接口地址互通
- 路由器AR1下挂PC1,通过网段3.1.1.0/24互通
3. 配置
3.1 AR1
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
3.2 AR2
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
3.3 查看BGP对等体状态
使用命令display bgp peer
,如下出现Established
表示建立成功
3.4 打通AR1和PC1
3.4.1 AR1上配置如下:
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
3.4.2 PC1上配置:
3.4.3 测试AR1和PC1的连通性
从AR1 上ping 3.1.1.2
3.5 添加BGP路由
在AR1上添加BGP路由,发布给AR2,并查看BGP路由表
bgp 100
network 3.1.1.0 24
#
display bgp routing-table
在AR2上查看BGP路由表,并测试和PC1的网络连通性
ps:
还可以在AR1上发布直连路由