set origin

To set the Border Gateway Protocol (BGP) origin code, use the set origin command. To delete the entry, use the no form of this command.

set origin {egp as-num [:as-num] | igp | incomplete}

no set origin

Syntax Description

egp as-num

Specifies the autonomous system (AS) number for a remote exterior gateway protocol (EGP) system. You can specify the AS number as a 2-byte integer or a 4-byte integer in aa:nn format. Range is from 1 to 65535.


Specifies a local interior gateway protocol (IGP) system.


Specifies an unknown heritage.

Command Default

Default origin, based on route in main IP routing table.

Command Modes

Route-map configuration mode

Command History



This command was introduced.

Usage Guidelines

You must have a match clause (even if it points to a "permit everything" list) if you want to set tags.

Use the route-map global configuration command, and the match and set route-map configuration commands, to define the conditions for redistributing routes from one routing protocol into another. Each route-map command has a list of match and set commands associated with it. The match commands specify the match criteria—the conditions under which redistribution is allowed for the current route-map command. The set commands specify the set actions—the particular redistribution actions to perform if the criteria enforced by the match commands are met. The no route-map command deletes the route map.

The set route-map configuration commands specify the redistribution set actions to be performed when all of the match criteria of a route map are met. When all match criteria are met, all set actions are performed.


This example shows how to set the origin of routes that pass the route map to IGP:

switch(config)# route-map set_origin
switch(config-route-map)# match as-path 10
switch(config-route-map)# set origin igp

Related Commands


match as-path

Matches a BGP autonomous system path access list.

match community

Matches a BGP community.

match ip next-hop

Redistributes any routes that have a next-hop router address passed by one of the access lists specified.

match ip route-source

Redistributes routes that have been advertised by routers and access servers at the address specified by the access lists.

match metric

Redistributes routes with the metric specified.

match route-type

Redistributes routes of the specified type.

match tag

Redistributes routes in the routing table that match the specified tags.


Defines the conditions for redistributing routes from one routing protocol into another.

set as-path

Sets a BGP autonomous system path access list.

set community

Sets the BGP communities attribute.

set level

Indicates where to import routes.

set local-preference

Specifies a preference value for the autonomous system path.

set metric

Sets the metric value for a routing protocol.

set metric-type

Sets the metric type for the destination routing protocol.

set origin

Sets the BGP origin code.

set tag

Sets the value of the destination routing protocol.