Command Line Reference
IP Unicast Routing
Route Map
39 min
route map show route map word \[command] show route map word \[purpose] display data about each daemons knowledge of individual route maps \[parameter] word route map name \[view] system view \[use cases] sonic# show route map clear route map counters word \[command] clear route map counters word \[purpose] clear counters that are being stored about the route map utilization so that subsuquent show commands will indicate since the last clear \[parameter] word route map name \[view] system view \[use cases] sonic# clear route map counters show ip prefix list { detail|summary|name } \[command] show ip prefix list {detail|summary| name } \[purpose] display the ip prefix list \[view] system view \[use cases] sonic# show ip prefix list summary bgp large community list {standard|expanded} name {permit|deny} large communityity \[command] bgp large community list {standard|expanded} name {permit|deny} large community no bgp large community list {standard|expanded} name {permit|deny} large community \[purpose] this command defines a new standard large community list \[parameter] standard standard community list expanded expanded community list name community list name large community large community in 'aa\ bb\ cc' format \[view] system configuration view \[notes] when filtering bgp large community attributes, you can configure multiple filter criteria within the same entry the relationship between filter criteria is "and," which means all filter criteria must be matched for the rule to be considered a match for example, with the command " bgp large community list standard test 10 permit 100 1 1 200 1 1 300 1 1," the rule will be considered a match only when all three large community values (100 1 1, 200 1 1, and 300 1 1) are simultaneously present within a single list, multiple rules have an "or" relationship for example, with the commands " bgp large community list standard test 10 permit 100 1 1" and "bgp large community list standard test 20 permit 200 1 1," when searching for rules within the "test" group, matching either 100 1 1 or 200 1 1 will be considered a match \[use cases] sonic# configure terminal sonic(config)# bgp large community list standard as permit aa\ bb\ cc route map word {permit|deny} orderde \[command] route map word {permit|deny} order no route map word {permit|deny} order \[purpose] configure the order’th entry in route map name with match policy of either permit or deny \[parameter] word route map name order sequence to insert to/delete from existing route map entry (1 65535) \[notes] this command unconfigures the order entry in the routing table name \[view] system configuration view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 ip prefix name \[command] ip prefix name \[seq number ] {permit|deny} {any| a b c d/m {ge|le} length } no ip prefix name \[purpose] configures an ip prefix list or one entry in the ip prefix list \[parameter] parameter description name specifies the name of an ip prefix list seq number specifies the sequence number of the entry in the ip prefix list the value is an integer ranging from 1 to 4294967295, by default, the sequence number increases with a step of 5 according to the configuration order, and the first number is 1 permit specifies the matching mode of the ip prefix list as permit in permit mode, if the ip address to be filtered is in the defined prefix range, the ip address matches the route policy and no longer match against the next entry otherwise, the ip address continues to match against the next entry deny specifies the matching mode of the ip prefix list as deny in deny mode, if the ip address to be filtered is in the defined prefix range, the ip address fails to match the route policy and cannot match against the next entry otherwise, the ip address continues to match against the next entry any all ip address a b c d/m specifies the ip address ge length specifies the minimum value of the mask length range le length specifies the maximum value of the mask length range description specifies the description information of the ip prefix list \[notes] an ip prefix list can be used as a filter or as filtering conditions of a route map the matching principle of table entries in the address prefix list is match according to the ordinal id from smallest to largest, and no other table entries will be matched after the filtered route hits a certain table entry, and the route that cannot match any table entry is deemed to have failed the filter and will not enter any subsequent processing \[view] system config view \[use cases] sonic(config)# ip prefix list test permit 1 1 1 0/24 ge 32 match {ip|ipv6} address { prefix len length|prefix list prefix list name } \[command] match {ip|ipv6} address {prefix len length |prefix list prefix list name } no match {ip|ipv6} address {prefix len length |prefix list prefix list name } \[purpose] matches the specified prefix list \[parameter] length match prefix length of ip address prefix list name match entries of prefix lists \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match ip address prefix list test match {ip|ipv6} next hop {prefix len length|prefix list prefix list name|address{a b c d|x\ x x\ x}|type blackhole} \[command] match {ip|ipv6} next hop {prefix len length |prefix list prefix list name |address{ a b c d | x\ x x \ x }|type blackhole} no match {ip|ipv6} next hop {prefix len length |prefix list prefix list name |address{ a b c d | x\ x x \ x }|type blackhole} \[purpose] match the next hop \[parameter] length match prefix length of ip address prefix list name match entries of prefix lists a b c d ip address of next hop x\ x x \ x ipv6 address of next hop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match ip next hop type blackhole match as path string \[command] match as path string no match as path string \[purpose] matches the specified as path \[parameter] string as path access list name \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match as path test match metric metric \[command] match metric metric no match metric metric \[purpose] matches the specified metric \[parameter] metric value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match metric 12 match tag tag \[command] match tag tag no match tag tag \[purpose] matches the specified tag value associated with the route \[parameter] tag tag value (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match tag 12 match local preference metric \[command] match local preference metric no match local preference metric \[purpose] matches the specified local preference \[parameter] metric metric value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match local preference 12 match community community list \[command] match community community list no math community community list \[purpose] matches the specified community list \[parameter] community list community list name \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match community test match peer { a b c d|x\ x x \ x |interface name } \[command] match peer { a b c d | x\ x x \ x | interace name } no match peer { a b c d | x\ x x \ x | interace name } \[purpose] this is a bgp specific match command matches the peer ipv6 address if the neighbor was specified in this manner \[parameter] a b c d ip address of peer x\ x x \ x ipv6 address of peer interface name interface name of peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match peer 1 1 1 1 match peer local \[command] match peer local no match peer local \[purpose] matches the peer static or redistributed routes \[notes] this command unmatches peer to peer static or redistributed routes \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match peer local match source protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric} \[command] match source protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric} no match source protocol {kernel|connected|static|rip|ripng|ospf|ospf6|isis|bgp|eigrp|nhrp|table|vnc|babel|sharp|openfabric} \[purpose] this is a zebra specific match command matches the originating protocol specified \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match source protocol static match source instance instance \[command] match source instance instance no match source instance instance \[purpose] this is a zebra specific match command \[parameter] instance the instance number (0 255) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# match source instance 2 set tag tag \[command] set tag tag no set tag tag \[purpose] set a tag on the matched route \[parameter] tag tag value (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set tag 12 set ip next hop a b c d \[command] set ip next hop a b c d no set ip next hop a b c d \[purpose] set the bgp nexthop address \[parameter] a b c d ip address \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop 1 1 1 1 set ip next hop peer address \[command] set ip next hop peer address no set ip next hop peer address \[purpose] set the bgp nexthop address to the address of the peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop peer address set ip next hop unchanged \[command] set ip next hop unchanged no set ip next hop unchanged \[purpose] set the route map as unchanged \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ip next hop unchanged set ipv6 next hop peer address \[command] set ipv6 next hop peer address no set ipv6 next hop peer address \[purpose] set the bgp nexthop address to the address of the peer \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop peer address set ipv6 next hop prefer global \[command] set ipv6 next hop prefer global no set ipv6 next hop prefer global \[purpose] for incoming and import route maps if we receive a v6 global and v6 ll address for the route, then prefer to use the global address as the nexthop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop prefer global set ipv6 next hop global x\ x x \ x \[command] set ipv6 next hop global x\ x x \ x no set ipv6 next hop global x\ x x \ x \[purpose] set the next hop to the specified ipv6 address for both incoming and outgoing route maps \[parameter] x\ x x \ x ipv6 address of next hop \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set ipv6 next hop global 100 1 set local preference preference \[command] set local preference preference no set local preference preference \[purpose] subtract the bgp local preference \[parameter] preference preference value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set local preference 12 set distance distance \[command] set distance distance no set distance distance \[purpose] set the administrative distance \[parameter] distance distance value (0 255) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set distance 12 set weight weight \[command] set weight weight no set weight weight \[purpose] set the route’s weight \[parameter] weight value (0 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set weight 12 set metric { metric | rtt | +rtt | rtt } \[command] set metric { metric | rtt | +rtt | rtt } no set metric { metric | rtt | +rtt | rtt } \[purpose] set the bgp attribute med to a specific value \[parameter] metric 2147483647 2147483647 \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set metric 12 set as path prepend \[ as path ] \[last as number ] \[command] set as path prepend \[ as path ] \[last as number ] no set as path prepend \[ as path ] \[last as number ] \[purpose] set the bgp as path to prepend \[parameter] as path as number (1 4294967295) number number of times to insert (1 10) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set as path prepend 12 set as path exclude \[ as number ] \[command] set as path exclude \[ as number ] no set as path exclude \[ as number ] \[purpose] drop as number from the bgp as path \[parameter] as number as number (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set as path exclude 12 set community \[ community ] \[command] set community \[ community ] no set community \[ community ] \[purpose] set the bgp community attribute \[parameter] community community number in aa\ nn format (where aa and nn are (0 65535)) or local as|no advertise|no export|internet or additive \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set community 12 set origin {egp|igp|incomplete} \[command] set origin {egp|igp|incomplete} no set origin {egp|igp|incomplete} \[purpose] set bgp route origin \[notes] this command cancels the bgp route origin setting \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set origin igp set table tableid \[command] set table tableid no set table tableid \[purpose] set the bgp table to a given table identifier \[parameter] tableid kernel routing table id (1 4294967295) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# set table 12 on match {goto number|next} \[command] on match {goto number |next} no on match {goto number |next} \[purpose] proceed on to the next entry in the route map \[parameter] number number (1 65535) \[view] route map view \[use cases] sonic# clear route map counters sonic(config)# route map test permit 233 sonic(config route map)# on match next set src ip addresss \[command] set src ip address \[purpose] set the preferred source address for matching routes when installing in the kernel \[parameter] ip address ipv4/ipv6 address \[view] route map view \[use cases] sonic(config)# route map rm set src permit 10 sonic(config route map)# set src 30 11 0 48 ip protocol protocol route map routemap routemap \[command] ip protocol protocol route map routemap \[purpose] filter which routes will install in the kernel \[parameter] protocol kernel/connected/static/rip/ospf/isis/bgp/any routemap router map name \[view] system configuration view \[use cases] sonic(config)# ip protocol bgp route map rm set src
