Page MenuHomeVyOS Platform

Remove of policy route throws CLI error
Closed, ResolvedPublicBUG


With the following configuration:

[email protected]# show policy route
 route pppoe-out {
     description "PPPoE TCPMSS clamping"
     rule 100 {
         protocol tcp
         set {
             tcp-mss 1448
         tcp {
             flags SYN

[email protected]# show interfaces ethernet eth1 pppoe 0 policy
 route pppoe-out
[email protected]# delete policy route

[email protected]# commit
[ policy route pppoe-out ]
rm: cannot remove ‘/var/run/vyatta_policy_ref’: No such file or directory


Difficulty level
Easy (less than an hour)
VyOS 1.2.0-EPA3
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Unspecified (please specify)

Related Objects

Event Timeline

c-po removed c-po as the assignee of this task.
c-po created this task.

/opt/vyatta/sbin/ contains lines

my $fw_stateful_file = '/var/run/vyatta_fw_stateful';
my $fw_tree_file     = '/var/run/vyatta_fw_trees';
my $policy_ref_file  = '/var/run/vyatta_policy_ref';

After creating policy route. And check files

[email protected]# file /var/run/vyatta_fw_stateful
/var/run/vyatta_fw_stateful: cannot open `/var/run/vyatta_fw_stateful' (No such file or directory)
[email protected]# file /var/run/vyatta_policy_ref
/var/run/vyatta_policy_ref: cannot open `/var/run/vyatta_policy_ref' (No such file or directory)
[email protected]#

$policy_ref_file figured in sub (add_route_table, remove_route_table, flush_route_table)

No file, nothing to delete

So we can use "key -f" in command rm, line 296

system("rm $refcnt_file"); <== line 296

sub write_refcnt_file {
    my ($refcnt_file, @lines) = @_;

    if (scalar(@lines) > 0) {
        open(my $FILE, '>', $refcnt_file) or die "Error: write $!";
        print $FILE join("\n", @lines), "\n";
    } else {
        system("rm -f $refcnt_file");

We need to check how safe this option is.

[email protected]# delete policy
[email protected]# commit
[email protected]#


set policy route pppoe-out rule 100 protocol 'tcp'
set policy route pppoe-out rule 100 set tcp-mss '1448'
set policy route pppoe-out rule 100 tcp flags 'SYN'

[email protected]# delete policy 
[email protected]# commit
[email protected]#
dmbaturin assigned this task to Viacheslav.
dmbaturin changed Why the issue appeared? from Will be filled on close to Implementation mistake.
dmbaturin set Is it a breaking change? to Perfectly compatible.
dmbaturin set Issue type to Unspecified (please specify).