DEV Community

Aleets Vaaz
Aleets Vaaz

Posted on

Protocolo BGP ejemplo

hola
*Configuración BGP básico *

enable
conf t
hostname R1

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.1 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.13.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.1.1.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP

router bgp 100
 neighbor 192.168.12.2 remote-as 200
 neighbor 192.168.13.2 remote-as 300
 neighbor 192.168.14.2 remote-as 400
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 10.1.1.0 mask 255.255.255.0
exit

-------------------------------------R2----------------------------------------
enable
conf t
hostname R2

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.2.2.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 200
 neighbor 192.168.12.1 remote-as 100
 neighbor 192.168.23.2 remote-as 300
 neighbor 192.168.24.2 remote-as 600
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 10.2.2.0 mask 255.255.255.0
exit
-------------------------------------R3----------------------------------------
enable
conf t
hostname R3

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.13.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.3.3.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 300
 neighbor 192.168.13.1 remote-as 100
 neighbor 192.168.23.1 remote-as 200
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 10.3.3.0 mask 255.255.255.0
exit

-------------------------------------R4----------------------------------------
enable
conf t
hostname R4

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.1 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.11.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 400
 neighbor 172.16.10.2 remote-as 500
 neighbor 172.16.11.2 remote-as 600
 neighbor 192.168.14.1 remote-as 100
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.11.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 192.168.1.0 mask 255.255.255.0
exit

-------------------------------------R5----------------------------------------
enable
conf t
hostname R5

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.2.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 500
 neighbor 172.16.10.1 remote-as 400
 neighbor 172.16.12.2 remote-as 600
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.2.0 mask 255.255.255.0
exit

-------------------------------------R6----------------------------------------
enable
conf t
hostname R6

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.11.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.2 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.3.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 600
 neighbor 172.16.11.1 remote-as 400
 neighbor 172.16.12.1 remote-as 500
 neighbor 192.168.24.1 remote-as 200
 network 172.16.11.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 192.168.3.0 mask 255.255.255.0
exit




--------------------------------------
show run 
show ip route 

Enter fullscreen mode Exit fullscreen mode

** Configuración BGP avanzado **

-------------------------------------R1----------------------------------------
enable
conf t
hostname R1

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.1 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.13.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.1.1.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 100
 neighbor 192.168.12.2 remote-as 200
 neighbor 192.168.12.2 send-community
 neighbor 192.168.13.2 remote-as 300
 neighbor 192.168.13.2 send-community
 neighbor 192.168.14.2 remote-as 400
 neighbor 192.168.14.2 send-community
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 10.1.1.0 mask 255.255.255.0
 bgp community new-format
 ip bgp-community new-format
exit

# Preferencia y negación de rutas
ip community-list 1 permit 100:100
ip community-list 2 deny 100:200

route-map PREFERENCIA permit 10
 match community 1
 set local-preference 200
exit
route-map NEGAR deny 10
 match community 2
exit

-------------------------------------R2----------------------------------------
enable
conf t
hostname R2

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.2.2.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 200
 neighbor 192.168.12.1 remote-as 100
 neighbor 192.168.12.1 send-community
 neighbor 192.168.23.2 remote-as 300
 neighbor 192.168.23.2 send-community
 neighbor 192.168.24.2 remote-as 600
 neighbor 192.168.24.2 send-community
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 10.2.2.0 mask 255.255.255.0
exit

-------------------------------------R3----------------------------------------
enable
conf t
hostname R3

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.13.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.3.3.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 300
 neighbor 192.168.13.1 remote-as 100
 neighbor 192.168.13.1 send-community
 neighbor 192.168.23.1 remote-as 200
 neighbor 192.168.23.1 send-community
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 10.3.3.0 mask 255.255.255.0
exit

-------------------------------------R4----------------------------------------
enable
conf t
hostname R4

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.1 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.11.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 400
 neighbor 172.16.10.2 remote-as 500
 neighbor 172.16.10.2 send-community
 neighbor 172.16.11.2 remote-as 600
 neighbor 172.16.11.2 send-community
 neighbor 192.168.14.1 remote-as 100
 neighbor 192.168.14.1 send-community
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.11.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 192.168.1.0 mask 255.255.255.0
exit

-------------------------------------R5----------------------------------------
enable
conf t
hostname R5

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.2.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 500
 neighbor 172.16.10.1 remote-as 400
 neighbor 172.16.10.1 send-community
 neighbor 172.16.12.2 remote-as 600
 neighbor 172.16.12.2 send-community
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.2.0 mask 255.255.255.0
exit

-------------------------------------R6----------------------------------------
enable
conf t
hostname R6

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.11.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.2 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.3.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 600
 neighbor 172.16.11.1 remote-as 400
 neighbor 172.16.11.1 send-community
 neighbor 172.16.12.1 remote-as 500
 neighbor 172.16.12.1 send-community
 neighbor 192.168.24.1 remote-as 200
 neighbor 192.168.24.1 send-community
 network 172.16.11.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 192.168.3.0 mask 255.255.255.0
exit
Enter fullscreen mode Exit fullscreen mode

Configuración de BGP básico + ACl's

enable
conf t
hostname R1

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.1 255.255.255.0
 ip access-group BLOCK_R2_TO_R1 in
 no shutdown
exit
interface s0/0/1
 ip address 192.168.13.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.1.1.1 255.255.255.0
 no shutdown
exit

ip access-list extended BLOCK_R2_TO_R1
 deny ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255
 permit ip any any

# Configuración de BGP

router bgp 100
 neighbor 192.168.12.2 remote-as 200
 neighbor 192.168.13.2 remote-as 300
 neighbor 192.168.14.2 remote-as 400
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 10.1.1.0 mask 255.255.255.0
exit

-------------------------------------R2----------------------------------------
enable
conf t
hostname R2

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.12.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.1 255.255.255.0
 ip access-group BLOCK_R3_TO_R2 in
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 10.2.2.1 255.255.255.0
 no shutdown
exit

ip access-list extended BLOCK_R3_TO_R2
 deny ip 10.3.3.0 0.0.0.255 10.2.2.0 0.0.0.255
 permit ip any any

# Configuración de BGP
router bgp 200
 neighbor 192.168.12.1 remote-as 100
 neighbor 192.168.23.2 remote-as 300
 neighbor 192.168.24.2 remote-as 600
 network 192.168.12.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 10.2.2.0 mask 255.255.255.0
exit
-------------------------------------R3----------------------------------------
enable
conf t
hostname R3

# Configuración de interfaces
interface s0/0/0
 ip address 192.168.13.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 192.168.23.2 255.255.255.0
 ip access-group BLOCK_R4_TO_R3 in
 no shutdown
exit
interface g0/0
 ip address 10.3.3.1 255.255.255.0
 no shutdown
exit

ip access-list extended BLOCK_R4_TO_R3
 deny ip 192.168.1.0 0.0.0.255 10.3.3.0 0.0.0.255
 permit ip any any

# Configuración de BGP
router bgp 300
 neighbor 192.168.13.1 remote-as 100
 neighbor 192.168.23.1 remote-as 200
 network 192.168.13.0 mask 255.255.255.0
 network 192.168.23.0 mask 255.255.255.0
 network 10.3.3.0 mask 255.255.255.0
exit

-------------------------------------R4----------------------------------------
enable
conf t
hostname R4

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.1 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.11.1 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.14.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 400
 neighbor 172.16.10.2 remote-as 500
 neighbor 172.16.11.2 remote-as 600
 neighbor 192.168.14.1 remote-as 100
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.11.0 mask 255.255.255.0
 network 192.168.14.0 mask 255.255.255.0
 network 192.168.1.0 mask 255.255.255.0
exit

-------------------------------------R5----------------------------------------
enable
conf t
hostname R5

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.10.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.1 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.2.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 500
 neighbor 172.16.10.1 remote-as 400
 neighbor 172.16.12.2 remote-as 600
 network 172.16.10.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.2.0 mask 255.255.255.0
exit

-------------------------------------R6----------------------------------------
enable
conf t
hostname R6

# Configuración de interfaces
interface s0/0/0
 ip address 172.16.11.2 255.255.255.0
 no shutdown
exit
interface s0/0/1
 ip address 172.16.12.2 255.255.255.0
 no shutdown
exit
interface s0/1/0
 ip address 192.168.24.2 255.255.255.0
 no shutdown
exit
interface g0/0
 ip address 192.168.3.1 255.255.255.0
 no shutdown
exit

# Configuración de BGP
router bgp 600
 neighbor 172.16.11.1 remote-as 400
 neighbor 172.16.12.1 remote-as 500
 neighbor 192.168.24.1 remote-as 200
 network 172.16.11.0 mask 255.255.255.0
 network 172.16.12.0 mask 255.255.255.0
 network 192.168.24.0 mask 255.255.255.0
 network 192.168.3.0 mask 255.255.255.0
exit

Enter fullscreen mode Exit fullscreen mode

Top comments (0)