Thursday, 7 February 2013

BGP Conditional Route Injection



Prefer path to reach 123.123.123.123/32 is R6>R5>R2>R3 without manipulating bgp attributes of path selection.

Configuration

R1

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.13.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.14.1 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.13.1 0.0.0.0 area 0
!
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 neighbor IBGP peer-group
 neighbor IBGP remote-as 123
 neighbor IBGP update-source Loopback0
 neighbor IBGP next-hop-self
 neighbor 2.2.2.2 peer-group IBGP
 neighbor 3.3.3.3 peer-group IBGP
 neighbor 192.168.14.4 remote-as 4
 no auto-summary

R2

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.23.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.25.2 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.23.2 0.0.0.0 area 0
!
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 bgp inject-map INJECT exist-map EXIST
 neighbor IBGP peer-group
 neighbor IBGP remote-as 123
 neighbor IBGP update-source Loopback0
 neighbor IBGP next-hop-self
 neighbor 1.1.1.1 peer-group IBGP
 neighbor 3.3.3.3 peer-group IBGP
 neighbor 192.168.25.5 remote-as 5
 no auto-summary
!
ip prefix-list EXIST seq 5 permit 123.123.0.0/16
!
ip prefix-list INJECT seq 5 permit 123.123.123.0/24
!
ip prefix-list SOURCE seq 5 permit 3.3.3.3/32
!
route-map INJECT permit 10
 set ip address prefix-list INJECT
!
route-map EXIST permit 10
 match ip address prefix-list EXIST
 match ip route-source prefix-list SOURCE

R3

interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface Loopback1
 ip address 123.123.123.123 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.13.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.23.3 255.255.255.0
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.13.3 0.0.0.0 area 0
 network 192.168.23.3 0.0.0.0 area 0
!
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 network 123.123.0.0 mask 255.255.0.0
 neighbor IBGP peer-group
 neighbor IBGP remote-as 123
 neighbor IBGP update-source Loopback0
 neighbor 1.1.1.1 peer-group IBGP
 neighbor 2.2.2.2 peer-group IBGP
 no auto-summary
!
ip forward-protocol nd
ip route 123.123.0.0 255.255.0.0 Null0

R4

interface FastEthernet0/0
 ip address 192.168.14.4 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.46.4 255.255.255.0
 duplex auto
 speed auto
!
router bgp 4
 no synchronization
 bgp log-neighbor-changes
 neighbor 192.168.14.1 remote-as 123
 neighbor 192.168.46.6 remote-as 6
 no auto-summary

R5

interface FastEthernet0/0
 ip address 192.168.25.5 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.56.5 255.255.255.0
 duplex auto
 speed auto
!
router bgp 5
 no synchronization
 bgp log-neighbor-changes
 neighbor 192.168.25.2 remote-as 123
 neighbor 192.168.56.6 remote-as 6
 no auto-summary

R6

interface Loopback0
 ip address 6.6.6.6 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.46.6 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.56.6 255.255.255.0
 duplex auto
 speed auto
!
router bgp 6
 no synchronization
 bgp log-neighbor-changes
 network 6.6.6.6 mask 255.255.255.255
 neighbor 192.168.46.4 remote-as 4
 neighbor 192.168.46.4 route-map OUT out
 neighbor 192.168.56.5 remote-as 5
 neighbor 192.168.56.5 route-map OUT out
 no auto-summary
!
ip as-path access-list 1 permit ^$
!
route-map OUT permit 10
 match as-path 1

Verification

R6#show ip bgp
   Network          Next Hop            Metric LocPrf Weight Path
*> 6.6.6.6/32       0.0.0.0                  0         32768 i
*> 123.123.0.0/16   192.168.46.4                           0 4 123 i
*                   192.168.56.5                           0 5 123 i
*> 123.123.123.0/24 192.168.56.5                           0 5 123 ?
R6#traceroute 123.123.123.123 source loopback 0
Type escape sequence to abort.
Tracing the route to 123.123.123.123
  1 192.168.56.5 16 msec 48 msec 20 msec
  2 192.168.25.2 44 msec 44 msec 28 msec
  3 192.168.23.3 68 msec *  100 msec
GNS File : http://www.4shared.com/rar/sQJLhAdW/bgp_conditional_route_injectio.html

Tuesday, 5 February 2013

AToM_Interworking(Ethernet to Frame-Relay)

 
 
 
Ethernet         - R1>R4
Frame-Relay - R3>R5
 
Configuration
 
R1
 
pseudowire-class R4R5
 encapsulation mpls
 interworking ip
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet1/0
 ip address 192.168.12.1 255.255.255.0
 speed auto
 duplex auto
 mpls ip
!
interface FastEthernet1/1
 no ip address
 speed auto
 duplex auto
 no keepalive
 xconnect 3.3.3.3 1435 pw-class R4R5
!
router ospf 1
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.12.1 0.0.0.0 area 0

R2
 
interface FastEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 speed 100
 full-duplex
 mpls ip
!
interface FastEthernet0/1
 ip address 192.168.23.2 255.255.255.0
 speed 100
 full-duplex
 mpls ip
!
router ospf 1
 log-adjacency-changes
 network 192.168.12.2 0.0.0.0 area 0
 network 192.168.23.2 0.0.0.0 area 0

R3
 
frame-relay switching
!
pseudowire-class R4R5
 encapsulation mpls
 interworking ip
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface POS1/0
 mtu 1500
 no ip address
 encapsulation frame-relay
  frame-relay intf-type dce
!
interface FastEthernet2/0
 ip address 192.168.23.3 255.255.255.0
 speed auto
 duplex auto
 mpls ip
!
router ospf 1
 log-adjacency-changes
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.23.3 0.0.0.0 area 0
!
connect FR POS1/0 45 l2transport
 xconnect 1.1.1.1 1435 pw-class R4R5

R4
 
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.45.4 255.255.255.0
 ip ospf network point-to-point
!
router ospf 1
 log-adjacency-changes
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.45.4 0.0.0.0 area 0

R5
 
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface POS1/0
 mtu 1500
 ip address 192.168.45.5 255.255.255.0
 encapsulation frame-relay
 ip ospf network point-to-point
 frame-relay map ip 192.168.45.4 45 broadcast
!
router ospf 1
 log-adjacency-changes
 network 5.5.5.5 0.0.0.0 area 0
 network 192.168.45.5 0.0.0.0 area 0
 
Verification
 
R1#show mpls l2transport vc
Local intf     Local circuit              Dest address    VC ID      Status
-------------  -------------------------- --------------- ---------- ----------
Fa1/1          Ethernet                   3.3.3.3         1435       UP
R4#ping 192.168.45.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.45.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/86/144 ms