基于直连口建BGP
基于直连口建BGP <Huawei>system-viewsysname r1接口配置interfacegigabitethernet 0/0/0ipaddress 10.10.12.1 24interfaceloopback 10ipaddress 10.1.1.1 32interfaceloopback 0ipaddress 10.10.10.1 32interfaceloopback 1ipaddress 10.10.1.1 24ospfnetwork-type broadcast quitBGP基于TCP协议,所以要通BGP先通IGP,配置OSPF承载IBGPospf 1router-id 10.10.10.1authentication-modemd5 1 cipher admin1234network10.10.12.0 0.0.0.255network10.10.10.1 0.0.0.0network10.10.1.0 0.0.0.255network10.1.1.1 0.0.0.0quitquitdisplay ospfinterface//检验OSPF接口配置IBGPbgp 200//创建BGP AS编号200peer10.10.12.2 as-number 200//指定邻居地址 AS编号为本BGP编号 R2<Huawei>system-viewsysname r2配置接口interfaceloopback 0ipaddress 10.10.10.2 32quitinterfacegigabitethernet 0/0/1ipaddress 10.10.12.2 24interfacegigabitethernet 0/0/0ipaddress 10.10.23.2 24quit配置OSPFospf 1router-id 10.10.10.2area 0authentication-modemd5 1 cipher admin1234network10.10.12.0 0.0.0.255quitquitdisplay iprouting-table protocol ospf 配置IBGP及EBGPbgp 200peer10.10.12.1 as-number 200//IBGPpeer10.10.23.3 as-number 100//EBGPBGP宣告参与网络的方法一 network10.1.1.1 32network10.10.1.0 24network10.10.10.1 32network10.10.0.0 16//测试network10.10.10.2 32quitiproute-static 10.10.0.0 16 null 0//测试 <Huawei>system-viewsysname r3配置接口interfaceloopback 0ipaddress 10.10.10.3 32quitinterfacegigabitethernet 0/0/1ipaddress 10.10.23.3 24quit配置EBGPbgp 100peer10.10.23.2 as-number 200network10.10.10.3 32network10.10.23.3 24quitdisplay bgprouting-table R2使用路由引入方式假设BGP的路由有几千上万条之多,一条一个的network宣告进去将会非常不方便,使用路由引入方法。bgp 200import-routeospf 1//在BGP中引入所有OSPF路由network10.10.23.0 24display bgp routing-table BGP Local router ID is 10.10.23.3 Status codes: * - valid, > -best, d - damped, h - history,i - internal, s - suppressed, S - Stale Origin : i - IGP, e- EGP, ? - incomplete Total Number of Routes: 7 Network NextHop MED LocPrf PrefVal Path/Ogn *> 10.1.1.1/32 10.10.23.2 1 0 200? *> 10.10.1.0/24 10.10.23.2 1 0 200? *> 10.10.10.1/32 10.10.23.2 1 0 200? *> 10.10.10.2/32 10.10.23.2 0 0 200i *> 10.10.10.3/32 0.0.0.0 0 0 i *> 10.10.12.0/24 10.10.23.2 0 0 200? *> 10.10.23.0/24 0.0.0.0 0 0 i 测试EBGP R1与R3之间有通信ping -a 10.10.10.3 10.10.10.1PING 10.10.10.1: 56data bytes, press CTRL_C to break Reply from 10.10.10.1:bytes=56 Sequence=1 ttl=254 time=50 ms Reply from 10.10.10.1:bytes=56 Sequence=2 ttl=254 time=40 ms Reply from 10.10.10.1:bytes=56 Sequence=3 ttl=254 time=40 ms Reply from 10.10.10.1:bytes=56 Sequence=4 ttl=254 time=20 ms Reply from 10.10.10.1:bytes=56 Sequence=5 ttl=254 time=20 ms --- 10.10.10.1 ping statistics--- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max =20/34/50 ms
页:
[1]