1.传输协议:TCP 端口号179
2.BGP是外部路由协议,用来在AS之间传递路由信息
3.是一种增强的路径矢量路由协议
4.拥有可靠的路由更新机制
5.具备丰富的metric度量方法
6.无环路协议设计
7.为路由条目附带多种属性信息
8.丰富的路由过滤和路由策略
9.无需周期性更新
10.路由更新时只发送增量路由
11.周期性发送keepAlive报文以保持TCP连通性
1.从IBGP对等体获取的BGP路由,BGP设备只传给它的EBGP对等体
2.从EBGP对等体获得的BGP路由,BGP设备传递给它所有的EBGP IBGP对等体
3.当存在多条到同一目的的地址的有效路由的时,BGP设备只将最优路由发布给对等体
4.路由更新时,BGP设备只发送更新的BGP路由
5.所有对等体发送的路由,BGP都会接收
6.所有EBGP对等体在传输的过程中下一跳改变
7.所有IBGP对等体在传输过程中下一跳不变
8.默认EBGP传递时TTL值为1
9.默认IBGP传递时TTL值为255
1.所有设备必打命令R1为例
undo terminal monitor ——关闭弹屏
Info: Current terminal monitor is off.
sys
r1]user-interface console 0
[r1-ui-console0]id
[r1-ui-console0]idle-timeout 0 0——启用永不超时
[r1-ui-console0]quit
端口配置
R1
[r1]int g0/0/0——进入接口
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24——配置地址
[r1-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 13.1.1.1 24
[r1-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r1-GigabitEthernet0/0/1]int loop0
[r1-LoopBack0]ip add 1.1.1.1 32
[r1-LoopBack0]quit
R2——————注意.R2.R3,R4是同一区域需要OSPF
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[r2-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 24.1.1.2 24
[r2-GigabitEthernet0/0/1]int loop0
[r2-LoopBack0]ip add 2.2.2.2 32
[r2-LoopBack0]int g0/0/1
[r2-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r2-GigabitEthernet0/0/1]quit
[r2]ospf——进入
[r2-ospf-1]are
[r2-ospf-1]area 0——区域
[r2-ospf-1-area-0.0.0.0]ne
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0——宣告自身网段
[r2-ospf-1-area-0.0.0.0]nr
[r2-ospf-1-area-0.0.0.0]ne
[r2-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]
R3
int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 13.1.1.3 24
[r3-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.1.1.3 24
[r3-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r3-GigabitEthernet0/0/1]int loop0
[r3-LoopBack0]ip add 3.3.3.3 32
[r3-LoopBack0]quit
[r3]ospf
[r3-ospf-1]are
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]ne
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]ne
[r3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]quit
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 24.1.1.4 24
[r4-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 34.1.1.4 24
[r4-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[r4-GigabitEthernet0/0/1]int loop0
[r4-LoopBack0]ip add 4.4.4.4 32
[r4-LoopBack0]quit
[r4]ospf
[r4-ospf-1]ar
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]ne
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]ne
[r4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]ne
[r4-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]quit
[r4-ospf-1]quit
建立邻居关系——以上命令基础上
R1
[r1]bgp 100——进入BGP
[r1-bgp]router-id 1.1.1.1——配置地址
[r1-bgp]peer 2.2.2.2 as-number 200 ——建立邻居
[r1-bgp]peer 2.2.2.2 connect-interface LoopBack 0——环回口建立
[r1-bgp]peer 2.2.2.2 ebgp-max-hop 255——更改跳数EBGP默认一跳
[r1-bgp]peer 3.3.3.3 as-number 200
[r1-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r1-bgp]peer 3.3.3.3 ebgp-max-hop 255
[r1]ip route-static 2.2.2.2 32 12.1.1.2——EBGP需要静态路由学习对等体
[r1]ip route-static 3.3.3.3 32 13.1.1.3
[r1]bgp 100
[r1-bgp]network 1.1.1.1 32——宣告本身网段及对等体环回地址
[r1-bgp]network 2.2.2.2 32
[r1-bgp]network 3.3.3.3 32
[r1-bgp]network 13.1.1.0 24
[r1-bgp]network 12.1.1.0 24
R2
[r2]bgp 200
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 1.1.1.1 as-number 100
[r2-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[r2-bgp]peer 1.1.1.1 ebgp-max-hop 255
[r2-bgp]peer 3.3.3.3 as-number 200
[r2-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r2-bgp]peer 3.3.3.3 next-hop-local
[r2-bgp]peer 4.4.4.4 as-number 200
[r2-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r2-bgp]peer 4.4.4.4 next-hop-local
[r2-bgp]
[r2-bgp]network 2.2.2.2 32
[r2-bgp]network 1.1.1.1 32
Info: The network does not exist.
[r2-bgp]quit
[r2]ip route-static 1.1.1.1 32 12.1.1.1
[r2]bgp 200
[r2-bgp]network 1.1.1.1 32
bgp]network 2.2.2.2 32
[r2-bgp]network 3.3.3.3 32
[r2-bgp]network 24.1.1.0 24
[r2-bgp]network 12.1.1.0 24
[r2-bgp]quit
R3
[r3]bgp 200
[r3-bgp]router
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 2.2.2.2 as
[r3-bgp]peer 2.2.2.2 as-number 200
[r3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[r3-bgp]peer 2.2.2.2 next-hop-local
[r3-bgp]peer 4.4.4.4 as-number 200
[r3-bgp]peer 4.4.4.4 connect-interface l
[r3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[r3-bgp]peer 4.4.4.4 next-hop-local
[r3-bgp]peer 1.1.1.1 as-number 100
[r3-bgp]peer 1.1.1.1 connect-interface LoopBack 0
[r3-bgp]peer 1.1.1.1 ebgp-max-hop 255
[r3-bgp]network 1.1.1.1 32
[r3-bgp]network 13.1.1.0 24
[r3-bgp]network 4.4.4.4 32
[r3-bgp]network 34.1.1.0 24
[r3-bgp]quit
R4
[r4]bgp 200
[r4-bgp]router-id 4.4.4.4
r4-bgp]peer 3.3.3.3 as-number 200
[r4-bgp]peer 3.3.3.3 connect-interface LoopBack 0
[r4-bgp]peer 2.2.2.2 as-number 200
[r4-bgp]peer 2.2.2.2 connect-interface LoopBack 0
r4-bgp]network 4.4.4.4 32
[r4-bgp]network 3.3.3.3 32
[r4-bgp]network 2.2.2.2 32
[r4-bgp]network 24.1.1.0 24
[r4-bgp]network 34.1.1.0 24
[r4-bgp]quit