Question - 1 Explain BGP Origin Code attribute.
- There are three origin code. i - IGP , e - EGP, ? - INCOMPLETE
- i - IGP - You can get this by network command in BGP. It is more preferable than EGP.
- e - EGP - For the route which is learned via EGP. It is more preferable than INCOMPLETE.
- ? - INCOMPLETE - For redistributed network from IGP or static to BGP. It can be achieved by redistribute command.
- It is Well-known mandatory attribute.
Question - 2 How can we configure BGP Origin-Code attribute ?
Router3 and Router2 are both in AS 20 and advertising same network (5.5.5.0/24) to Router1.
Initially we will configure the BGP between three routers.
- Router1 Configuration -
Router1#show running-config
interface Ethernet1/0
ip address 192.167.23.1 255.255.255.0
half-duplex
!
interface Ethernet2/0
ip address 192.167.24.1 255.255.255.0
half-duplex
!
router bgp 10
no synchronization
bgp log-neighbor-changes
neighbor 192.167.23.2 remote-as 20
neighbor 192.167.24.3 remote-as 20
no auto-summary
- Router2 Configuration -
Router2#show running-config
!
interface Loopback1
ip address 5.5.5.2 255.255.255.0
!
interface Ethernet1/0
ip address 192.167.23.2 255.255.255.0
half-duplex
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 5.5.5.0 mask 255.255.255.0
neighbor 192.167.23.1 remote-as 10
no auto-summary
- Router3 Configuration -
Router3#show running-config
interface Loopback1
ip address 5.5.5.3 255.255.255.0
!
interface Ethernet2/0
ip address 192.167.24.3 255.255.255.0
half-duplex
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 5.5.5.0 mask 255.255.255.0
neighbor 192.167.24.1 remote-as 10
no auto-summary
Output -
You can see in this output , right now origin code is "i" for both network, and Router1 prefer 192.167.23.2 as its path to reach network 5.5.5.0/24
Now we will change configuration ,
Now we will advertise network 5.5.5.0/24 in Router2 for BGP with the network command, and we will use "redistribute connected" command in Router3
Router2#configure terminal
Router2(config)#router bgp 20
Router2(config-router)#network 5.5.5.0 mask 255.255.255.0
Router3#configure terminal
Router3(config)#router bgp 20
Router3(config-router)#no network 5.5.5.0 mask 255.255.255.0
Router3(config-router)#redistribute connected
Output -
Now you can see in this output, Router1 learned both network through BGP, and first entry indicated by Origin code symbol '?' and second entry indicated by Origin code symbol 'i'.
- Router1 Configuration -
interface Ethernet1/0
ip address 192.167.23.1 255.255.255.0
half-duplex
!
interface Ethernet2/0
ip address 192.167.24.1 255.255.255.0
half-duplex
!
router bgp 10
no synchronization
bgp log-neighbor-changes
neighbor 192.167.23.2 remote-as 20
neighbor 192.167.24.3 remote-as 20
no auto-summary
- Router2 Configuration -
!
interface Loopback1
ip address 5.5.5.2 255.255.255.0
!
interface Ethernet1/0
ip address 192.167.23.2 255.255.255.0
half-duplex
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 5.5.5.0 mask 255.255.255.0
neighbor 192.167.23.1 remote-as 10
no auto-summary
- Router3 Configuration -
interface Loopback1
ip address 5.5.5.3 255.255.255.0
!
interface Ethernet2/0
ip address 192.167.24.3 255.255.255.0
half-duplex
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 5.5.5.0 mask 255.255.255.0
neighbor 192.167.24.1 remote-as 10
no auto-summary
You can see in this output , right now origin code is "i" for both network, and Router1 prefer 192.167.23.2 as its path to reach network 5.5.5.0/24
Router2#configure terminal
Router2(config)#router bgp 20
Router2(config-router)#network 5.5.5.0 mask 255.255.255.0
Router3#configure terminal
Router3(config)#router bgp 20
Router3(config-router)#no network 5.5.5.0 mask 255.255.255.0
Router3(config-router)#redistribute connected
Output -
Now you can see in this output, Router1 learned both network through BGP, and first entry indicated by Origin code symbol '?' and second entry indicated by Origin code symbol 'i'.
0 comments:
Post a Comment
If you like my posts then please comment and if you don’t like then please suggest me to improve, and if you have any query related to post then please text me through the comment box or mail me on upadhyayambition@gmail.com , I will try my best to solve your queries as soon as possible.