Pages

Saturday, April 20, 2013

BGP neighbor local-as



The neighbor local-as command is used to customize the AS_PATH attribute by adding and removing autonomous system numbers for routes received from eBGP neighbors.
The configuration of this command allows a router to appear to external peers as a member of another autonomous system for the purpose of autonomous system number migration. This feature simplifies the process of changing the autonomous system number in a BGP network by allowing the network operator to migrate customers to new configurations during normal service windows without disrupting existing peering arrangements.

Caution BGP prepends the autonomous system number from each BGP network that a route traverses to maintain network reachability information and to prevent routing loops. This command should be configured only for autonomous system migration, and should be deconfigured after the transition has been completed. This procedure should be attempted only by an experienced network operator. Routing loops can be created through improper configuration. This command can be used for only true eBGP peering sessions. This command does not work for two peers in different subautonomous systems of a confederation.

This command supports individual peering sessions and configurations applied through peer groups and peer templates. If this command is applied to a group of peers, the individual peers cannot be customized.





from: Cisco IOS IP Routing: BGP Command Reference

Files:
Topology
Configs
BGP Configuration

Friday, April 19, 2013

BGP neighbor disable-connected-check

A BGP routing process will verify the connection of single-hop eBGP peering session (TTL=254) to determine if the eBGP peer is directly connected to the same network segment by default. If the peer is not directly connected to same network segment, connection verification will prevent the peering session from being established.

The neighbor disable-connected-check command is used to disable the connection verification process for eBGP peering sessions that are reachable by a single hop but are configured on a loopback interface or otherwise configured with a non-directly connected IP address. This command is required only when the neighbor ebgp-multihop command is configured with a TTL value of 1. The address of the single-hop eBGP peer must be reachable. The neighbor update-source command must be configured to allow the BGP routing process to use the loopback interface for the peering session.





from: Cisco IOS IP Routing: BGP Command Reference

Files:
Topology
Configs
BGP Configuration

Thursday, April 18, 2013

BGP Support for 4-byte ASN


Prior to January 2009, BGP autonomous system numbers that were allocated to companies were 2-octet numbers in the range from 1 to 65535 as described in RFC 4271, A Border Gateway Protocol 4 (BGP-4). Due to increased demand for autonomous system numbers, the Internet Assigned Number Authority (IANA) will start in January 2009 to allocate four-octet autonomous system numbers in the range from 65536 to 4294967295. RFC 5396, Textual Representation of Autonomous System (AS) Numbers, documents three methods of representing autonomous system numbers. Cisco has implemented the following two methods:

  •  Asplain--Decimal value notation where both 2-byte and 4-byte autonomous system numbers are represented by their decimal value. For example, 65526 is a 2-byte autonomous system number and 234567 is a 4-byte autonomous system number.
  •  Asdot--Autonomous system dot notation where 2-byte autonomous system numbers are represented by their decimal value and 4-byte autonomous system numbers are represented by a dot notation. For example, 65526 is a 2-byte autonomous system number and 1.169031 is a 4-byte autonomous system number (this is dot notation for the 234567 decimal number).




Formula to calculate ASN 4bytes(quotient.remainder):
Example for AS 769672:

quotient =>
769672 / 65536 = 11
remainder = 769672 - (11*65536) = 48776
Result: AS 11.48776

AS-PLAIN number: AS-DOT number: .
Script from: http://labs.spritelink.net/ascalc



from: IP Routing: BGP Features

Files:
Topology
Configs
BGP Configuration
Cisco Document - ASN

Good article about Conversion


Monday, April 15, 2013

BGP neighbor allowas-in


The allowas-in command prevents the looped-back information from being dropped, breaking the routing loop protection:

If the AS_PATH attribute of a BGP route contains an AS loop, the BGP route should be excluded from the Phase 2 decision function. AS loop detection is done by scanning the full AS path (as specified in the AS_PATH attribute), and checking that the autonomous system number of the local system does not appear in the AS path. It is critical that BGP speakers within an AS do not make conflicting decisions regarding route selection that would cause forwarding loops to occur.






from: BGP Commands on Cisco IOS

Files:
Topology
R1
R2
R3

Sunday, April 14, 2013

BGP ttl-security hops

What happens in fact is that when you specify such multi-hop BGP peer the router starts sending BGP packets with TTL being equal to the number of hops you set . That means if I set peer to be 3 hops away and some attacker tries to spoof legit peer’s IP but is 4 hops away – such attack won’t succeed cause my router will receive spoofed BGP packets ok but will send replies with TTL of 3 which will expire just 1 hop away from the attacker. Questionable , but security . So why ttl-security? This feature indeed enforces that BGP peer is no more than given hops away . And here comes the difference – it enforces it inbound . It works this way – after you enable ttl security on the BGP peer session and specify how many hops away this peer is allowed to be, your router checks incoming TCP packets from this peer and does this simple calculation ; configured value <= 255 – hops-away-to-peer , if it holds true your router goes on with establishing BGP session , if not – session is shut down. Regarding outgoing TTL values – may be it is Cisco-only thing, may be not , but the moment you enable ttl security for some BGP peer on Cisco the router itself starts sending BGP-related packets to this peer with initial ttl being equal to 255. I guess it is logical that if you enforce on your side ttl security the peering side will want to do the same.





from: BGP Support for TTL Security Check

Files:
Topology
R1
R2
R3

Saturday, April 13, 2013

Exceeding BGP Limitations with E-BGP Multihop

eBGP mulithop is used when peering with another BGP speaking router that is more than one hop away. By default, eBGP peering messages are link local, so the TTL value in the packet is 1. The eBGP Multihop command is used to change the default TTL value to something other than one.





from: Cisco IOS IP Routing: BGP Command Reference

Files:
Topology
R1
R2
R3

Monday, April 1, 2013

IP Routing Protocol-Independent Commands

distribute-list out

To suppress networks from being advertised in updates.  

For training, we want to redistribute only the Networks 10.0.5.2/32 and 10.0.9.3/32 (no restrictions from R2 to R1).




Video Demonstration




from: IP Routing Protocol-Independent Commands