Sunday, 12 January 2014

EBGP



R1(config)#int f0/0
R1(config-if)#ip add 10.1.12.1 255.255.255.0
R1(config-if)#no sh
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#router bgp 1
R1(config-router)#neighbor 10.1.12.2 remote-as 2
R1(config-router)#neighbor 10.1.12.2 ebgp-multihop 3
R1(config-router)#neighbor 10.1.12.2 update-source loopback 0
R1(config-router)#network 1.1.1.1 mask 255.255.255.255
R1(config-router)#end

R2(config)#int f0/0
R2(config-if)#ip add 10.1.12.2 255.255.255.0
R2(config-if)#no sh
R2(config)#int f1/0
R2(config-if)#ip add 10.1.23.2 255.255.255.0
R2(config-if)#no sh
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#exit
R2(config)#router bgp 2
R2(config-router)#nei 10.1.12.1 remote-as 1
R2(config-router)#nei 10.1.23.3 remote-as 3
R2(config-router)#net 2.2.2.2 mask 255.255.255.255
R2(config-router)#end

R3(config)#int f0/0
R3(config-if)#ip add 10.1.23.3 255.255.255.0
R3(config-if)#no sh
R3(config)#int f1/0
R3(config-if)#ip add 10.1.34.3 255.255.255.0
R3(config-if)#no sh
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.255
R3(config-if)#exit
R3(config)#router bgp 3
R3(config-router)#nei 10.1.23.2 remote-as 2
R3(config-router)#nei 10.1.34.4 remote-as 4
R3(config-router)#net 3.3.3.3 mask 255.255.255.255
R3(config-router)#end
                  
R4(config)#int f0/0
R4(config-if)#ip add 10.1.34.4 255.255.255.0
R4(config-if)#no sh
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config-if)#exit       
R4(config)#router bgp 4
R4(config-router)#nei 10.1.34.3 remote-as 3
R4(config-router)#net 4.4.4.4 mask 255.255.255.255
R4(config-router)#end

R2#sh ip bgp
BGP table version is 5, local router ID is 2.2.2.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
*> 1.1.1.1/32       10.1.12.1                0                   0   1 i
*> 2.2.2.2/32       0.0.0.0                   0              2768   i
*> 3.3.3.3/32       10.1.23.3                0                   0   3 i
*> 4.4.4.4/32       10.1.23.3                                     0   3 4 i


R2#sh run | s bgp
router bgp 2
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 neighbor 10.1.12.1 remote-as 1
 neighbor 10.1.23.3 remote-as 3
 no auto-summary

R2#sh ip bgp summ
BGP router identifier 2.2.2.2, local AS number 2
BGP table version is 5, main routing table version 5
4 network entries using 468 bytes of memory
4 path entries using 208 bytes of memory
5/4 BGP path/bestpath attribute entries using 620 bytes of memory
3 BGP AS-PATH entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1368 total bytes of memory
BGP activity 4/0 prefixes, 4/0 paths, scan interval 60 secs

Neighbor        V    AS  MsgRcvd  MsgSent   TblVer  InQ  OutQ  Up/Down   State/PfxRcd
10.1.12.1        4      1                17            19              5    0          0     00:13:23                  1
10.1.23.3        4      3                16            19              5    0          0     00:09:33                  2

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [20/0] via 10.1.12.1, 00:13:51
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [20/0] via 10.1.23.3, 00:08:01
     4.0.0.0/32 is subnetted, 1 subnets
B       4.4.4.4 [20/0] via 10.1.23.3, 00:07:00
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.12.0 is directly connected, FastEthernet0/0
C       10.1.23.0 is directly connected, FastEthernet1/0

R2#sh tcp bri
TCB               Local Address           Foreign Address        (state)
64EDDC80  10.1.23.2.42087         10.1.23.3.179          ESTAB
64EDED04  10.1.12.2.179           10.1.12.1.45753        ESTAB

R1#sh ip 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
*> 1.1.1.1/32       0.0.0.0                     0                      32768    i
*> 2.2.2.2/32       10.1.12.2                0                                0    2 i
*> 3.3.3.3/32       10.1.12.2                                                   0    2 3 i
*> 4.4.4.4/32       10.1.12.2                                                   0    2 3 4 i

R3#sh ip bgp
BGP table version is 5, local router ID is 3.3.3.3
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
*> 1.1.1.1/32       10.1.23.2                                                0     2 1 i
*> 2.2.2.2/32       10.1.23.2                0                             0      2 i
*> 3.3.3.3/32       0.0.0.0                     0                   32768      i
*> 4.4.4.4/32       10.1.34.4                0                             0      4 i

R4#sh ip bgp
BGP table version is 5, local router ID is 4.4.4.4
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
*> 1.1.1.1/32       10.1.34.3                                                0     3 2 1 i
*> 2.2.2.2/32       10.1.34.3                                                0     3 2 i
*> 3.3.3.3/32       10.1.34.3                0                              0     3 i
*> 4.4.4.4/32       0.0.0.0                     0                   32768      i