bgp4r 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/bgp/messages/open.rb +8 -2
 - data/bgp4r.gemspec +3 -3
 - data/changelog.txt +28 -23
 - data/examples/ibgp-ios-asn4bytes.rb +298 -0
 - data/test/unit/messages/open_test.rb +6 -0
 - metadata +58 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c51910e055eec6ee760068f2e0f143c82d9ffe02
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f3438e906aa63a9847e63722a6ee8caf99cc29dd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c0799f8fa5199f21600564a285a7f0fdb76af7119f72e17078b8723ceee11f4c8e30ca8ffbe41c749d1e617727a6b9a416431bd7997db93b76b451e96fe51fe1
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: aeeaf6ea118d5852591312a93f5b8897464770754fedd1392a3423ba1518fa376925ae59453e0e3c7ebb4a985f8a51fa109cd39687d7c5b3d6b3b94a42bc2d95
         
     | 
    
        data/bgp/messages/open.rb
    CHANGED
    
    | 
         @@ -37,6 +37,8 @@ class Open < Message 
     | 
|
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
              include OPT_PARM
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
      
 40 
     | 
    
         
            +
              AS_TRANS=23456
         
     | 
| 
      
 41 
     | 
    
         
            +
              
         
     | 
| 
       40 
42 
     | 
    
         
             
              attr_reader :version, :local_as, :holdtime, :opt_parms
         
     | 
| 
       41 
43 
     | 
    
         | 
| 
       42 
44 
     | 
    
         
             
              def initialize(*args)
         
     | 
| 
         @@ -59,7 +61,7 @@ class Open < Message 
     | 
|
| 
       59 
61 
     | 
    
         | 
| 
       60 
62 
     | 
    
         
             
              def encode
         
     | 
| 
       61 
63 
     | 
    
         
             
                opt_parms = @opt_parms.compact.collect { |cap| cap.encode }.join
         
     | 
| 
       62 
     | 
    
         
            -
                s  = [@version,  
     | 
| 
      
 64 
     | 
    
         
            +
                s  = [@version, _my_encoded_as_, @holdtime, @bgp_id.hton].pack("Cnna4")
         
     | 
| 
       63 
65 
     | 
    
         
             
                s += if opt_parms.size>255
         
     | 
| 
       64 
66 
     | 
    
         
             
                  [0xffff, opt_parms.size, opt_parms].pack("nna*")
         
     | 
| 
       65 
67 
     | 
    
         
             
                else
         
     | 
| 
         @@ -75,7 +77,7 @@ class Open < Message 
     | 
|
| 
       75 
77 
     | 
    
         
             
              def to_s
         
     | 
| 
       76 
78 
     | 
    
         
             
                msg = self.encode
         
     | 
| 
       77 
79 
     | 
    
         
             
                "Open Message (#{OPEN}), length: #{msg.size}\n" +
         
     | 
| 
       78 
     | 
    
         
            -
                "  Version #{@version}, my AS #{ 
     | 
| 
      
 80 
     | 
    
         
            +
                "  Version #{@version}, my AS #{_my_encoded_as_}, Holdtime #{@holdtime}s, ID #{@bgp_id}" +
         
     | 
| 
       79 
81 
     | 
    
         
             
                ([""] + @opt_parms.compact.collect { |cap| cap.to_s } + [""]).join("\n  ") +
         
     | 
| 
       80 
82 
     | 
    
         
             
                msg.hexlify.join("\n") + "\n"
         
     | 
| 
       81 
83 
     | 
    
         
             
              end
         
     | 
| 
         @@ -97,6 +99,10 @@ class Open < Message 
     | 
|
| 
       97 
99 
     | 
    
         
             
              end
         
     | 
| 
       98 
100 
     | 
    
         | 
| 
       99 
101 
     | 
    
         
             
              private
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
              def _my_encoded_as_
         
     | 
| 
      
 104 
     | 
    
         
            +
                @local_as > 0xffff ? AS_TRANS : @local_as
         
     | 
| 
      
 105 
     | 
    
         
            +
              end
         
     | 
| 
       100 
106 
     | 
    
         | 
| 
       101 
107 
     | 
    
         
             
              def parse(_s)
         
     | 
| 
       102 
108 
     | 
    
         
             
                s = super(_s)
         
     | 
    
        data/bgp4r.gemspec
    CHANGED
    
    | 
         @@ -1,12 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
2 
     | 
    
         
             
              s.name = "bgp4r"
         
     | 
| 
       3 
     | 
    
         
            -
              s.version = "0.0. 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version = "0.0.18"
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.email = "jesnault@gmail.com"
         
     | 
| 
       5 
5 
     | 
    
         
             
              s.authors = ["Jean-Michel Esnault"]
         
     | 
| 
       6 
     | 
    
         
            -
              s.date = "2014- 
     | 
| 
      
 6 
     | 
    
         
            +
              s.date = "2014-10-17"
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.description = "Best way to play with BGP protocol using ruby"
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.summary = "Best way to play with BGP protocol using ruby"
         
     | 
| 
       9 
     | 
    
         
            -
              s.extra_rdoc_files = ["LICENSE.txt","README.rdoc"]
         
     | 
| 
       10 
9 
     | 
    
         
             
              s.homepage = "http://github.com/jesnault/bgp4r"
         
     | 
| 
       11 
10 
     | 
    
         
             
              s.rdoc_options = ["--quiet", "--title", "bgp4r", "--line-numbers"]
         
     | 
| 
       12 
11 
     | 
    
         
             
              s.require_paths = ["."]
         
     | 
| 
         @@ -14,5 +13,6 @@ Gem::Specification.new do |s| 
     | 
|
| 
       14 
13 
     | 
    
         
             
              s.required_rubygems_version = '>= 1.3.6'
         
     | 
| 
       15 
14 
     | 
    
         
             
              s.files =  `git ls-files -z`.split("\x0")
         
     | 
| 
       16 
15 
     | 
    
         
             
              s.test_files = `git ls-files test -z`.split("\x0")
         
     | 
| 
      
 16 
     | 
    
         
            +
              s.extra_rdoc_files = ["LICENSE.txt","README.rdoc"] + `git ls-files bgp -z`.split("\x0")
         
     | 
| 
       17 
17 
     | 
    
         
             
            end
         
     | 
| 
       18 
18 
     | 
    
         | 
    
        data/changelog.txt
    CHANGED
    
    | 
         @@ -1,3 +1,8 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            === 0.0.18
         
     | 
| 
      
 2 
     | 
    
         
            +
            * Bug fixes
         
     | 
| 
      
 3 
     | 
    
         
            +
              fix open message encoding when asn > 0xffff
         
     | 
| 
      
 4 
     | 
    
         
            +
            * More examples
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       1 
6 
     | 
    
         
             
            === 0.0.17
         
     | 
| 
       2 
7 
     | 
    
         
             
            * Get rid of Rakefile, VERSION.yml ...
         
     | 
| 
       3 
8 
     | 
    
         
             
            * Simpler gem specification
         
     | 
| 
         @@ -14,14 +19,14 @@ 
     | 
|
| 
       14 
19 
     | 
    
         
             
             +  Extended_communities
         
     | 
| 
       15 
20 
     | 
    
         
             
               o revisit Extended_communities#to_hash()
         
     | 
| 
       16 
21 
     | 
    
         
             
               o changed to_hash() to return
         
     | 
| 
       17 
     | 
    
         
            -
               => :extended_communities=> [ ec1, ec2, ..., ecn ] 
     | 
| 
      
 22 
     | 
    
         
            +
               => :extended_communities=> [ ec1, ec2, ..., ecn ]
         
     | 
| 
       18 
23 
     | 
    
         | 
| 
       19 
24 
     | 
    
         
             
             + revisit to_hash()  for following attr.
         
     | 
| 
       20 
25 
     | 
    
         
             
              o Originator_id
         
     | 
| 
       21 
26 
     | 
    
         
             
              o Aggregator
         
     | 
| 
       22 
27 
     | 
    
         
             
              o Multi_exit_disc
         
     | 
| 
       23 
28 
     | 
    
         
             
              o Cluster_list
         
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
       25 
30 
     | 
    
         
             
            * make Path_attribute comparable to test for equality:
         
     | 
| 
       26 
31 
     | 
    
         
             
               add following instance methods
         
     | 
| 
       27 
32 
     | 
    
         
             
                  Path_attributes#sort
         
     | 
| 
         @@ -29,8 +34,8 @@ 
     | 
|
| 
       29 
34 
     | 
    
         
             
                  Path_attributes#<=>
         
     | 
| 
       30 
35 
     | 
    
         | 
| 
       31 
36 
     | 
    
         
             
            * add getters for:
         
     | 
| 
       32 
     | 
    
         
            -
              +  all known path attributes 
     | 
| 
       33 
     | 
    
         
            -
              +  all known extended communities 
     | 
| 
      
 37 
     | 
    
         
            +
              +  all known path attributes
         
     | 
| 
      
 38 
     | 
    
         
            +
              +  all known extended communities
         
     | 
| 
       34 
39 
     | 
    
         
             
               So one can write:
         
     | 
| 
       35 
40 
     | 
    
         
             
               > puts upd.path_attribute.mp_reach.safi
         
     | 
| 
       36 
41 
     | 
    
         
             
               => 128
         
     | 
| 
         @@ -38,7 +43,7 @@ 
     | 
|
| 
       38 
43 
     | 
    
         
             
               => "Route target: 4:1"
         
     | 
| 
       39 
44 
     | 
    
         
             
               > puts upd.path_attribute.mp_reach.nlris[0]
         
     | 
| 
       40 
45 
     | 
    
         
             
               => "Label Stack=16000 (bottom) RD=19:17, ID=1, IPv4=10.1.1.0/24"
         
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
       42 
47 
     | 
    
         
             
            === 0.0.14 February 5, 2012
         
     | 
| 
       43 
48 
     | 
    
         
             
            * add support for accumulated igp metric attribute
         
     | 
| 
       44 
49 
     | 
    
         
             
            * add support for VPN default_route RD: 0/0
         
     | 
| 
         @@ -51,7 +56,7 @@ 
     | 
|
| 
       51 
56 
     | 
    
         | 
| 
       52 
57 
     | 
    
         
             
            === 0.0.12 February 13, 2011
         
     | 
| 
       53 
58 
     | 
    
         
             
            * add add-path capability support
         
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
       55 
60 
     | 
    
         
             
            === 0.0.11 January 8, 2011
         
     | 
| 
       56 
61 
     | 
    
         
             
            * stop using autoload
         
     | 
| 
       57 
62 
     | 
    
         
             
            * fix Communities#has_no_<well_known_community>? predicates
         
     | 
| 
         @@ -64,26 +69,26 @@ 
     | 
|
| 
       64 
69 
     | 
    
         
             
               pa.has_a_local_pref?
         
     | 
| 
       65 
70 
     | 
    
         
             
               pa.has_a_aggregator?
         
     | 
| 
       66 
71 
     | 
    
         
             
               pa.has_a_mp_reach?
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
            * example that shows how to use 
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
            * example that shows how to use
         
     | 
| 
       69 
74 
     | 
    
         
             
                bgpdata.netsec.colostate.edu bgp xml feed with bgp4r
         
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
       71 
76 
     | 
    
         
             
            === 0.0.9 October 12, 2010
         
     | 
| 
       72 
77 
     | 
    
         
             
            * add support for Capability message
         
     | 
| 
       73 
     | 
    
         
            -
            * add notification code 7 subcode 1,2,3,4 
     | 
| 
      
 78 
     | 
    
         
            +
            * add notification code 7 subcode 1,2,3,4
         
     | 
| 
       74 
79 
     | 
    
         
             
            * refactoring capabilities adding dynamic capability opt parameter
         
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
            === 0.0.8 September 30, 2010 
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
            === 0.0.8 September 30, 2010
         
     | 
| 
       77 
82 
     | 
    
         
             
            * add end of rib markers
         
     | 
| 
       78 
83 
     | 
    
         
             
               eg
         
     | 
| 
       79 
     | 
    
         
            -
                Mp_unreach.new(:afi=>1, :safi=>4).to_shex 
     | 
| 
      
 84 
     | 
    
         
            +
                Mp_unreach.new(:afi=>1, :safi=>4).to_shex
         
     | 
| 
       80 
85 
     | 
    
         
             
                => '800f03000104'
         
     | 
| 
       81 
     | 
    
         
            -
                Mp_unreach.new(:afi=>1, :safi=>128).to_shex 
     | 
| 
      
 86 
     | 
    
         
            +
                Mp_unreach.new(:afi=>1, :safi=>128).to_shex
         
     | 
| 
       82 
87 
     | 
    
         
             
                => '800f03000180'
         
     | 
| 
       83 
     | 
    
         
            -
                Mp_unreach.new(:afi=>1, :safi=>2).to_shex 
     | 
| 
      
 88 
     | 
    
         
            +
                Mp_unreach.new(:afi=>1, :safi=>2).to_shex
         
     | 
| 
       84 
89 
     | 
    
         
             
                => '800f03000102'
         
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
            * change optional parameter length encoding 
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
            * change optional parameter length encoding
         
     | 
| 
       87 
92 
     | 
    
         
             
                 as per draft-ietf-idr-ext-opt-param-01
         
     | 
| 
       88 
93 
     | 
    
         | 
| 
       89 
94 
     | 
    
         
             
            === 0.0.7 September 12, 2010
         
     | 
| 
         @@ -98,7 +103,7 @@ 
     | 
|
| 
       98 
103 
     | 
    
         
             
            === 0.0.5 August 14, 2010
         
     | 
| 
       99 
104 
     | 
    
         | 
| 
       100 
105 
     | 
    
         
             
            * allow for appending Nlri to update object
         
     | 
| 
       101 
     | 
    
         
            -
              eg, 
     | 
| 
      
 106 
     | 
    
         
            +
              eg,
         
     | 
| 
       102 
107 
     | 
    
         | 
| 
       103 
108 
     | 
    
         
             
               u = Update.new
         
     | 
| 
       104 
109 
     | 
    
         
             
               u << '100.0.0.0/13'
         
     | 
| 
         @@ -110,20 +115,20 @@ 
     | 
|
| 
       110 
115 
     | 
    
         
             
               >> puts u.nlri.to_s
         
     | 
| 
       111 
116 
     | 
    
         
             
               => 100.0.0.0/13
         
     | 
| 
       112 
117 
     | 
    
         
             
                  99.0.0.0/12
         
     | 
| 
       113 
     | 
    
         
            -
             
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
       114 
119 
     | 
    
         
             
            * allow for apending Attributes to an Update object
         
     | 
| 
       115 
120 
     | 
    
         
             
               eg,
         
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
       117 
122 
     | 
    
         
             
                update = Update.new
         
     | 
| 
       118 
123 
     | 
    
         
             
                update << Origin.new
         
     | 
| 
       119 
124 
     | 
    
         
             
                update << Next_hop.new('10.0.0.1')
         
     | 
| 
       120 
     | 
    
         
            -
                update << As_path.new(1,2,3,4,5,6,7,8) 
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
      
 125 
     | 
    
         
            +
                update << As_path.new(1,2,3,4,5,6,7,8)
         
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
       122 
127 
     | 
    
         
             
            === 0.0.4 June 30, 2009
         
     | 
| 
       123 
128 
     | 
    
         
             
            === 0.0.3 June 29, 2009
         
     | 
| 
       124 
129 
     | 
    
         
             
            === 0.0.2 June 29, 2009
         
     | 
| 
       125 
130 
     | 
    
         
             
            * example of how to code a simple route generator using bgp4r
         
     | 
| 
       126 
131 
     | 
    
         | 
| 
       127 
132 
     | 
    
         
             
            === 0.0.1 Fri Jun 26 2009
         
     | 
| 
       128 
     | 
    
         
            -
            * Initial commit 
     | 
| 
      
 133 
     | 
    
         
            +
            * Initial commit
         
     | 
| 
       129 
134 
     | 
    
         | 
| 
         @@ -0,0 +1,298 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'bgp4r'
         
     | 
| 
      
 2 
     | 
    
         
            +
            include BGP
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            def create_fiber(base_prefix, nprefix=22, npack=10)
         
     | 
| 
      
 5 
     | 
    
         
            +
              fiber = Fiber.new do 
         
     | 
| 
      
 6 
     | 
    
         
            +
                ipaddr = IPAddr.new(base_prefix)
         
     | 
| 
      
 7 
     | 
    
         
            +
                prefixes=[]
         
     | 
| 
      
 8 
     | 
    
         
            +
                nprefix.times do |i|
         
     | 
| 
      
 9 
     | 
    
         
            +
                  prefixes << (ipaddr ^ i)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  next unless (i%npack)==0
         
     | 
| 
      
 11 
     | 
    
         
            +
                  Fiber.yield prefixes
         
     | 
| 
      
 12 
     | 
    
         
            +
                  prefixes=[]
         
     | 
| 
      
 13 
     | 
    
         
            +
                end
         
     | 
| 
      
 14 
     | 
    
         
            +
                Fiber.yield prefixes unless prefixes.empty?
         
     | 
| 
      
 15 
     | 
    
         
            +
                nil
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
              fiber
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            nexthop4='192.168.131.20'
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            pa = Path_attribute.new(
         
     | 
| 
      
 23 
     | 
    
         
            +
             Next_hop.new(nexthop4),
         
     | 
| 
      
 24 
     | 
    
         
            +
             Origin.new(0),
         
     | 
| 
      
 25 
     | 
    
         
            +
             As_path.new(200),
         
     | 
| 
      
 26 
     | 
    
         
            +
             Local_pref.new(100),
         
     | 
| 
      
 27 
     | 
    
         
            +
            )
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            ipv4_routes = create_fiber("13.11.0.0/26")
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            Log.create
         
     | 
| 
      
 32 
     | 
    
         
            +
            Log.level=Logger::DEBUG
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            n = Neighbor.new :my_as=> 197014, :remote_addr => '192.168.131.11', :id=> '0.0.0.1'
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            n.capability_mbgp_ipv4_unicast  
         
     | 
| 
      
 37 
     | 
    
         
            +
            n.capability_four_byte_as
         
     | 
| 
      
 38 
     | 
    
         
            +
            n.start
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
            while subnets = ipv4_routes.resume
         
     | 
| 
      
 42 
     | 
    
         
            +
              n.send_message Update.new pa.replace(Mp_reach.new(:afi=>1, :safi=>1, :nexthop=> nexthop4, :nlris=> subnets))
         
     | 
| 
      
 43 
     | 
    
         
            +
            end
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            sleep(300)
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
            __END__
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            Produces:
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
            jme@ubuntu:/mnt/hgfs/jme/routing/bgp4r$ ifconfig tap0 | grep inet
         
     | 
| 
      
 55 
     | 
    
         
            +
                      inet addr:192.168.131.20  Bcast:192.168.131.255  Mask:255.255.255.0
         
     | 
| 
      
 56 
     | 
    
         
            +
             
     | 
| 
      
 57 
     | 
    
         
            +
            R11# show running config
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
            !
         
     | 
| 
      
 60 
     | 
    
         
            +
            router bgp 197014
         
     | 
| 
      
 61 
     | 
    
         
            +
             bgp router-id 2.2.2.2
         
     | 
| 
      
 62 
     | 
    
         
            +
             bgp log-neighbor-changes
         
     | 
| 
      
 63 
     | 
    
         
            +
             neighbor 192.168.131.20 remote-as 197014
         
     | 
| 
      
 64 
     | 
    
         
            +
             !
         
     | 
| 
      
 65 
     | 
    
         
            +
             address-family ipv4
         
     | 
| 
      
 66 
     | 
    
         
            +
              neighbor 192.168.131.20 activate
         
     | 
| 
      
 67 
     | 
    
         
            +
             exit-address-family
         
     | 
| 
      
 68 
     | 
    
         
            +
            !
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
            R11#show ip route bgp
         
     | 
| 
      
 71 
     | 
    
         
            +
            Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
         
     | 
| 
      
 72 
     | 
    
         
            +
                   D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
         
     | 
| 
      
 73 
     | 
    
         
            +
                   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
         
     | 
| 
      
 74 
     | 
    
         
            +
                   E1 - OSPF external type 1, E2 - OSPF external type 2
         
     | 
| 
      
 75 
     | 
    
         
            +
                   i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
         
     | 
| 
      
 76 
     | 
    
         
            +
                   ia - IS-IS inter area, * - candidate default, U - per-user static route
         
     | 
| 
      
 77 
     | 
    
         
            +
                   o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
         
     | 
| 
      
 78 
     | 
    
         
            +
                   + - replicated route, % - next hop override
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
            Gateway of last resort is not set
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
                  13.0.0.0/26 is subnetted, 22 subnets
         
     | 
| 
      
 83 
     | 
    
         
            +
            B        13.11.0.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 84 
     | 
    
         
            +
            B        13.11.0.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 85 
     | 
    
         
            +
            B        13.11.0.128 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 86 
     | 
    
         
            +
            B        13.11.0.192 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 87 
     | 
    
         
            +
            B        13.11.1.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 88 
     | 
    
         
            +
            B        13.11.1.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 89 
     | 
    
         
            +
            B        13.11.1.128 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 90 
     | 
    
         
            +
            B        13.11.1.192 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 91 
     | 
    
         
            +
            B        13.11.2.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 92 
     | 
    
         
            +
            B        13.11.2.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 93 
     | 
    
         
            +
            B        13.11.2.128 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 94 
     | 
    
         
            +
            B        13.11.2.192 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 95 
     | 
    
         
            +
            B        13.11.3.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 96 
     | 
    
         
            +
            B        13.11.3.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 97 
     | 
    
         
            +
            B        13.11.3.128 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 98 
     | 
    
         
            +
            B        13.11.3.192 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 99 
     | 
    
         
            +
            B        13.11.4.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 100 
     | 
    
         
            +
            B        13.11.4.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 101 
     | 
    
         
            +
            B        13.11.4.128 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 102 
     | 
    
         
            +
            B        13.11.4.192 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 103 
     | 
    
         
            +
            B        13.11.5.0 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 104 
     | 
    
         
            +
            B        13.11.5.64 [200/0] via 192.168.131.20, 00:04:55
         
     | 
| 
      
 105 
     | 
    
         
            +
            R11#
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
            jme@ubuntu:/mnt/hgfs/jme/routing/bgp4r$ ruby -I.  examples/ibgp-ios-asn4bytes.rb 
         
     | 
| 
      
 108 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor Open Socket old state Idle new state Active
         
     | 
| 
      
 109 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendOpen
         
     | 
| 
      
 110 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Open Message (1), length: 45
         
     | 
| 
      
 111 
     | 
    
         
            +
              Version 4, my AS 23456, Holdtime 180s, ID 0.0.0.1
         
     | 
| 
      
 112 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [0206010400010001]
         
     | 
| 
      
 113 
     | 
    
         
            +
                Multiprotocol Extensions (1), length: 4
         
     | 
| 
      
 114 
     | 
    
         
            +
                  AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 115 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [0206410400030196]
         
     | 
| 
      
 116 
     | 
    
         
            +
                Capability(65): 4-octet AS number: 197014
         
     | 
| 
      
 117 
     | 
    
         
            +
              
         
     | 
| 
      
 118 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 119 
     | 
    
         
            +
            0x0001:  002d 0104 5ba0 00b4 0000 0001 1002 0601
         
     | 
| 
      
 120 
     | 
    
         
            +
            0x0002:  0400 0100 0102 0641 0400 0301 96
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
             
     | 
| 
      
 123 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : #<BGP::IO::Input:0x00000000ade6e8> #<Thread:0x00000000add888> started
         
     | 
| 
      
 124 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : #<BGP::IO::Output:0x00000000ade5f8> #<Thread:0x00000000add6d0> started
         
     | 
| 
      
 125 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor ev_send_open old state Active new state OpenSent
         
     | 
| 
      
 126 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvOpen
         
     | 
| 
      
 127 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Recv Open Message (1), length: 57
         
     | 
| 
      
 128 
     | 
    
         
            +
              Version 4, my AS 23456, Holdtime 180s, ID 2.2.2.2
         
     | 
| 
      
 129 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [0206010400010001]
         
     | 
| 
      
 130 
     | 
    
         
            +
                Multiprotocol Extensions (1), length: 4
         
     | 
| 
      
 131 
     | 
    
         
            +
                  AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 132 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [02028000]
         
     | 
| 
      
 133 
     | 
    
         
            +
                Route Refresh (Cisco) (128), length: 2
         
     | 
| 
      
 134 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [02020200]
         
     | 
| 
      
 135 
     | 
    
         
            +
                Route Refresh (2), length: 2
         
     | 
| 
      
 136 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [02024600]
         
     | 
| 
      
 137 
     | 
    
         
            +
              Option Capabilities Advertisement (2): [0206410400030196]
         
     | 
| 
      
 138 
     | 
    
         
            +
                Capability(65): 4-octet AS number: 197014
         
     | 
| 
      
 139 
     | 
    
         
            +
              
         
     | 
| 
      
 140 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 141 
     | 
    
         
            +
            0x0001:  0039 0104 5ba0 00b4 0202 0202 1c02 0601
         
     | 
| 
      
 142 
     | 
    
         
            +
            0x0002:  0400 0100 0102 0280 0002 0202 0002 0246
         
     | 
| 
      
 143 
     | 
    
         
            +
            0x0003:  0002 0641 0400 0301 96
         
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
      
 146 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvOpen old state OpenSent new state OpenConfirm
         
     | 
| 
      
 147 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvKeepalive
         
     | 
| 
      
 148 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Recv Keepalive Message (4), length: 19, [001304]
         
     | 
| 
      
 149 
     | 
    
         
            +
             
     | 
| 
      
 150 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendKeepalive
         
     | 
| 
      
 151 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Keepalive Message (4), length: 19, [001304]
         
     | 
| 
      
 152 
     | 
    
         
            +
             
     | 
| 
      
 153 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor SendKeepAlive state is OpenConfirm
         
     | 
| 
      
 154 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvKeepAlive old state OpenConfirm new state Established
         
     | 
| 
      
 155 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor version: 4, id: 0.0.0.1, as: 197014, holdtime: 180, peer addr: 192.168.131.11, local addr:  started
         
     | 
| 
      
 156 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendUpdate
         
     | 
| 
      
 157 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Update Message (2), length: 65
         
     | 
| 
      
 158 
     | 
    
         
            +
            Path Attributes:
         
     | 
| 
      
 159 
     | 
    
         
            +
              Next Hop (3), length: 4, Flags [T]: 192.168.131.20
         
     | 
| 
      
 160 
     | 
    
         
            +
               0x0000:  c0a8 8314
         
     | 
| 
      
 161 
     | 
    
         
            +
              Origin (1), length: 1, Flags [T]: igp
         
     | 
| 
      
 162 
     | 
    
         
            +
               0x0000:  00
         
     | 
| 
      
 163 
     | 
    
         
            +
              As Path (2), length: 4, Flags [T]: 200
         
     | 
| 
      
 164 
     | 
    
         
            +
               0x0000:  0201 00c8
         
     | 
| 
      
 165 
     | 
    
         
            +
              Local Pref (5), length: 4, Flags [T]: (0x0064) 100
         
     | 
| 
      
 166 
     | 
    
         
            +
               0x0000:  0000 0064
         
     | 
| 
      
 167 
     | 
    
         
            +
              Mp Reach (14), length: 14, Flags [O]: 
         
     | 
| 
      
 168 
     | 
    
         
            +
                AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 169 
     | 
    
         
            +
                nexthop: 192.168.131.20
         
     | 
| 
      
 170 
     | 
    
         
            +
                  13.11.0.0/26
         
     | 
| 
      
 171 
     | 
    
         
            +
               0x0000:  0001 0104 c0a8 8314 001a 0d0b 0000
         
     | 
| 
      
 172 
     | 
    
         
            +
             
     | 
| 
      
 173 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 174 
     | 
    
         
            +
            0x0001:  0041 0200 0000 2a40 0304 c0a8 8314 4001
         
     | 
| 
      
 175 
     | 
    
         
            +
            0x0002:  0100 4002 0402 0100 c840 0504 0000 0064
         
     | 
| 
      
 176 
     | 
    
         
            +
            0x0003:  800e 0e00 0101 04c0 a883 1400 1a0d 0b00
         
     | 
| 
      
 177 
     | 
    
         
            +
            0x0004:  00
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
             
     | 
| 
      
 180 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendUpdate
         
     | 
| 
      
 181 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Update Message (2), length: 110
         
     | 
| 
      
 182 
     | 
    
         
            +
            Path Attributes:
         
     | 
| 
      
 183 
     | 
    
         
            +
              Next Hop (3), length: 4, Flags [T]: 192.168.131.20
         
     | 
| 
      
 184 
     | 
    
         
            +
               0x0000:  c0a8 8314
         
     | 
| 
      
 185 
     | 
    
         
            +
              Origin (1), length: 1, Flags [T]: igp
         
     | 
| 
      
 186 
     | 
    
         
            +
               0x0000:  00
         
     | 
| 
      
 187 
     | 
    
         
            +
              As Path (2), length: 4, Flags [T]: 200
         
     | 
| 
      
 188 
     | 
    
         
            +
               0x0000:  0201 00c8
         
     | 
| 
      
 189 
     | 
    
         
            +
              Local Pref (5), length: 4, Flags [T]: (0x0064) 100
         
     | 
| 
      
 190 
     | 
    
         
            +
               0x0000:  0000 0064
         
     | 
| 
      
 191 
     | 
    
         
            +
              Mp Reach (14), length: 59, Flags [O]: 
         
     | 
| 
      
 192 
     | 
    
         
            +
                AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 193 
     | 
    
         
            +
                nexthop: 192.168.131.20
         
     | 
| 
      
 194 
     | 
    
         
            +
                  13.11.0.64/26
         
     | 
| 
      
 195 
     | 
    
         
            +
                  13.11.0.128/26
         
     | 
| 
      
 196 
     | 
    
         
            +
                  13.11.0.192/26
         
     | 
| 
      
 197 
     | 
    
         
            +
                  13.11.1.0/26
         
     | 
| 
      
 198 
     | 
    
         
            +
                  13.11.1.64/26
         
     | 
| 
      
 199 
     | 
    
         
            +
                  13.11.1.128/26
         
     | 
| 
      
 200 
     | 
    
         
            +
                  13.11.1.192/26
         
     | 
| 
      
 201 
     | 
    
         
            +
                  13.11.2.0/26
         
     | 
| 
      
 202 
     | 
    
         
            +
                  13.11.2.64/26
         
     | 
| 
      
 203 
     | 
    
         
            +
                  13.11.2.128/26
         
     | 
| 
      
 204 
     | 
    
         
            +
               0x0000:  0001 0104 c0a8 8314 001a 0d0b 0040 1a0d
         
     | 
| 
      
 205 
     | 
    
         
            +
               0x0001:  0b00 801a 0d0b 00c0 1a0d 0b01 001a 0d0b
         
     | 
| 
      
 206 
     | 
    
         
            +
               0x0002:  0140 1a0d 0b01 801a 0d0b 01c0 1a0d 0b02
         
     | 
| 
      
 207 
     | 
    
         
            +
               0x0003:  001a 0d0b 0240 1a0d 0b02 80
         
     | 
| 
      
 208 
     | 
    
         
            +
             
     | 
| 
      
 209 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 210 
     | 
    
         
            +
            0x0001:  006e 0200 0000 5740 0304 c0a8 8314 4001
         
     | 
| 
      
 211 
     | 
    
         
            +
            0x0002:  0100 4002 0402 0100 c840 0504 0000 0064
         
     | 
| 
      
 212 
     | 
    
         
            +
            0x0003:  800e 3b00 0101 04c0 a883 1400 1a0d 0b00
         
     | 
| 
      
 213 
     | 
    
         
            +
            0x0004:  401a 0d0b 0080 1a0d 0b00 c01a 0d0b 0100
         
     | 
| 
      
 214 
     | 
    
         
            +
            0x0005:  1a0d 0b01 401a 0d0b 0180 1a0d 0b01 c01a
         
     | 
| 
      
 215 
     | 
    
         
            +
            0x0006:  0d0b 0200 1a0d 0b02 401a 0d0b 0280
         
     | 
| 
      
 216 
     | 
    
         
            +
             
     | 
| 
      
 217 
     | 
    
         
            +
             
     | 
| 
      
 218 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendUpdate
         
     | 
| 
      
 219 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Update Message (2), length: 110
         
     | 
| 
      
 220 
     | 
    
         
            +
            Path Attributes:
         
     | 
| 
      
 221 
     | 
    
         
            +
              Next Hop (3), length: 4, Flags [T]: 192.168.131.20
         
     | 
| 
      
 222 
     | 
    
         
            +
               0x0000:  c0a8 8314
         
     | 
| 
      
 223 
     | 
    
         
            +
              Origin (1), length: 1, Flags [T]: igp
         
     | 
| 
      
 224 
     | 
    
         
            +
               0x0000:  00
         
     | 
| 
      
 225 
     | 
    
         
            +
              As Path (2), length: 4, Flags [T]: 200
         
     | 
| 
      
 226 
     | 
    
         
            +
               0x0000:  0201 00c8
         
     | 
| 
      
 227 
     | 
    
         
            +
              Local Pref (5), length: 4, Flags [T]: (0x0064) 100
         
     | 
| 
      
 228 
     | 
    
         
            +
               0x0000:  0000 0064
         
     | 
| 
      
 229 
     | 
    
         
            +
              Mp Reach (14), length: 59, Flags [O]: 
         
     | 
| 
      
 230 
     | 
    
         
            +
                AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 231 
     | 
    
         
            +
                nexthop: 192.168.131.20
         
     | 
| 
      
 232 
     | 
    
         
            +
                  13.11.2.192/26
         
     | 
| 
      
 233 
     | 
    
         
            +
                  13.11.3.0/26
         
     | 
| 
      
 234 
     | 
    
         
            +
                  13.11.3.64/26
         
     | 
| 
      
 235 
     | 
    
         
            +
                  13.11.3.128/26
         
     | 
| 
      
 236 
     | 
    
         
            +
                  13.11.3.192/26
         
     | 
| 
      
 237 
     | 
    
         
            +
                  13.11.4.0/26
         
     | 
| 
      
 238 
     | 
    
         
            +
                  13.11.4.64/26
         
     | 
| 
      
 239 
     | 
    
         
            +
                  13.11.4.128/26
         
     | 
| 
      
 240 
     | 
    
         
            +
                  13.11.4.192/26
         
     | 
| 
      
 241 
     | 
    
         
            +
                  13.11.5.0/26
         
     | 
| 
      
 242 
     | 
    
         
            +
               0x0000:  0001 0104 c0a8 8314 001a 0d0b 02c0 1a0d
         
     | 
| 
      
 243 
     | 
    
         
            +
               0x0001:  0b03 001a 0d0b 0340 1a0d 0b03 801a 0d0b
         
     | 
| 
      
 244 
     | 
    
         
            +
               0x0002:  03c0 1a0d 0b04 001a 0d0b 0440 1a0d 0b04
         
     | 
| 
      
 245 
     | 
    
         
            +
               0x0003:  801a 0d0b 04c0 1a0d 0b05 00
         
     | 
| 
      
 246 
     | 
    
         
            +
             
     | 
| 
      
 247 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 248 
     | 
    
         
            +
            0x0001:  006e 0200 0000 5740 0304 c0a8 8314 4001
         
     | 
| 
      
 249 
     | 
    
         
            +
            0x0002:  0100 4002 0402 0100 c840 0504 0000 0064
         
     | 
| 
      
 250 
     | 
    
         
            +
            0x0003:  800e 3b00 0101 04c0 a883 1400 1a0d 0b02
         
     | 
| 
      
 251 
     | 
    
         
            +
            0x0004:  c01a 0d0b 0300 1a0d 0b03 401a 0d0b 0380
         
     | 
| 
      
 252 
     | 
    
         
            +
            0x0005:  1a0d 0b03 c01a 0d0b 0400 1a0d 0b04 401a
         
     | 
| 
      
 253 
     | 
    
         
            +
            0x0006:  0d0b 0480 1a0d 0b04 c01a 0d0b 0500
         
     | 
| 
      
 254 
     | 
    
         
            +
             
     | 
| 
      
 255 
     | 
    
         
            +
             
     | 
| 
      
 256 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor SendUpdate
         
     | 
| 
      
 257 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Send Update Message (2), length: 65
         
     | 
| 
      
 258 
     | 
    
         
            +
            Path Attributes:
         
     | 
| 
      
 259 
     | 
    
         
            +
              Next Hop (3), length: 4, Flags [T]: 192.168.131.20
         
     | 
| 
      
 260 
     | 
    
         
            +
               0x0000:  c0a8 8314
         
     | 
| 
      
 261 
     | 
    
         
            +
              Origin (1), length: 1, Flags [T]: igp
         
     | 
| 
      
 262 
     | 
    
         
            +
               0x0000:  00
         
     | 
| 
      
 263 
     | 
    
         
            +
              As Path (2), length: 4, Flags [T]: 200
         
     | 
| 
      
 264 
     | 
    
         
            +
               0x0000:  0201 00c8
         
     | 
| 
      
 265 
     | 
    
         
            +
              Local Pref (5), length: 4, Flags [T]: (0x0064) 100
         
     | 
| 
      
 266 
     | 
    
         
            +
               0x0000:  0000 0064
         
     | 
| 
      
 267 
     | 
    
         
            +
              Mp Reach (14), length: 14, Flags [O]: 
         
     | 
| 
      
 268 
     | 
    
         
            +
                AFI IPv4 (1), SAFI Unicast (1)
         
     | 
| 
      
 269 
     | 
    
         
            +
                nexthop: 192.168.131.20
         
     | 
| 
      
 270 
     | 
    
         
            +
                  13.11.5.64/26
         
     | 
| 
      
 271 
     | 
    
         
            +
               0x0000:  0001 0104 c0a8 8314 001a 0d0b 0540
         
     | 
| 
      
 272 
     | 
    
         
            +
             
     | 
| 
      
 273 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 274 
     | 
    
         
            +
            0x0001:  0041 0200 0000 2a40 0304 c0a8 8314 4001
         
     | 
| 
      
 275 
     | 
    
         
            +
            0x0002:  0100 4002 0402 0100 c840 0504 0000 0064
         
     | 
| 
      
 276 
     | 
    
         
            +
            0x0003:  800e 0e00 0101 04c0 a883 1400 1a0d 0b05
         
     | 
| 
      
 277 
     | 
    
         
            +
            0x0004:  40
         
     | 
| 
      
 278 
     | 
    
         
            +
             
     | 
| 
      
 279 
     | 
    
         
            +
             
     | 
| 
      
 280 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvKeepalive
         
     | 
| 
      
 281 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Recv Keepalive Message (4), length: 19, [001304]
         
     | 
| 
      
 282 
     | 
    
         
            +
             
     | 
| 
      
 283 
     | 
    
         
            +
            I, [08:16#19199]  INFO -- : BGP::Neighbor RecvUpdate
         
     | 
| 
      
 284 
     | 
    
         
            +
            D, [08:16#19199] DEBUG -- : BGP::Neighbor Recv Update Message (2), length: 23
         
     | 
| 
      
 285 
     | 
    
         
            +
             
     | 
| 
      
 286 
     | 
    
         
            +
             
     | 
| 
      
 287 
     | 
    
         
            +
            0x0000:  ffff ffff ffff ffff ffff ffff ffff ffff
         
     | 
| 
      
 288 
     | 
    
         
            +
            0x0001:  0017 0200 0000 00
         
     | 
| 
      
 289 
     | 
    
         
            +
             
     | 
| 
      
 290 
     | 
    
         
            +
             
     | 
| 
      
 291 
     | 
    
         
            +
            I, [09:08#19199]  INFO -- : BGP::Neighbor RecvKeepalive
         
     | 
| 
      
 292 
     | 
    
         
            +
            D, [09:08#19199] DEBUG -- : BGP::Neighbor Recv Keepalive Message (4), length: 19, [001304]
         
     | 
| 
      
 293 
     | 
    
         
            +
             
     | 
| 
      
 294 
     | 
    
         
            +
            I, [09:16#19199]  INFO -- : BGP::Neighbor SendKeepalive
         
     | 
| 
      
 295 
     | 
    
         
            +
            D, [09:16#19199] DEBUG -- : BGP::Neighbor Send Keepalive Message (4), length: 19, [001304]
         
     | 
| 
      
 296 
     | 
    
         
            +
             
     | 
| 
      
 297 
     | 
    
         
            +
            I, [10:01#19199]  INFO -- : BGP::Neighbor RecvKeepalive
         
     | 
| 
      
 298 
     | 
    
         
            +
            D, [10:01#19199] DEBUG -- : BGP::Neighbor Recv Keepalive Message (4), length: 19, [001304]
         
     | 
| 
         @@ -100,4 +100,10 @@ class Open_Test < Test::Unit::TestCase 
     | 
|
| 
       100 
100 
     | 
    
         
             
                assert open.find(Route_refresh)
         
     | 
| 
       101 
101 
     | 
    
         
             
                assert open.find(Add_path)
         
     | 
| 
       102 
102 
     | 
    
         
             
              end
         
     | 
| 
      
 103 
     | 
    
         
            +
              def test_5
         
     | 
| 
      
 104 
     | 
    
         
            +
                open = Open.new(4,0xffff, 200, '10.0.0.1')
         
     | 
| 
      
 105 
     | 
    
         
            +
                assert_match /my AS 65535/, open.to_s
         
     | 
| 
      
 106 
     | 
    
         
            +
                open = Open.new(4,0x1ffff, 200, '10.0.0.1')
         
     | 
| 
      
 107 
     | 
    
         
            +
                assert_match /my AS 23456/, open.to_s
         
     | 
| 
      
 108 
     | 
    
         
            +
              end
         
     | 
| 
       103 
109 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: bgp4r
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.18
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jean-Michel Esnault
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-10-17 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: Best way to play with BGP protocol using ruby
         
     | 
| 
       14 
14 
     | 
    
         
             
            email: jesnault@gmail.com
         
     | 
| 
         @@ -17,6 +17,61 @@ extensions: [] 
     | 
|
| 
       17 
17 
     | 
    
         
             
            extra_rdoc_files:
         
     | 
| 
       18 
18 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       19 
19 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
      
 20 
     | 
    
         
            +
            - bgp/common.rb
         
     | 
| 
      
 21 
     | 
    
         
            +
            - bgp/iana.rb
         
     | 
| 
      
 22 
     | 
    
         
            +
            - bgp/io.rb
         
     | 
| 
      
 23 
     | 
    
         
            +
            - bgp/messages/capability.rb
         
     | 
| 
      
 24 
     | 
    
         
            +
            - bgp/messages/keepalive.rb
         
     | 
| 
      
 25 
     | 
    
         
            +
            - bgp/messages/markers.rb
         
     | 
| 
      
 26 
     | 
    
         
            +
            - bgp/messages/message.rb
         
     | 
| 
      
 27 
     | 
    
         
            +
            - bgp/messages/messages.rb
         
     | 
| 
      
 28 
     | 
    
         
            +
            - bgp/messages/notification.rb
         
     | 
| 
      
 29 
     | 
    
         
            +
            - bgp/messages/open.rb
         
     | 
| 
      
 30 
     | 
    
         
            +
            - bgp/messages/route_refresh.rb
         
     | 
| 
      
 31 
     | 
    
         
            +
            - bgp/messages/update.rb
         
     | 
| 
      
 32 
     | 
    
         
            +
            - bgp/misc/live_feed.rb
         
     | 
| 
      
 33 
     | 
    
         
            +
            - bgp/neighbor/add_path_cap.rb
         
     | 
| 
      
 34 
     | 
    
         
            +
            - bgp/neighbor/neighbor.rb
         
     | 
| 
      
 35 
     | 
    
         
            +
            - bgp/nlris/inet.rb
         
     | 
| 
      
 36 
     | 
    
         
            +
            - bgp/nlris/label.rb
         
     | 
| 
      
 37 
     | 
    
         
            +
            - bgp/nlris/labeled.rb
         
     | 
| 
      
 38 
     | 
    
         
            +
            - bgp/nlris/mapped_ipv4.rb
         
     | 
| 
      
 39 
     | 
    
         
            +
            - bgp/nlris/nlri.rb
         
     | 
| 
      
 40 
     | 
    
         
            +
            - bgp/nlris/nlris.rb
         
     | 
| 
      
 41 
     | 
    
         
            +
            - bgp/nlris/nsap.rb
         
     | 
| 
      
 42 
     | 
    
         
            +
            - bgp/nlris/prefix.rb
         
     | 
| 
      
 43 
     | 
    
         
            +
            - bgp/nlris/rd.rb
         
     | 
| 
      
 44 
     | 
    
         
            +
            - bgp/nlris/vpn.rb
         
     | 
| 
      
 45 
     | 
    
         
            +
            - bgp/optional_parameters/add_path.rb
         
     | 
| 
      
 46 
     | 
    
         
            +
            - bgp/optional_parameters/as4.rb
         
     | 
| 
      
 47 
     | 
    
         
            +
            - bgp/optional_parameters/capabilities.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - bgp/optional_parameters/capability.rb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - bgp/optional_parameters/dynamic.rb
         
     | 
| 
      
 50 
     | 
    
         
            +
            - bgp/optional_parameters/graceful_restart.rb
         
     | 
| 
      
 51 
     | 
    
         
            +
            - bgp/optional_parameters/mbgp.rb
         
     | 
| 
      
 52 
     | 
    
         
            +
            - bgp/optional_parameters/optional_parameter.rb
         
     | 
| 
      
 53 
     | 
    
         
            +
            - bgp/optional_parameters/orf.rb
         
     | 
| 
      
 54 
     | 
    
         
            +
            - bgp/optional_parameters/route_refresh.rb
         
     | 
| 
      
 55 
     | 
    
         
            +
            - bgp/orfs/orf.rb
         
     | 
| 
      
 56 
     | 
    
         
            +
            - bgp/orfs/prefix_orf.rb
         
     | 
| 
      
 57 
     | 
    
         
            +
            - bgp/path_attributes/aggregator.rb
         
     | 
| 
      
 58 
     | 
    
         
            +
            - bgp/path_attributes/aigp.rb
         
     | 
| 
      
 59 
     | 
    
         
            +
            - bgp/path_attributes/as_path.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
            - bgp/path_attributes/atomic_aggregate.rb
         
     | 
| 
      
 61 
     | 
    
         
            +
            - bgp/path_attributes/attribute.rb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - bgp/path_attributes/attributes.rb
         
     | 
| 
      
 63 
     | 
    
         
            +
            - bgp/path_attributes/cluster_list.rb
         
     | 
| 
      
 64 
     | 
    
         
            +
            - bgp/path_attributes/communities.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
            - bgp/path_attributes/extended_communities.rb
         
     | 
| 
      
 66 
     | 
    
         
            +
            - bgp/path_attributes/extended_community.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
            - bgp/path_attributes/local_pref.rb
         
     | 
| 
      
 68 
     | 
    
         
            +
            - bgp/path_attributes/mp_reach.rb
         
     | 
| 
      
 69 
     | 
    
         
            +
            - bgp/path_attributes/mp_unreach.rb
         
     | 
| 
      
 70 
     | 
    
         
            +
            - bgp/path_attributes/multi_exit_disc.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - bgp/path_attributes/next_hop.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
            - bgp/path_attributes/origin.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
            - bgp/path_attributes/originator_id.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - bgp/path_attributes/path_attribute.rb
         
     | 
| 
       20 
75 
     | 
    
         
             
            files:
         
     | 
| 
       21 
76 
     | 
    
         
             
            - COPYING
         
     | 
| 
       22 
77 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
         @@ -81,6 +136,7 @@ files: 
     | 
|
| 
       81 
136 
     | 
    
         
             
            - changelog.txt
         
     | 
| 
       82 
137 
     | 
    
         
             
            - examples/a_live_feed
         
     | 
| 
       83 
138 
     | 
    
         
             
            - examples/ebgp-vyatta-ipv4-ipv6.rb
         
     | 
| 
      
 139 
     | 
    
         
            +
            - examples/ibgp-ios-asn4bytes.rb
         
     | 
| 
       84 
140 
     | 
    
         
             
            - examples/ibgp-vyatta-ipv6.rb
         
     | 
| 
       85 
141 
     | 
    
         
             
            - examples/routegen
         
     | 
| 
       86 
142 
     | 
    
         
             
            - examples/routegen.yml
         
     |