Edit your route policy in Emacs text editor and commit the changes from the editor.
Before you begin
Follow these steps to edit a routing policy by using Emacs editor:
Procedure
|
1. |
In EXEC mode, enter edit route-policy <name> .
Example:
Router# edit route-policy policy_A
The system copies your route policy to a temporary file and launches the editor.
|
|
2. |
In the editor, update your policy text as needed. |
|
3. |
After editing, save your changes and remain in the editor, or save your changes and exit the editor.
- To save the changes and remain in the editor, press Ctrl-X , and then Ctrl-S .
- To save the changes and exit the editor, press Ctrl-X , then Ctrl-C .
|
|
4. |
If the system prompts Continue editing? [no]: because of parse errors, you can::
- Enter yes to correct the text.
- Enter no to end your session without changing the running configuration.
Example:
Edit and commit a policy with no parse errors
Router# edit route-policy policy_A
== MicroEMACS 3.8b () == rpl_edit.139281 ==
if destination in (2001::/8) then
drop
endif
end-policy
!
== MicroEMACS 3.8b () == rpl_edit.139281 ==
Parsing.
83 bytes parsed in 1 sec (82)bytes/sec
Committing.
1 items committed in 1 sec (0)items/sec
Updating.
Updated Commit database in 1 sec
Example:
Handle parse errors
Router# edit route-policy policy_B
== MicroEMACS 3.8b () == rpl_edit.141738
route-policy policy_B
set metric-type type_1
if destination in (2001::/8) then
drop
endif
end-policy
!
== MicroEMACS 3.8b () == rpl_edit.141738 ==
Parsing.
105 bytes parsed in 1 sec (103)bytes/sec
% Syntax/Authorization errors in one or more commands.!!
CONFIGURATION FAILED DUE TO SYNTAX/AUTHORIZATION ERRORS
set metric-type type_1
if destination in (2001::/8) then
drop
endif
end-policy
!
Continue editing? [no]:
|
If your policy has no parse errors, the system commits your updated policy. If you exit and do not continue after correcting parse errors, the system does not change the running configuration.