Difference between revisions of "Dynamic routing commands"

From Tech-Wiki
Jump to: navigation, search
Line 14: Line 14:
 
  get router info ospf database self-originate|adv-router
 
  get router info ospf database self-originate|adv-router
 
  get router info ospf database router lsa
 
  get router info ospf database router lsa
 +
 +
Basic BGP configuration
 +
config router bgp
 +
  set as 65100
 +
  set router-id 172.16.1.4
 +
  config neighbor
 +
    edit "172.1.1.1"
 +
      set remote-as 65200
 +
      set prefix-list-in filter-subnets
 +
    next
 +
  end
 +
  config network
 +
    edit 1
 +
      set prefix 10.1.0.0 255.255.255.0
 +
    next
 +
  end
 +
end
 +
config router prefix-list
 +
  edit filter-subnets
 +
  config rule
 +
    edit 1
 +
      set prefix 10.1.1.0/16
 +
      set action deny
 +
    next
 +
    edit 2
 +
        set prefix 10.0.0.0/8
 +
        set action permit
 +
    next
 +
  end
 +
  end
 +
end
  
 
In order to advertise non-local routes to BGP peers, it's required to define them in the local routing table as blackhole
 
In order to advertise non-local routes to BGP peers, it's required to define them in the local routing table as blackhole

Revision as of 23:31, 24 August 2020


Get dynamic routing info:

# BGP
get router info bgp network
get router info bgp summary
get router info bgp neighbors
# OSPF
get router info ospf status
get router info ospf interface
get router info ospf neighbor
get router info ospf database brief
get router info ospf database summary lsa|self-originate|adv-router
get router info ospf database self-originate|adv-router
get router info ospf database router lsa

Basic BGP configuration

config router bgp
 set as 65100
 set router-id 172.16.1.4
 config neighbor
   edit "172.1.1.1"
     set remote-as 65200
     set prefix-list-in filter-subnets
   next
 end
 config network
   edit 1
     set prefix 10.1.0.0 255.255.255.0
   next
 end
end
config router prefix-list
 edit filter-subnets
  config rule
    edit 1
      set prefix 10.1.1.0/16
      set action deny
    next
    edit 2
       set prefix 10.0.0.0/8
       set action permit
    next
  end
 end
end

In order to advertise non-local routes to BGP peers, it's required to define them in the local routing table as blackhole

 config router bgp
  config network
   edit 0
    set prefix 10.0.0.0/8
  end
 end
 config router static
  edit 0
   set dst 10.0.0.0 255.0.0.0
   set blackhole enable
  next
 end

Redistribute default route (cisco default-information originate | neighbor xxx default-originate)

 config router ospf
  set default-information-originate enable
 config router bgp
   config neighbor
     set capability-default-originate enable

Influence outbound routing preference

 config router map
  edit ISP1-pref
  config rule
   edit 10
    set set-local-preference 50
   end
  end
 config router bgp
  config neighbor
   edit 200.0.0.1
    set route-map-out ISP1-pref
   end
 end

Once done doing your changes, restart the routing process

exec router clear bgp ip 200.0.0.1 soft out
exec router clear ospf process

Troubleshoot dynamic routing

diag ip router ospf|bgp all enable
diag ip router ospf|bgp level info
diag debug enable