Saturday, 1 March 2014

Scenario-2 (HSRP)



Core1#conf t
Core1(config)#int f0/0
Core1(config-if)#no switchport
Core1(config-if)# ip address 10.1.12.1 255.255.255.0
Core1(config-if)#duplex full
Core1(config-if)#speed 100
Core1(config-if)#no shut
Core1(config-if)#end

Core1#conf t
Core1(config)#int f0/1
Core1(config-if)#no switchport
Core1(config-if)# ip address 10.1.111.1 255.255.255.0
Core1(config-if)#duplex full
Core1(config-if)#speed 100
Core1(config-if)#no shut
Core1(config-if)#end

Core1#conf t
Core1(config)#int f0/2
Core1(config-if)#no switchport
Core1(config-if)# ip address 10.1.112.1 255.255.255.0
Core1(config-if)#duplex full
Core1(config-if)#speed 100
Core1(config-if)#no shut
Core1(config-if)#end

Core1#conf t
Core1(config)#int lo0
Core1(config-if)# ip address 1.1.1.1 255.255.255.255
Core1(config-if)#no shut
Core1(config-if)#end

Core2#conf t
Core2(config)#int f0/0
Core2(config)#no switchport
Core2(config)#ip address 10.1.12.2 255.255.255.0
Core2(config)#duplex full
Core2(config)#speed 100
Core2(config)#no sh

Core2#conf t
Core2(config)#int f0/1
Core2(config)#no switchport
Core2(config)#ip address 10.1.212.2 255.255.255.0
Core2(config)#duplex full
Core2(config)#speed 100
Core2(config)#no sh

Core2#conf t
Core2(config)#int f0/2
Core2(config)#no switchport
Core2(config)#ip address 10.1.211.2 255.255.255.0
Core2(config)#duplex full
Core2(config)#speed 100
Core2(config)#no sh

Core2#conf t
Core2(config)#int lo0
Core2(config-if)# ip address 2.2.2.2 255.255.255.255
Core2(config-if)#no sh
Core2(config-if)#end

Dist1#conf t
Dist1(config)#int f0/1
Dist1(config-if)#ip add 10.1.111.11 255.255.255.0
Dist1(config-if)#duplex full
Dist1(config-if)#speed 100
Dist1(config-if)#no sh
Dist1(config-if)#end

Dist1#conf t
Dist1(config)#int f0/2
Dist1(config-if)#ip add 10.1.211.11 255.255.255.0
Dist1(config-if)#duplex full
Dist1(config-if)#speed 100
Dist1(config-if)#no sh
Dist1(config-if)#end

Dist1#conf t
Dist1(config)#int range f0/0 , f0/4
Dist1(config-if-range)#switchport mode trunk
Dist1(config-if-range)#switchport trunk encapsulation dot1q

Dist1(config)#int range f0/0 , f0/4
Dist1(config-if-range)#channel-group 1 mode on
Dist1(config-if-range)#end

Dist1#conf t
Dist1(config)#int range f0/3 , f0/5
Dist1(config-if-range)#switchport mode trunk
Dist1(config-if-range)#switchport trunk encapsulation dot1q

Dist1(config)#int range f0/3 , f0/5
Dist1(config-if-range)#channel-group 2 mode on
Dist1(config-if-range)#end

Dist1#sh int trunk

Port      Mode         Encapsulation  Status        Native vlan
Po1       on           802.1q         trunking      1
Po2       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Po1       1-1005
Po2       1-1005

Port      Vlans allowed and active in management domain
Po1       1,10,20
Po2       1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Po1       1,10,20
Po2       1,10,20

Dist2(config)#int f0/1
Dist2(comfig-if)#no sw
Dist2(comfig-if)# ip address 10.1.212.12 255.255.255.0
Dist2(comfig-if)#speed 100

Dist2(config)#int f0/2
Dist2(comfig-if)#no sw
Dist2(comfig-if)# ip address 10.1.112.12 255.255.255.0
Dist2(comfig-if)#speed 100

Dist2#conf t
Dist2(config)#int range f0/0 , f0/4
Dist2(config-if-range)#switchport mode trunk
Dist2(config-if-range)#switchport trunk encapsulation dot1q

Dist2(config)#int range f0/0 , f0/4
Dist2(config-if-range)#channel-group 1 mode on
Dist2(config-if-range)#end

Dist2#conf t
Dist2(config)#int range f0/6 , f0/7
Dist2(config-if-range)#switchport mode trunk
Dist2(config-if-range)#switchport trunk encapsulation dot1q

Dist2(config)#int range f0/6 , f0/7
Dist2(config-if-range)#channel-group 3 mode on
Dist2(config-if-range)#end

Dist2#sh int trunk

Port      Mode         Encapsulation  Status        Native vlan
Po1       on           802.1q         trunking      1
Po3       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Po1       1-1005
Po3       1-1005

Port      Vlans allowed and active in management domain
Po1       1,10,20
Po3       1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Po1       1,10,20
Po3       1,10,20

Core1#conf t
Core1(config)#router ospf 1
Core1(config-router)#net 10.1.12.0 0.0.0.255 a 0 (ospf 1 area 0 =backbone)
Core1(config-router)#net 10.1.112.0 0.0.0.255 a 0
Core1(config-router)#net 10.1.111.0 0.0.0.255 a 0
Core1(config-router)#net 1.1.1.1 0.0.0.0 a 0
Core1(config-router)#end

Core2#conf t
Core2(config)#router ospf 1
Core2(config-router)#net 10.1.212.0 0.0.0.255 a 0
Core2(config-router)#net 10.1.211.0 0.0.0.255 a 0
Core2(config-router)#net 10.1.112.0 0.0.0.255 a 0
Core2(config-router)#net 10.1.12.0 0.0.0.255 a 0
Core2(config-router)#net 2.2.2.2 0.0.0.0 a 0
Core2(config-router)#end

Dist1#conf t
Dist1(config)#router ospf 1
Dist1(config-router)#network 10.1.111.0 0.0.0.255 a 0
Dist1(config-router)#network 10.1.211.0 0.0.0.255 a 0
Dist1(config-router)#network 11.11.11.11 0.0.0.0 a 0
Dist1(config-router)#end

Dist2(config)#router ospf 1
Dist2(config-router)#network 10.1.212.0 0.0.0.255 area 0
Dist2(config-router)#network 10.1.211.0 0.0.0.255 area 0
Dist2(config-router)#network 12.12.12.12 0.0.0.0 area 0
Dist2(config-router)#end

Dist2#vlan database
Dist2(vlan)#vlan 10 name HR
VLAN 10 added:
    Name: HR
Dist2(vlan)#exit
APPLY completed.
Exiting....

Dist2#vlan database
Dist2(vlan)#vlan 20 name IT
VLAN 20 added:
    Name: IT
Dist2(vlan)#exit
APPLY completed.
Exiting....

Dist2#sh vlan-sw

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/5, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
10   HR                               active   
20   IT                               active   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0  
20   enet  100020     1500  -      -      -        -    -        0      0  
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0  
1005 trnet 101005     1500  -      -      1        ibm  -        0      0 

Dist2#sh vtp status

VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 :
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xBF 0x86 0x94 0x45 0xFC 0xDF 0xB5 0x70
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 10.1.212.12 on interface Fa0/1 (first interface found)

Dist2#vlan database
Dist2(vlan)#vtp domain RHC
Changing VTP domain name from NULL to RHC
Dist2(vlan)#exit
APPLY completed.
Exiting....

Dist2#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : RHC
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x35 0xB4 0x21 0xC3 0x58 0x37 0x58 0x17
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 10.1.212.12 on interface Fa0/1 (first interface found)

Acc1#vlan database
Acc1(vlan)#vtp client
Setting device to VTP CLIENT mode.
Acc1(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....

Acc1#sh vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Client
VTP Domain Name                 : RHC
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x35 0xB4 0x21 0xC3 0x58 0x37 0x58 0x17
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

Dist1#vlan database
Dist1 (vlan)#vtp client
Setting device to VTP CLIENT mode.
Dist1 (vlan)#exit
In CLIENT state, no apply attempted.
Exiting....

Acc1#conf t
Acc1(config)#int f0/0
Acc1(config-if)#switchport mode access
Acc1(config-if)#switchport access vlan 10

Acc1#conf t
Acc1(config)#int f0/1
Acc1(config-if)#switchport mode access
Acc1(config-if)#switchport access vlan 20
Acc1(config)#end

PC-A(config)#int f0/0
PC-A(config-if)#ip add 192.168.10.100 255.255.255.0
PC-A(config-if)#duplex full
PC-A(config-if)#speed 100
PC-A(config-if)#no sh

PC-B(config)#int f0/0
PC-B(config-if)#ip add 192.168.20.100 255.255.255.0
PC-B(config-if)#duplex full
PC-B(config-if)#speed 100
PC-B(config-if)#end

PC-A#conf t 
 PC-A(config)#router ospf 1
PC-A(comfig-router)#network 192.168.10.0 255.255.255.0 a 1 (ospf 1 area 1)
PC-A(comfig-router)#network 192.168.20.0 255.255.255.0 a 1
PC-A(config)#end

PC-B#conf t
PC-B# router ospf 1
PC-B(comfig-router)#net 192.168.10.0 255.255.255.0  a 1
PC-B(comfig-router)#net 192.168.20.0 255.255.255.0  a 1
PC-B(config)#end

Dist1#conf t
Dist1(config)#int vlan10
Dist1(config-if)#ip add 192.168.10.2 255.255.255.0
Dist1(config-if)#standby 1 ip 192.168.10.1
Dist1(config-if)#standby 1 priority 100
Dist1(config-if)#standby 1 preempt
Dist1(config-if)#end

Dist1#conf t
Dist1(config)#int vlan20
Dist1(config-if)#ip add 192.168.20.2 255.255.255.0
Dist1(config-if)#standby 2 ip 192.168.20.1
Dist1(config-if)#standby 2 priority 100
Dist1(config-if)#standby 2 preempt
Dist1(config-if)#end

Dist2#conf t
Dist2(config)#int vlan 10
Dist2(config-if)#ip add 192.168.10.3 255.255.255.0
Dist2(config-if)#standby 1 ip 192.168.10.1
Dist2(config-if)#standby 1 priority 101
Dist2(config-if)#standby 1 preempt
Dist2(config-if)#end

Dist2(config)#int vlan 20
Dist2(config-if)#ip add 192.168.20.3 255.255.255.0
Dist2(config-if)#standby 2 ip 192.168.20.1
Dist2(config-if)#standby 2 priority 101
Dist2(config-if)#standby 2 preempt
Dist2(config-if)# end

Dist2#sh standby
Vlan10 - Group 1
  State is Active
    1 state change, last state change 00:14:33
  Virtual IP address is 192.168.10.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.944 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.10.2, priority 100 (expires in 1.844 sec)
  Priority 101 (configured 101)
  IP redundancy name is "hsrp-Vl10-1" (default)
Vlan20 - Group 2
  State is Active
    2 state changes, last state change 00:04:12
  Virtual IP address is 192.168.20.1
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.944 secs
  Preemption enabled
  Active router is local
  Standby router is 192.168.20.2, priority 100 (expires in 8.736 sec)
  Priority 101 (configured 101)
  IP redundancy name is "hsrp-Vl20-2" (default)

Dist1#sh standby
Vlan10 - Group 1
  State is Standby
    4 state changes, last state change 00:14:09
  Virtual IP address is 192.168.10.1
  Active virtual MAC address is 0000.0c07.ac01
    Local virtual MAC address is 0000.0c07.ac01 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.624 secs
  Preemption enabled
  Active router is 192.168.10.3, priority 101 (expires in 8.744 sec)
  Standby router is local
  Priority 100 (default 100)
  IP redundancy name is "hsrp-Vl10-1" (default)
Vlan20 - Group 2
  State is Standby
    1 state change, last state change 00:02:04
  Virtual IP address is 192.168.20.1
  Active virtual MAC address is 0000.0c07.ac02
    Local virtual MAC address is 0000.0c07.ac02 (v1 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.616 secs
  Preemption enabled
  Active router is 192.168.20.3, priority 101 (expires in 8.756 sec)
  Standby router is local
  Priority 100 (default 100)
  IP redundancy name is "hsrp-Vl20-2" (default)


Dist1#conf t
Dist1(config)#router ospf 1
Dist1(config-router)# network 192.168.10.0 0.0.0.255 area 1
Dist1(config-router)#network 192.168.20.0 0.0.0.255 area 1
Dist1(config-router)#end

Dist2#conf t
Dist2(config)#router ospf 1
Dist2(config-router)# network 192.168.10.0 0.0.0.255 area 1
Dist2(config-router)#network 192.168.20.0 0.0.0.255 area 1
Dist2(config-router)#end

PC-A#ping 192.168.20.100                (PC-B)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.100, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms


Sunday, 12 January 2014

IBGP



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)#nei 10.1.12.2 remote-as 1
R1(config-router)#nei 10.1.23.3 remote-as 1
R1(config-router)#nei 10.1.34.4 remote-as 1
R1(config-router)#network 1.1.1.1 mask 255.255.255.255
R1(config-router)#end
R1#conf t
R1(config)#ip route 10.1.23.0 255.255.255.0 10.1.12.2
R1(config)#ip route 10.1.34.0 255.255.255.0 10.1.12.2
R1(config)#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 1
R2(config-router)#nei 10.1.12.1 remote-as 1
R2(config-router)#nei 10.1.23.3 remote-as 1
R2(config-router)#net 2.2.2.2 mask 255.255.255.255
R2(config-router)#end
R2#conf t
R2(config)#ip route 10.1.34.0 255.255.255.0 10.1.23.3
R2(config)#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 1
R3(config-router)#nei 10.1.23.2 remote-as 1
R3(config-router)#nei 10.1.34.4 remote-as 1
R3(config-router)#net 3.3.3.3 mask 255.255.255.255
R3(config-router)#end
R3(config)#ip route
R3(config)#ip route 10.1.12.0 255.255.255.0 10.1.23.2
R3(config)#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 1
R4(config-router)#nei 10.1.34.3 remote-as 1
R4(config-router)#net 4.4.4.4 mask 255.255.255.255
R4(config-router)#end
R4#conf t
R4(config)#ip route 10.1.23.0 255.255.255.0 10.1.34.3
R4(config)#ip route 10.1.12.0 255.255.255.0 10.1.34.3
R4(config)#end


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
*>i2.2.2.2/32       10.1.12.2                0    100                   0 i
*>i3.3.3.3/32       10.1.23.3                0    100                   0 i
*>i4.4.4.4/32       10.1.34.4                0    100                   0 i

R1#sh ip bgp summ
BGP router identifier 1.1.1.1, local AS number 1
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
3/2 BGP path/bestpath attribute entries using 372 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 1048 total bytes of memory
BGP activity 4/0 prefixes, 6/2 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.12.2       4     1      39      39        5    0    0 00:32:36        1
10.1.23.3       4     1      18      18        5    0    0 00:13:14        1
10.1.34.4       4     1      16      16        5    0    0 00:11:30        1

R1#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
C       1.1.1.1 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
B       2.2.2.2 [200/0] via 10.1.12.2, 00:33:43
     3.0.0.0/32 is subnetted, 1 subnets
B       3.3.3.3 [200/0] via 10.1.23.3, 00:15:21
     4.0.0.0/32 is subnetted, 1 subnets
B       4.4.4.4 [200/0] via 10.1.34.4, 00:13:36
     10.0.0.0/24 is subnetted, 3 subnets
C       10.1.12.0 is directly connected, FastEthernet0/0
S       10.1.23.0 [1/0] via 10.1.12.2
S       10.1.34.0 [1/0] via 10.1.12.2

R1#sh tcp bri
TCB       Local Address           Foreign Address        (state)
64FBD584  10.1.12.1.40937         10.1.12.2.179          ESTAB
64FBCF34  10.1.12.1.179           10.1.34.4.29315        ESTAB
64FC1788  10.1.12.1.179           10.1.23.3.59782        ESTAB

R1#ping 10.1.34.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/64/68 ms
R1#ping 4.4.4.4 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/64/68 ms

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
*>i1.1.1.1/32       10.1.12.1                0         100             0 i
*> 2.2.2.2/32       0.0.0.0                     0                    32768 i
*>i3.3.3.3/32       10.1.23.3                0         100             0 i
*>i4.4.4.4/32       10.1.34.4                0         100             0 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
*>i1.1.1.1/32       10.1.12.1                0       100                0   i
*>i2.2.2.2/32       10.1.23.2                0       100                0   i
*> 3.3.3.3/32       0.0.0.0                     0                    32768    i
*>i4.4.4.4/32       10.1.34.4                0        100               0   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
*>i1.1.1.1/32       10.1.12.1                0       100               0 i
*>i2.2.2.2/32       10.1.23.2                0       100               0 i
*>i3.3.3.3/32       10.1.34.3                0       100               0 i
*> 4.4.4.4/32       0.0.0.0                     0                    32768 i


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