Cấu Hình-BGP

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

-Khi thay đổi next-hop thì ta phải clear nó để nó nhận lại next-hop mới:

Soft out gửi route của nó cho các neighbor


Soft in là bắt các neighbor gửi route cho nó.
Route Refresh khi các router nó hỗ trợ thì gõ lệnh ở dưới là các neighbor
tự gửi lại route
R1#clear ip bgp { Neighbor} soft in

-------STEP 1: dat ip--------


=====R1====
int l1
ip add 1.1.1.1 255.255.255.255
exit
int l10
ip add 10.10.10.10 255.255.255.255
exit
int e0/0
no shut
ip add 192.168.12.1 255.255.255.0
exit
ip route 2.2.2.2 255.255.255.255 192.168.12.2
=====R2====
int l2
ip add 2.2.2.2 255.255.255.255
exit
int e0/0
no shut
ip add 192.168.12.2 255.255.255.0
exit
int e0/1
no shut
ip add 192.168.23.2 255.255.255.0
exit
ip route 1.1.1.1 255.255.255.255 192.168.12.1
=====R3====
int l3
ip add 3.3.3.3 255.255.255.255
exit
int e0/1
no shut
ip add 192.168.34.3 255.255.255.0
exit
int e0/0
no shut
ip add 192.168.23.3 255.255.255.0
exit
=====R4====
int l4
ip add 4.4.4.4 255.255.255.255
exit
int e0/0
no shut
ip add 192.168.34.4 255.255.255.0
exit
int e0/1
no shut
ip add 192.168.45.4 255.255.255.0
exit
ip route 5.5.5.5 255.255.255.255 192.168.45.5
=====R5====
int l5
ip add 5.5.5.5 255.255.255.255
exit
int l50
ip add 50.50.50.50 255.255.255.255
exit
int e0/0
no shut
ip add 192.168.45.5 255.255.255.0
exit
ip route 4.4.4.4 255.255.255.255 192.168.45.4

----------Step 2: OSPF-------
=====R2=====
router os 1
network 192.168.23.0 0.0.0.255 a 0
network 2.2.2.2 0.0.0.0 a 0
exit
=====R3=====
router os 1
network 192.168.23.0 0.0.0.255 a 0
network 192.168.34.0 0.0.0.255 a 0
network 3.3.3.3 0.0.0.0 a 0
exit
=====R4=====
router os 1
network 192.168.34.0 0.0.0.255 a 0
network 4.4.4.4 0.0.0.0 a 0
exit

---------STep 3: BGP-------
======R1=====
router bgp 10
neighbor 2.2.2.2 remote-as 234
neighbor 2.2.2.2 update-source l1
neighbor 2.2.2.2 ebgp-multihop 2
network 10.10.10.10 mask 255.255.255.255
exit
======R2=====
router bgp 234
neighbor 1.1.1.1 remote-as 10
neighbor 1.1.1.1 update-source l2
neighbor 1.1.1.1 ebgp-multihop
neighbor 3.3.3.3 remote-as 234
neighbor 3.3.3.3 update-source l2
neighbor 4.4.4.4 remote-as 234
neighbor 4.4.4.4 update-source l2
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 next-hop-self
exit
======R3=====
router bgp 234
neighbor 2.2.2.2 remote-as 234
neighbor 2.2.2.2 update-source l3
neighbor 4.4.4.4 remote-as 234
neighbor 4.4.4.4 update-source l3
end
clear ip bgp 2.2.2.2 soft in
======R4========
router bgp 234
neighbor 5.5.5.5 remote-as 50
neighbor 5.5.5.5 update-source l4
neighbor 5.5.5.5 disable-conected-check
neighbor 3.3.3.3 remote-as 234
neighbor 3.3.3.3 update-source l4
neighbor 2.2.2.2 remote-as 234
neighbor 2.2.2.2 update-source l4
end
clear ip bgp 2.2.2.2 soft in
======R5=====
router bgp 50
neighbor 4.4.4.4 remote-as 234
neighbor 4.4.4.4 update-source l5
neighbor 4.4.4.4 disable-conected-check (Hoac dung ebgp-multihop) )
network 50.50.50.50 mask 255.255.255.255
exit

==========R4 để R2 và R3 học mạng lo50 next-hop dùng route-


map======================
------R4-----(Khi dung next-hop-self thì nó bị cố định còn khi dùng route-map thì
ta có thể thay đổi tùy ý mình)
router bgp 234
neighbor 3.3.3.3 route-map {name} out
neighbor 2.2.2.2 route-map {name} out
exit
route-map {name} permit 10
set next-hop A.B.C.D(bất kì nhưng phải phù hợp với 2 và 3)
====Cấu hình Route Reflector=====
Thay vì cấu hình full-mesh thì t dùng Reflector.

You might also like