среда, 27 марта 2013 г.

Connecting 2 Routers via Aux Port

Sometimes, even in our days, it's necessary to connect 2 routers via Aux 0 cable, if there is not enough Ethernet port in this routers.

There is a simple example (a little conclusion), thanks for cisco.com, where i've found huge amount of documentation about interconnection routers and other devices via Aux.







Let's begin with confuguration of  2 routers

10.0.0.1:

 interface Ethernet0
  no ip address
  shutdown
     
 interface Async1

  ip address 10.0.0.1 255.255.255.0

  encapsulation ppp

  async default routing

  async mode dedicated
 ip route 0.0.0.0 0.0.0.0 Async1


 logging buffered
 line con 0
  exec-timeout 0 0
 line aux 0

  modem InOut
  transport input all

  rxspeed 38400
  txspeed 38400

  flowcontrol hardware
 line vty 0 4
  login
 !
 end

10.0.0.2:

hostname Router2
 !
 interface Ethernet0
       
 interface Async1
  ip address 10.0.0.2 255.255.255.0

  encapsulation ppp

  async default routing
 
  async mode dedicated
 !
 no ip classless
 ip route 0.0.0.0 0.0.0.0 Ethernet0

 logging buffered
 !
 line con 0
  exec-timeout 0 0
 line aux 0

  modem InOut
  transport input all

  rxspeed 3840
  txspeed 38400


  flowcontrol hardware
 line vty 0 4
  login
 !
 end

In both configuration, first we must confige an Async interface with correct ip address, encapsulation, routing (it should be enabled) and mode, than its necessary to configure ip routing and static routing and lines with correct tx and rx speed (it should match on both routers)

среда, 6 марта 2013 г.

Optimizing BGP convergence with non-directly connected peers




Good day!
Much time has passed since my last blog entry. And now, i have some time to make some new notes in my blog.
First, yesterday i had a task to optimize BGP convergence between to ISP. There are a lot o ways to optimize convergence, e.g tune BGP timers, bfd, neighbor failover, eem and etc. I 've decided to implement an EEM (Embedded Event Manager), cause with it i can tweak a lot of events, parameters and etc.
In out topology we have one edge router and two ISP non directly connected routers.



Than let's begin with BGP conf. Here is standard configuration for BGP peering
-------------------
router bgp 199430
 no bgp fast-external-fallover
 bgp log-neighbor-changes
 neighbor 172.16.0.1 remote-as 65002
 neighbor 172.16.0.1 description ISP A
 neighbor 192.168.0.1 remote-as 65003
 neighbor 192.168.0.1 description ISP B
 !
 address-family ipv4
  network 10.0.0.0 mask 255.255.255.0
  neighbor 172.16.0.1 activate
  neighbor 172.16.0.1 soft-reconfiguration inbound
  neighbor 192.168.0.1 activate
  neighbor 192.168.0.1 soft-reconfiguration inbound
 exit-address-family
---------------------- 

Next, lets configure ip sla monitoring and tracking of BGP peers

--------------------- 

track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
ip sla 1
 icmp-echo 172.16.0.1 source-interface GigabitEthernet0/0
 frequency 5
ip sla schedule 1 life forever start-time now
ip sla 2
 icmp-echo 192.168.0.1 source-interface FastEthernet0/0/0
 frequency 5
ip sla schedule 2 life forever start-time now
-------------------

And finally, let's configure our EEM for tracking

-------------------

event manager applet ISP_A _DOWN
 event track 1 state down
 action 2.0 cli command "enable"
 action 2.1 cli command "config t"
 action 2.2 cli command "router bgp 65001"
 action 2.3 cli command "neighbor 172.16.0.1 shutdown"
event manager applet ISP_A_UP
 event track 1 state up
 action 2.0 cli command "enable"
 action 2.1 cli command "config t"
 action 2.2 cli command "router bgp 65001"
 action 2.3 cli command "no neighbor 172.16.0.1 shutdown"
------------------- 
event manager applet ISPB_DOWN
 event track 2 state down
 action 2.0 cli command "enable"
 action 2.1 cli command "config t"
 action 2.2 cli command "router bgp 65001"
 action 2.3 cli command "neighbor 192.168.0.1 shutdown"
event manager applet ISPB_UP
 event track 2 state up
 action 2.0 cli command "enable"
 action 2.1 cli command "config t"
 action 2.2 cli command "router bgp 65001"
 action 2.3 cli command "no neighbor 192.168.0.1  shutdown"
-------------------
 
So, when 1 imcp packet is dropped by IP SLA, track service generate down messages and then EEM aplet, which is listening that tracking generates neighbor shutdown command, and when neighbor returns no UP states, EEM generates "no" command.

As I previously mentioned we can tweak lots of different parameters with such a bunch of tehnologies: ip sla, tracking and EEM.