Home BGP Configurations Cisco 1-3-1. Cisco Single BGP with Origin value

Main Menu

 
PDF Print E-mail

1-3-1. Cisco Single BGP with Origin value


   
  • ISPs : 1
  • WAN links : 1
  • CPE : 1
  • PE : 1
  • Device : Cisco router with LAN/WAN ports.
  • WAN / Serial IP : 10.20.1.0/30 (mask 255.255.255.252)
  • LAN / Ethernet IP : 100.100.1000.0/24 (mask 255.255.255.0)
  • Receiving Route : Default route only
  • Memory : Full route(recommend 512M), partial route
    (recommend 128-256M)
  • LAN : ISP (AS20) and Customer (AS10)
  • Comments: If you have only single link with ISP, you don't really need BGP protocol at all. Better to use just default route to save even bandwidth. Consult with professionals if really need it. This article is shown for educational purpose.

 

BGP sample configuration 1-4-1

 

 

Lowest Origin Type is one of important criteria for BGP best path selection.

 – Prefer the path with the lowest origin type: IGP is lower than EGP, and EGP is lower than INCOMPLETE. (IGP < EGP < Incomplete)
– IGP origin is created when there is a ‘network statement’
– EGP origin is created via ‘redistribute
– Incomplete origin is created via ‘redistribute

ciscopic.png
[CPE/Customer Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CPE
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
 ip address 100.100.100.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 ip address 10.20.1.1 255.255.255.252
 load-interval 30
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 load-interval 30
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
router bgp 10
 no synchronization
 bgp log-neighbor-changes
 network 100.100.100.0 mask 255.255.255.0
 redistribute connected
 neighbor 10.20.1.2 remote-as 20 <--------------- BGP neighbor to ISP
 neighbor 10.20.1.2 prefix-list to-ISP out
<------ Allow only IP block need to be advertised to ISP
 neighbor 10.20.1.2 route-map route-to-ISP out
 no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
ip prefix-list to-ISP seq 5 permit 100.100.100.0/24
!
route-map route-to-ISP permit 10 <------------ Change origin value to 'IGP'
 set origin igp
!
control-plane
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

 

[PE / ISP Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname PE
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 ip address 10.20.1.2 255.255.255.252
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
router bgp 20
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 neighbor 10.20.1.1 remote-as 10
<------------------ BGP neighbor to ISP
 neighbor 10.20.1.1 default-originate <-------------- Send default route thru BGP
 neighbor 10.20.1.1 route-map no-routes out
 no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
route-map no-routes deny 10
!
control-plane
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end
 


[Verifing output]
 
CPE#sh ip bgp nei 10.20.1.2 ad
BGP table version is 4, local router ID is 100.100.100.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
*> 100.100.100.0/24 0.0.0.0                  0         32768 i

Total number of prefixes 1


CPE#sh ip bgp nei 10.20.1.2 ro
BGP table version is 4, local router ID is 100.100.100.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
*> 0.0.0.0          10.20.1.2                0             0 20 i

Total number of prefixes 1
CPE#


PE#sh ip bgp neighbors 10.20.1.1 ro
BGP table version is 3, local router ID is 10.20.1.2
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
*> 100.100.100.0/24 10.20.1.1                0             0 10 i

Total number of prefixes 1


PE#sh ip bgp neighbors 10.20.1.1 ad
BGP table version is 3, local router ID is 10.20.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Originating default network 0.0.0.0

   Network          Next Hop            Metric LocPrf Weight Path

Total number of prefixes 0


PE#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 3
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  10
    10.20.1.1 from 10.20.1.1 (100.100.100.1)
      Origin IG
P, metric 0, localpref 100, valid, external, best
PE#
 
 

[Dynamips testing]

Download and test it yourself with below Dynamips configuration files.
  Dynamips NET file
  Router configuration files
 
 
 
If you have any questions, feel free to send email us at This e-mail address is being protected from spambots. You need JavaScript enabled to view it . If you are looking for professional grade service, you might want to try our "BGP experts service". What is "BGP Experts service"? Click "BGP Experts" from the top menu option. You will find out what the "BGP Experts" and what we are doing here for.