需求:假设AS65001 网络是 电信网 AS65002 网络是移动网,网段202.106.15.0 是电信业务段,网络202.106.48.0 是移动业务段
互相访问,并且R4能远程控制R1.
R1上配置:
R1#en
R1#conf t
R1(config-if)#inter f1/0 配置IP地址
R1(config-if)#ip address 202.106.16.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter f0/0
R1(config-if)#ip address 202.106.15.11 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter loop 0 配置环回口地址
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#no shut
R1(config)#inter f0/1
R1(config-if)#ip address 202.106.12.1 255.255.255.0
R1(config-if)#no shut
R1(config)#no cdp run
R1(config)#router isis 启动ISIS协议
R1(config-router)#net 49.0001.0001.0001.0001.00 NET地址
R1(config-router)#is-type level-1 IS类型等级是1
R1(config-router)#ex
R1(config)#inter f0/1
R1(config-if)#ip router isis
R1(config-if)#inter f1/0
R1(config-if)#ip router isis
R1(config-if)#inter loop 0
R1(config-if)#ip router isis
R1(config-if)#router bgp 65001 BGP AS65001
R1(config-router)#bgp router-id 1.1.1.1 BGP路由ID
R1(config-router)#neighbor 2.2.2.2 remote-as 65001 建立邻居关系
R1(config-router)#neighbor 2.2.2.2 update-source l 0 更新源为 环回口
R1(config-router)#neighbor 6.6.6.6 remote-as 65001
R1(config-router)#neighbor 6.6.6.6 update-source l 0
*Mar 1 00:26:27.907: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up 与2建立邻居关系
R1(config-router)#
*Mar 1 00:33:30.271: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up 与6建立邻居关系
R1(config-router)#ex
R1(config)#int f0/0
R1(config-if)#vrrp 1 ip 202.106.15.1 VRRP冗余备份
R1(config-if)#vrrp 1 priority 120 优先级为120
R1(config-if)#vrrp 1 preempt 配置抢占
R1(config-if)#ex
R1(config)#track 1 interface f0/1 line-protocol 监控端口
R1(config)#track 2 interface f1/0 line-protocol
R1(config-track)#inter f0/0
R1(config-if)#vrrp 1 track 1
R1(config-if)#vrrp 1 track 2
R1(config)#router bgp 65001
R1(config-router)#network 202.106.15.0 mask 255.255.255.0 发布网络
R1(config)#line vty 0 4 开启远程管理
R1(config-line)#password 110
R1(config-line)#login
R1(config-line)#exit
R1(config)#enable secret 110
R1#conf t
R1(config-if)#inter f1/0 配置IP地址
R1(config-if)#ip address 202.106.16.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter f0/0
R1(config-if)#ip address 202.106.15.11 255.255.255.0
R1(config-if)#no shut
R1(config-if)#inter loop 0 配置环回口地址
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#no shut
R1(config)#inter f0/1
R1(config-if)#ip address 202.106.12.1 255.255.255.0
R1(config-if)#no shut
R1(config)#no cdp run
R1(config)#router isis 启动ISIS协议
R1(config-router)#net 49.0001.0001.0001.0001.00 NET地址
R1(config-router)#is-type level-1 IS类型等级是1
R1(config-router)#ex
R1(config)#inter f0/1
R1(config-if)#ip router isis
R1(config-if)#inter f1/0
R1(config-if)#ip router isis
R1(config-if)#inter loop 0
R1(config-if)#ip router isis
R1(config-if)#router bgp 65001 BGP AS65001
R1(config-router)#bgp router-id 1.1.1.1 BGP路由ID
R1(config-router)#neighbor 2.2.2.2 remote-as 65001 建立邻居关系
R1(config-router)#neighbor 2.2.2.2 update-source l 0 更新源为 环回口
R1(config-router)#neighbor 6.6.6.6 remote-as 65001
R1(config-router)#neighbor 6.6.6.6 update-source l 0
*Mar 1 00:26:27.907: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up 与2建立邻居关系
R1(config-router)#
*Mar 1 00:33:30.271: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up 与6建立邻居关系
R1(config-router)#ex
R1(config)#int f0/0
R1(config-if)#vrrp 1 ip 202.106.15.1 VRRP冗余备份
R1(config-if)#vrrp 1 priority 120 优先级为120
R1(config-if)#vrrp 1 preempt 配置抢占
R1(config-if)#ex
R1(config)#track 1 interface f0/1 line-protocol 监控端口
R1(config)#track 2 interface f1/0 line-protocol
R1(config-track)#inter f0/0
R1(config-if)#vrrp 1 track 1
R1(config-if)#vrrp 1 track 2
R1(config)#router bgp 65001
R1(config-router)#network 202.106.15.0 mask 255.255.255.0 发布网络
R1(config)#line vty 0 4 开启远程管理
R1(config-line)#password 110
R1(config-line)#login
R1(config-line)#exit
R1(config)#enable secret 110
R1#show vrrp br R1是主路由器
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 1 120 3531 Y Master 202.106.15.11 202.106.15.1
Interface Grp Pri Time Own Pre State Master addr Group addr
Fa0/0 1 120 3531 Y Master 202.106.15.11 202.106.15.1
R1#show bgp
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
r>i2.2.2.2/32 2.2.2.2 0 100 0 i
*> 202.106.15.0 0.0.0.0 0 32768 i
*>i202.106.48.0 3.3.3.3 0 100 0 65002 i
r>i2.2.2.2/32 2.2.2.2 0 100 0 i
*> 202.106.15.0 0.0.0.0 0 32768 i
*>i202.106.48.0 3.3.3.3 0 100 0 65002 i
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 邻居关系表
2.2.2.2 4 65001 42 41 5 0 0 00:19:10 2
6.6.6.6 4 65001 31 32 5 0 0 00:27:03 0
R2的配置:
R2>en
R2#conf t
R2(config)#inter f0/0
R2(config-if)#ip address 202.106.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f1/0
R2(config-if)#no switchport
R2(config-if)#ip address 202.106.52.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f1/1
R2(config-if)#no switchport
R2(config-if)#ip address 202.106.26.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f0/1
R2(config-if)#ip address 202.106.23.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loop 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#no cdp run
R2(config)#router isis
R2(config-router)#net 49.0001.0002.0002.0002.00
R2(config-router)#ex
R2(config)#inter f0/0
R2(config-if)#ip router isis
R2(config)#inter f1/0
R2(config-if)#ip router isis
R2(config-if)#inter f1/1
R2(config-if)#ip router isis
R2(config-if)#inter f0/1
R2(config-if)#ip router isis
R2(config-if)#inter loop 0
R2(config-if)#ip router isis
R2(config-if)#router bgp 65001
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 1.1.1.1 remote-as 65001
R2(config-router)#neighbor 1.1.1.1 update-source l 0
*Mar 1 00:26:27.699: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
R2(config-router)#neighbor 5.5.5.5 remote-as 65001
R2(config-router)#neighbor 5.5.5.5 update-source l 0
R2(config-router)#neighbor 6.6.6.6 remote-as 65001
R2(config-router)#neighbor 6.6.6.6 update-source l 0
R2(config-router)#neighbor 3.3.3.3 remote-as 65001
R2(config-router)#neighbor 3.3.3.3 update-source l 0
R2(config-router)#
*Mar 1 00:30:16.359: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R2(config-router)#
*Mar 1 00:32:39.059: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
R2(config-router)#
*Mar 1 00:33:58.743: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R2(config-router)#neighbor 1.1.1.1 route-reflector-client 做成路由反射器
R2(config-router)#bgp cluster-id 10 可以把一个反射器或者簇理解为一个大路由器
R2(config-router)#network 2.2.2.2 mask 255.255.255.255
R2(config-router)#ex
R2(config)#line vty 0 4 开启远程管理
R2(config-line)#password 123
R2(config-line)#login
R2(config-line)#exit
R2(config)#enable secret 123
R3的配置
R2#conf t
R2(config)#inter f0/0
R2(config-if)#ip address 202.106.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f1/0
R2(config-if)#no switchport
R2(config-if)#ip address 202.106.52.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f1/1
R2(config-if)#no switchport
R2(config-if)#ip address 202.106.26.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter f0/1
R2(config-if)#ip address 202.106.23.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#int loop 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#no shut
R2(config-if)#ex
R2(config)#no cdp run
R2(config)#router isis
R2(config-router)#net 49.0001.0002.0002.0002.00
R2(config-router)#ex
R2(config)#inter f0/0
R2(config-if)#ip router isis
R2(config)#inter f1/0
R2(config-if)#ip router isis
R2(config-if)#inter f1/1
R2(config-if)#ip router isis
R2(config-if)#inter f0/1
R2(config-if)#ip router isis
R2(config-if)#inter loop 0
R2(config-if)#ip router isis
R2(config-if)#router bgp 65001
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#neighbor 1.1.1.1 remote-as 65001
R2(config-router)#neighbor 1.1.1.1 update-source l 0
*Mar 1 00:26:27.699: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
R2(config-router)#neighbor 5.5.5.5 remote-as 65001
R2(config-router)#neighbor 5.5.5.5 update-source l 0
R2(config-router)#neighbor 6.6.6.6 remote-as 65001
R2(config-router)#neighbor 6.6.6.6 update-source l 0
R2(config-router)#neighbor 3.3.3.3 remote-as 65001
R2(config-router)#neighbor 3.3.3.3 update-source l 0
R2(config-router)#
*Mar 1 00:30:16.359: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R2(config-router)#
*Mar 1 00:32:39.059: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
R2(config-router)#
*Mar 1 00:33:58.743: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R2(config-router)#neighbor 1.1.1.1 route-reflector-client 做成路由反射器
R2(config-router)#bgp cluster-id 10 可以把一个反射器或者簇理解为一个大路由器
R2(config-router)#network 2.2.2.2 mask 255.255.255.255
R2(config-router)#ex
R2(config)#line vty 0 4 开启远程管理
R2(config-line)#password 123
R2(config-line)#login
R2(config-line)#exit
R2(config)#enable secret 123
R3的配置
R3>en
R3#conf t
R3(config)#no cdp run
R3(config)#inter f0/0
R3(config-if)#ip address 202.106.23.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter f0/1
R3(config-if)#ip address 202.106.34.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter f1/0
R3(config-if)#ip address 202.106.37.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter loop 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router isis
R3(config-router)#net 49.0002.0003.0003.0003.00
R3(config-router)#is-type level-2-only 类型2
(R3(config-router)#ex
R3(config)#inter f0/0
R3(config-if)#ip router isis
R3(config-if)#inter f1/0
R3(config-if)#ip router isis
R3(config-if)#inter loop 0
R3(config-if)#ip router isis
R3(config)#router bgp 65001
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 2.2.2.2 remote-as 65001
R3(config-router)#neighbor 2.2.2.2 update-source l 0
*Mar 1 00:30:16.079: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R3(config-router)#neighbor 7.7.7.7 remote-as 65001
R3(config-router)#neighbor 7.7.7.7 update-source loop 0
R3(config-router)#neighbor 4.4.4.4 remote-as 65002
R3(config-router)#neighbor 4.4.4.4 update-source l 0
R3(config-router)#
*Mar 1 00:35:11.975: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R3(config)#ip route 4.4.4.4 255.255.255.255 202.106.34.4 配置静态路由 2边路由器都要设置
R3config)#router bgp 65001
R3(config-router)#neighbor 4.4.4.4 ebgp-multihop 2 TTL值设置成2 跳数2
R3#conf t
R3(config)#no cdp run
R3(config)#inter f0/0
R3(config-if)#ip address 202.106.23.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter f0/1
R3(config-if)#ip address 202.106.34.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter f1/0
R3(config-if)#ip address 202.106.37.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter loop 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#router isis
R3(config-router)#net 49.0002.0003.0003.0003.00
R3(config-router)#is-type level-2-only 类型2
(R3(config-router)#ex
R3(config)#inter f0/0
R3(config-if)#ip router isis
R3(config-if)#inter f1/0
R3(config-if)#ip router isis
R3(config-if)#inter loop 0
R3(config-if)#ip router isis
R3(config)#router bgp 65001
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 2.2.2.2 remote-as 65001
R3(config-router)#neighbor 2.2.2.2 update-source l 0
*Mar 1 00:30:16.079: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R3(config-router)#neighbor 7.7.7.7 remote-as 65001
R3(config-router)#neighbor 7.7.7.7 update-source loop 0
R3(config-router)#neighbor 4.4.4.4 remote-as 65002
R3(config-router)#neighbor 4.4.4.4 update-source l 0
R3(config-router)#
*Mar 1 00:35:11.975: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R3(config)#ip route 4.4.4.4 255.255.255.255 202.106.34.4 配置静态路由 2边路由器都要设置
R3config)#router bgp 65001
R3(config-router)#neighbor 4.4.4.4 ebgp-multihop 2 TTL值设置成2 跳数2
*Mar 1 00:34:10.268: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
R3(config-router)#neighbor 2.2.2.2 next-hop-self 告诉自己 下一条是2.2.2.2
R3(config-router)#end
R3#write
Building configuration...
[OK]
R3(config-router)#neighbor 2.2.2.2 next-hop-self 告诉自己 下一条是2.2.2.2
R3(config-router)#end
R3#write
Building configuration...
[OK]
R4配置
R4>en
R4#conf t
R4(config)#inter f0/0
R4(config-if)#ip address 202.106.34.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#inter f0/1
R4(config-if)#ip address 202.106.48.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#no cdp run
R4(config)#inter loop 0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
R4(config-if)#no shut
R4(config-if)#router isis
R4(config-router)#net 49.0001.0004.0004.0004.00
R4(config-router)#is-type level-2-only
R4(config-router)#ex
R4(config)#inter f0/1
R4(config-if)#ip router isis
R4(config-if)#inter loop 0
R4(config-if)#ip router isis
R4(config-if)#router bgp 65002
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#neighbor 3.3.3.3 remote-as 65001
R4(config-router)#neighbor 3.3.3.3 update-source l 0
R4(config-router)#neighbor 8.8.8.8 remote-as 65002
R4(config-router)#neighbor 8.8.8.8 update-source l 0
R4(config-router)#
*Mar 1 00:36:37.467: %BGP-5-ADJCHANGE: neighbor 8.8.8.8 Up
R4(config-router)#neighbor 3.3.3.3 ebgp-multihop 2
R4(config-router)#ex
R4(config)#ip route 3.3.3.3 255.255.255.255 202.106.34.3
R4(config)#
*Mar 1 00:38:59.495: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R4(config)#router bgp 65002
R4(config-router)#network 202.106.48.0 mask 255.255.255.0 发布网络断
R4(config-router)#end
R4#conf t
R4(config)#inter f0/0
R4(config-if)#ip address 202.106.34.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#inter f0/1
R4(config-if)#ip address 202.106.48.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#ex
R4(config)#no cdp run
R4(config)#inter loop 0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
R4(config-if)#no shut
R4(config-if)#router isis
R4(config-router)#net 49.0001.0004.0004.0004.00
R4(config-router)#is-type level-2-only
R4(config-router)#ex
R4(config)#inter f0/1
R4(config-if)#ip router isis
R4(config-if)#inter loop 0
R4(config-if)#ip router isis
R4(config-if)#router bgp 65002
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#neighbor 3.3.3.3 remote-as 65001
R4(config-router)#neighbor 3.3.3.3 update-source l 0
R4(config-router)#neighbor 8.8.8.8 remote-as 65002
R4(config-router)#neighbor 8.8.8.8 update-source l 0
R4(config-router)#
*Mar 1 00:36:37.467: %BGP-5-ADJCHANGE: neighbor 8.8.8.8 Up
R4(config-router)#neighbor 3.3.3.3 ebgp-multihop 2
R4(config-router)#ex
R4(config)#ip route 3.3.3.3 255.255.255.255 202.106.34.3
R4(config)#
*Mar 1 00:38:59.495: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R4(config)#router bgp 65002
R4(config-router)#network 202.106.48.0 mask 255.255.255.0 发布网络断
R4(config-router)#end
R5的配置
R5>en
R5#conf t
R5(config)#inter f0/0
R5(config-if)#ip address 202.106.15.55 255.255.255.0
R5(config-if)#no shut
R5(config-if)#inter f0/1
R5(config-if)#ip address 202.106.56.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#inter loop 0
R5(config-if)#ip address 5.5.5.5 255.255.255.255
R5(config-if)#no shut
R5(config-if)#inter f1/0
R5(config-if)#ip address 202.106.52.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config)#no cdp run
R5(config)#router isis
R5(config-router)#net 49.0001.0005.0005.0005.00
R5(config-router)#is-type level-1
R5(config)#inter f0/1
R5(config-if)#ip router isis
R5(config-if)#inter f1/0
R5(config-if)#ip router isis
R5(config-if)#inter loop 0
R5(config-if)#ip router isis
R5(config-if)#router bgp 65001
R5(config-router)#bgp router-id 5.5.5.5
R5(config-router)#neighbor 2.2.2.2 remote-as 65001
R5(config-router)#neighbor 2.2.2.2 update-source l 0
*Mar 1 00:32:38.279: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R5(config-router)#neighbor 6.6.6.6 remote-as 65001
R5(config-router)#neighbor 6.6.6.6 update-source l 0
R5(config-router)#
*Mar 1 00:34:18.087: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R5(config-router)#
*Mar 1 00:41:42.131: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Down Peer closed the session
R5(config-router)#
*Mar 1 00:41:43.787: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R5(config-router)#inter f0/0
R5(config-if)#vrrp 1 ip 202.106.15.1
R5(config-if)#vrrp 1 preempt
R5(config-if)#vrrp 1 priority 115
R5(config-if)#end
R5#write
Building configuration...
[OK]
R5#conf t
R5(config)#inter f0/0
R5(config-if)#ip address 202.106.15.55 255.255.255.0
R5(config-if)#no shut
R5(config-if)#inter f0/1
R5(config-if)#ip address 202.106.56.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#inter loop 0
R5(config-if)#ip address 5.5.5.5 255.255.255.255
R5(config-if)#no shut
R5(config-if)#inter f1/0
R5(config-if)#ip address 202.106.52.5 255.255.255.0
R5(config-if)#no shut
R5(config-if)#ex
R5(config)#no cdp run
R5(config)#router isis
R5(config-router)#net 49.0001.0005.0005.0005.00
R5(config-router)#is-type level-1
R5(config)#inter f0/1
R5(config-if)#ip router isis
R5(config-if)#inter f1/0
R5(config-if)#ip router isis
R5(config-if)#inter loop 0
R5(config-if)#ip router isis
R5(config-if)#router bgp 65001
R5(config-router)#bgp router-id 5.5.5.5
R5(config-router)#neighbor 2.2.2.2 remote-as 65001
R5(config-router)#neighbor 2.2.2.2 update-source l 0
*Mar 1 00:32:38.279: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R5(config-router)#neighbor 6.6.6.6 remote-as 65001
R5(config-router)#neighbor 6.6.6.6 update-source l 0
R5(config-router)#
*Mar 1 00:34:18.087: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R5(config-router)#
*Mar 1 00:41:42.131: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Down Peer closed the session
R5(config-router)#
*Mar 1 00:41:43.787: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R5(config-router)#inter f0/0
R5(config-if)#vrrp 1 ip 202.106.15.1
R5(config-if)#vrrp 1 preempt
R5(config-if)#vrrp 1 priority 115
R5(config-if)#end
R5#write
Building configuration...
[OK]
R5#show vrrp b
Interface Grp Pri Time Own Pre State Master addr Group addr 备份路由器
fa0/0 1 115 3550 Y Backup 202.106.15.11 202.106.15.1
Interface Grp Pri Time Own Pre State Master addr Group addr 备份路由器
fa0/0 1 115 3550 Y Backup 202.106.15.11 202.106.15.1
R6配置
R6>en
R6#conf t
R6(config)#inter f0/0
R6(config-if)#ip address 202.106.56.6 255.255.255.0
R6(config-if)#no shut
R6(config)#no cdp run
R6(config)#inter f0/1
R6(config-if)#ip address 202.106.67.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter f1/1
R6(config-if)#no switchport
R6(config-if)#ip address 202.106.26.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter f1/0
R6(config-if)#no switchport
R6(config-if)#ip address 202.106.16.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter loop 0
R6(config-if)#ip address 6.6.6.6 255.255.255.255
R6(config-if)#no shut
R6(config)#inter f0/0
R6(config-if)#ip router isis
R6(config-if)#inter f0/1
R6(config-if)#ip router isis
R6(config-if)#inter f1/0
R6(config-if)#ip router isis
R6(config-if)#inter f1/1
R6(config-if)#ip router isis
R6(config-if)#inter loop 0
R6(config-if)#ip router isis
R6(config-if)#router bgp 65001
R6(config-router)#bgp router-id 6.6.6.6
R6(config-router)#neighbor 1.1.1.1 remote-as 65001
R6(config-router)#neighbor 1.1.1.1 update-source l 0
R6(config-router)#
*Mar 1 00:33:28.955: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
R6(config-router)#neighbor 2.2.2.2 remote-as 65001
R6(config-router)#neighbor 2.2.2.2 update-source l 0
R6(config-router)#neighbor 5.5.5.5 remote-as 65001
*Mar 1 00:33:57.679: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R6(config-router)#neighbor 5.5.5.5 update-source l 0
R6(config-router)#neighbor 7.7.7.7 remote-as 65001
*Mar 1 00:34:17.823: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
R6(config-router)#neighbor 7.7.7.7 update-source l 0
*Mar 1 00:35:46.483: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R6(config-router)#neighbor 5.5.5.5 route-reflector-client
R6(config-router)#bgp cluster-id 10
R6(config-router)#neighbor 5.5.5.5 next-hop-self
R6(config-router)#end
R6#write
Building configuration...
R6#conf t
R6(config)#inter f0/0
R6(config-if)#ip address 202.106.56.6 255.255.255.0
R6(config-if)#no shut
R6(config)#no cdp run
R6(config)#inter f0/1
R6(config-if)#ip address 202.106.67.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter f1/1
R6(config-if)#no switchport
R6(config-if)#ip address 202.106.26.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter f1/0
R6(config-if)#no switchport
R6(config-if)#ip address 202.106.16.6 255.255.255.0
R6(config-if)#no shut
R6(config-if)#inter loop 0
R6(config-if)#ip address 6.6.6.6 255.255.255.255
R6(config-if)#no shut
R6(config)#inter f0/0
R6(config-if)#ip router isis
R6(config-if)#inter f0/1
R6(config-if)#ip router isis
R6(config-if)#inter f1/0
R6(config-if)#ip router isis
R6(config-if)#inter f1/1
R6(config-if)#ip router isis
R6(config-if)#inter loop 0
R6(config-if)#ip router isis
R6(config-if)#router bgp 65001
R6(config-router)#bgp router-id 6.6.6.6
R6(config-router)#neighbor 1.1.1.1 remote-as 65001
R6(config-router)#neighbor 1.1.1.1 update-source l 0
R6(config-router)#
*Mar 1 00:33:28.955: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
R6(config-router)#neighbor 2.2.2.2 remote-as 65001
R6(config-router)#neighbor 2.2.2.2 update-source l 0
R6(config-router)#neighbor 5.5.5.5 remote-as 65001
*Mar 1 00:33:57.679: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up
R6(config-router)#neighbor 5.5.5.5 update-source l 0
R6(config-router)#neighbor 7.7.7.7 remote-as 65001
*Mar 1 00:34:17.823: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Up
R6(config-router)#neighbor 7.7.7.7 update-source l 0
*Mar 1 00:35:46.483: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R6(config-router)#neighbor 5.5.5.5 route-reflector-client
R6(config-router)#bgp cluster-id 10
R6(config-router)#neighbor 5.5.5.5 next-hop-self
R6(config-router)#end
R6#write
Building configuration...
R7配置
R7>en
R7#conf t
R7(config)#no cdp run
R7(config)#inter f0/0
R7(config-if)#ip address 202.106.67.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter f0/1
R7(config-if)#ip address 202.106.78.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter f1/0
R7(config-if)#ip add 202.106.37.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter loop 0
R7(config-if)#ip address 7.7.7.7 255.255.255.255
R7(config-if)#no shut
R7(config-if)#router isi
R7(config-router)#net 49.0002.0007.0007.0007.00
R7(config-router)#is-type level-2-only
R7(config-router)#ex
R7(config-if)#inter f0/0
R7(config-if)#ip router isis
R7(config-if)#inter f1/0
R7(config-if)#ip router isis
R7(config-if)#inter loop 0
R7(config-if)#ip router isis
R7(config)#router bgp 65001
R7(config-router)#bgp rout
R7(config-router)#bgp router-id 7.7.7.7
R7(config-router)#neighbor 3.3.3.3 remote-as 65001
R7(config-router)#neighbor 3.3.3.3 update-source l 0
*Mar 1 00:35:10.983: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R7(config-router)#neighbor 6.6.6.6 remote-as 65001
R7(config-router)#neighbor 6.6.6.6 update-source l 0
R7(config-router)#neighbor 8.8.8.8 remote-as 65002
R7(config-router)#neighbor 8.8.8.8 update-source l 0
*Mar 1 00:35:46.287: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R7(config-router)#neighbor 8.8.8.8 ebgp-multihop 2
R7(config-router)#ex
R7(config)#ip route 8.8.8.8 255.255.255.255 202.106.78.8
R7(config)#
*Mar 1 00:40:02.355: %BGP-5-ADJCHANGE: neighbor 8.8.8.8 Up
R7(config)#end
R7#
R7#write
Building configuration...
R7#conf t
R7(config)#no cdp run
R7(config)#inter f0/0
R7(config-if)#ip address 202.106.67.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter f0/1
R7(config-if)#ip address 202.106.78.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter f1/0
R7(config-if)#ip add 202.106.37.7 255.255.255.0
R7(config-if)#no shut
R7(config-if)#inter loop 0
R7(config-if)#ip address 7.7.7.7 255.255.255.255
R7(config-if)#no shut
R7(config-if)#router isi
R7(config-router)#net 49.0002.0007.0007.0007.00
R7(config-router)#is-type level-2-only
R7(config-router)#ex
R7(config-if)#inter f0/0
R7(config-if)#ip router isis
R7(config-if)#inter f1/0
R7(config-if)#ip router isis
R7(config-if)#inter loop 0
R7(config-if)#ip router isis
R7(config)#router bgp 65001
R7(config-router)#bgp rout
R7(config-router)#bgp router-id 7.7.7.7
R7(config-router)#neighbor 3.3.3.3 remote-as 65001
R7(config-router)#neighbor 3.3.3.3 update-source l 0
*Mar 1 00:35:10.983: %BGP-5-ADJCHANGE: neighbor 3.3.3.3 Up
R7(config-router)#neighbor 6.6.6.6 remote-as 65001
R7(config-router)#neighbor 6.6.6.6 update-source l 0
R7(config-router)#neighbor 8.8.8.8 remote-as 65002
R7(config-router)#neighbor 8.8.8.8 update-source l 0
*Mar 1 00:35:46.287: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Up
R7(config-router)#neighbor 8.8.8.8 ebgp-multihop 2
R7(config-router)#ex
R7(config)#ip route 8.8.8.8 255.255.255.255 202.106.78.8
R7(config)#
*Mar 1 00:40:02.355: %BGP-5-ADJCHANGE: neighbor 8.8.8.8 Up
R7(config)#end
R7#
R7#write
Building configuration...
R8配置
R8>en
R8#conf t
R8(config)#no cdp run
R8(config)#inter f0/0
R8(config-if)#ip address 202.106.78.8 255.255.255.0
R8(config-if)#no shut
R8(config-if)#inter f0/1
R8(config-if)#ip address 202.106.48.8 255.255.255.0
R8(config-if)#no shut
R8(config-if)#inter loop 0
R8(config-if)#ip address 8.8.8.8 255.255.255.255
R8(config-if)#no shut
R8(config-if)#router isis
R8(config-router)#net 49.0001.0008.0008.0008.00
R8(config-router)#is-type level-2-only
R8(config-router)#ex
R8(config)#inter f0/1
R8(config-if)#ip router isis
R8(config-if)#inter loo 0
R8(config-if)#ip router isis
R8(config-if)#router bgp 65002
R8(config-router)#bgp router-id 8.8.8.8
R8(config-router)#neighbor 4.4.4.4 remote-as 65002
R8(config-router)#neighbor 4.4.4.4 update-source l 0
*Mar 1 00:36:36.471: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
R8(config-router)#neighbor 7.7.7.7 remote-as 65001
R8(config-router)#neighbor 7.7.7.7 update-source l 0
R8(config-router)#neighbor 7.7.7.7 ebgp-multihop 2
R8(config)#ip route 7.7.7.7 255.255.255.255 202.106.78.7
*Mar 1 00:40:02.115: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R8(config)#end
R8#write
Building configuration...
[OK]
R8#conf t
R8(config)#no cdp run
R8(config)#inter f0/0
R8(config-if)#ip address 202.106.78.8 255.255.255.0
R8(config-if)#no shut
R8(config-if)#inter f0/1
R8(config-if)#ip address 202.106.48.8 255.255.255.0
R8(config-if)#no shut
R8(config-if)#inter loop 0
R8(config-if)#ip address 8.8.8.8 255.255.255.255
R8(config-if)#no shut
R8(config-if)#router isis
R8(config-router)#net 49.0001.0008.0008.0008.00
R8(config-router)#is-type level-2-only
R8(config-router)#ex
R8(config)#inter f0/1
R8(config-if)#ip router isis
R8(config-if)#inter loo 0
R8(config-if)#ip router isis
R8(config-if)#router bgp 65002
R8(config-router)#bgp router-id 8.8.8.8
R8(config-router)#neighbor 4.4.4.4 remote-as 65002
R8(config-router)#neighbor 4.4.4.4 update-source l 0
*Mar 1 00:36:36.471: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up
R8(config-router)#neighbor 7.7.7.7 remote-as 65001
R8(config-router)#neighbor 7.7.7.7 update-source l 0
R8(config-router)#neighbor 7.7.7.7 ebgp-multihop 2
R8(config)#ip route 7.7.7.7 255.255.255.255 202.106.78.7
*Mar 1 00:40:02.115: %BGP-5-ADJCHANGE: neighbor 7.7.7.7 Up
R8(config)#end
R8#write
Building configuration...
[OK]
最后测试R4#ping 202.106.15.11 so
R4#ping 202.106.15.11 source 202.106.48.4 用源地址202.106.48.4 ping 202.106.15.11
R4#ping 202.106.15.11 source 202.106.48.4 用源地址202.106.48.4 ping 202.106.15.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.106.15.11, timeout is 2 seconds:
Packet sent with a source address of 202.106.48.4
!!!!!
Sending 5, 100-byte ICMP Echos to 202.106.15.11, timeout is 2 seconds:
Packet sent with a source address of 202.106.48.4
!!!!!
R4#telnet 2.2.2.2 /source-interface f0/1 远程 以2.2.2.2 做跳板 远程1.1.1.1
rying 2.2.2.2 ... Open
rying 2.2.2.2 ... Open
User Access Verification
Password:
R2>telnet 1.1.1.1
Trying 1.1.1.1 ... Open
R2>telnet 1.1.1.1
Trying 1.1.1.1 ... Open
User Access Verification 发现进去了
Password:
R1>en
Password:
R1#
R1>en
Password:
R1#
启动BGP进程手动指定 RID
手动指邻居(直连邻居和环回口邻居)
邻居shut(邻居信息会保留)
BGP源检测:检查收到包的源地址是不是本地neighbor的地址,不是不能建立邻居(update-source)
随机选择一方建立show tcp bri
两个AS之间有两条或以上物理链路里用环回口建立EBGP邻居,此时要解决邻居可达;更新源;TTL为1问题。
两边都指默认路由不能建立邻居关系
BGP中network 一条路由就是要通告这条路由,并且该路由一定要在本地路由表中存在,且要跟实际掩码。一分钟的更新时间
从EBGP邻居学到的路由只要下一跳可达就可以优化。
从IBGP邻居学到的路由要优化需要下一跳可达(在AS边界上next-hop-self);和IGP同步(取消同步条件)。
手动指邻居(直连邻居和环回口邻居)
邻居shut(邻居信息会保留)
BGP源检测:检查收到包的源地址是不是本地neighbor的地址,不是不能建立邻居(update-source)
随机选择一方建立show tcp bri
两个AS之间有两条或以上物理链路里用环回口建立EBGP邻居,此时要解决邻居可达;更新源;TTL为1问题。
两边都指默认路由不能建立邻居关系
BGP中network 一条路由就是要通告这条路由,并且该路由一定要在本地路由表中存在,且要跟实际掩码。一分钟的更新时间
从EBGP邻居学到的路由只要下一跳可达就可以优化。
从IBGP邻居学到的路由要优化需要下一跳可达(在AS边界上next-hop-self);和IGP同步(取消同步条件)。
路由反映器:RR从EBGP邻居收到的路由会转发给客户端及非客户端;RR客户端收到的路由会转发给其它客户端,非客户端和EBGP邻居;RR从非客户端收到的路由会转发给客户端和EBGP邻居,不会给其它非客户端。
把一个反射器或者簇理解为一个大路由器,但是成员只有RR知道。命令:neighbor ip route-reflector-client
把一个反射器或者簇理解为一个大路由器,但是成员只有RR知道。命令:neighbor ip route-reflector-client
来源:oschina
链接:https://my.oschina.net/u/4360424/blog/4322236