华为路由器BGP的路由控制和安全

来源:互联网 发布:微电网储能优化 编辑:程序博客网 时间:2024/04/30 06:28

session 1 BGP路由控制

一、BGP路由的收发过滤

1、针对某个对等体过滤

[AR2]bgp 2

[AR2-bgp]ipv4-family unicast 

[AR4-bgp-af-ipv4]peer 3.3.3.3 filter-policy 2999 export/import             针对于某个对等体进行出向/入向的路由过滤

[AR4-bgp-af-ipv4]quit

2、针对于acl或ip-prefix列表过滤

[AR2]bgp 2

[AR2-bgp]ipv4-family unicast

[AR4-bgp-af-ipv4]filter-policy ip-prefix 1 export {igp id}   针对于匹配前缀列表1的路由进行出向/入向的过滤,可以精确选择对应的igp协议及进程号

[AR4-bgp-af-ipv4]quit

二、BGP路由聚合

1、自动聚合 : [AR4-bgp-af-ipv4]summary automatic             一般都关闭自动聚合路由,防止主类边界

2、手动聚合路由:

[AR2-bgp-af-ipv4]aggregate 100.1.1.0 255.255.255.0 ?
  as-set                       Generate the route with AS-SET path-attribute创建拥有AS-SET属性的聚合路由,用于环路检测
  attribute-policy         Set aggregation attributes         通过route-policy指定聚合路由的属性,后面是router-policy的编号
  detail-suppressed  Filter more detail route from updates 只发布聚合路
  origin-policy              Filter the originate routes of the aggregate   只将router-policy中指定路由策略的路由进行聚合,后面是router-policy的编号
  suppress-policy      Filter more detail route from updates through a Routing  policy    只发布聚合路由和通过router-policy策略被聚合的子路由
  <cr>                           Please press ENTER to execute command 普通的路聚合,将发布聚合路由和子路由


session 2 BGP的安全认证

一、重置BGP各项进程

<AR4>refresh/reset  bgp ?用户视图中执行命令
  IP_ADDR<X.X.X.X>  Specify an IPv4 peer address
  all               All the connections with BGP
  external          External BGP session
  group             BGP sessions for peer group
  internal          Internal BGP session
  ipv6              Specify IPv6 unicast address family
  multicast         Specify IPv4 multicast address family
  vpn-instance      Specify a VPN instance
  vpnv4             Specify VPNv4 address family
<AR4>refresh bgp 

、BGP认证,主要针对于tcp的三次握手,认证失败邻居关系就会停留在Active阶段

1、使用链路密码认证,对等体两端都配置

[AR1-bgp]peer 2.2.2.2 password cipher 123           直接使用链路密码认证  

2、使用keychain秘钥串认证,对等体两端都配置

[AR4]keychain pass mode absolute                           创建名为pass的钥匙串,模式为完全模式

[AR4-keychain]key-id 0   为钥匙串指定key-id

[AR4-keychain-keyid-0]key-string cipher 123            为钥匙串中的第一把钥匙指定密码为123(一个钥匙串中可以有多个钥匙)

[AR4]bgp 34  进入bgpAS34

[AR4-bgp]peer 3.3.3.3 keychain pass                       指定与邻居3.3.3.3认证使用钥匙串pass进行认证

[AR4-bgp]quit


0 0