VyOs 1.1.6: Tunnel breaks show interface *


#1

Hi All,

Just wanted to touch base here before submitting a bug on bugzilla to ensure I am not missing anything.

A VyOs 1.1.6 install without any tunnel interfaces does not have any issues with the following commands:

show interfaces counters
show interfaces details

vyos@vyos:~$ show interfaces counters 
Interface    Rx Packets   Rx Bytes     Tx Packets   Tx Bytes
eth0               4001     265310            354      47538
lo                16138     975272          16138     975272
vyos@vyos:~$ 
vyos@vyos:~$ 
vyos@vyos:~$ 
vyos@vyos:~$ show interfaces detail 
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b4:03:62 brd ff:ff:ff:ff:ff:ff
    inet 100.64.0.5/24 brd 100.64.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb4:362/64 scope link 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
        266924       4021          0          0          0          4
    TX:  bytes    packets     errors    dropped    carrier collisions
         49172        367          0          0          0          0
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
        975512      16142          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
        975512      16142          0          0          0          0
vyos@vyos:~$ 

However, configuring a tunnel interface as follows:

vyos@vyos# show interfaces tunnel 
+tunnel tun0 {
+    address 192.168.1.4/24
+    encapsulation gre
+    local-ip 0.0.0.0
+    multicast enable
+    parameters {
+        ip {
+            key 1
+        }
+    }
+}

Results in the following errors in the aforementioned commands:

  • Can’t call method “up” on an undefined value at /opt/vyatta/bin/vyatta-show-interfaces.pl line 128.
  • Can’t call method “path” on an undefined value at /opt/vyatta/share/perl5//Vyatta/Misc.pm line 540.

The full output is below:

vyos@vyos:~$ show interfaces counters 
Can't call method "up" on an undefined value at /opt/vyatta/bin/vyatta-show-interfaces.pl line 128.
Interface    Rx Packets   Rx Bytes     Tx Packets   Tx Bytes
eth0               4225     284430            516      67740
vyos@vyos:~$ 
vyos@vyos:~$ show interfaces detail 
Can't call method "path" on an undefined value at /opt/vyatta/share/perl5//Vyatta/Misc.pm line 540.
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b4:03:62 brd ff:ff:ff:ff:ff:ff
    inet 100.64.0.5/24 brd 100.64.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb4:362/64 scope link 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
        286260       4244          0          0          0          4
    TX:  bytes    packets     errors    dropped    carrier collisions
         70084        536          0          0          0          0
vyos@vyos:~$ 

Running the command show interfaces system has the expected output.

Has anyone else seen this behaviour on a brand new install of VyOs 1.1.6?


#2

After looking at this with my very limited perl knowledge, it seems that the command croaks because it is presented with some interfaces which are not known to VyOs such as gre0 and gretap0.

A debug shows this issue for gre0 which is the next interface after eth0 when sorted alphabetically:

DB<10> n
main::(/opt/vyatta/bin/sudo-users/vyatta-show-interfaces.pl:497):
497:    &$func(@intf_list);
                                                      
DB<10> p @intf_list
eth0gre0gretap0lotun0

DB<11> 
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b4:03:62 brd ff:ff:ff:ff:ff:ff
    inet 100.64.0.5/24 brd 100.64.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb4:362/64 scope link 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
       1081017      14272          0          0          0          4
    TX:  bytes    packets     errors    dropped    carrier collisions
        508284       3070          0          0          0          0
Can't call method "path" on an undefined value at /opt/vyatta/share/perl5//Vyatta/Misc.pm line 540.
 at /opt/vyatta/share/perl5//Vyatta/Misc.pm line 540
        Vyatta::Misc::interface_description('gre0') called at /opt/vyatta/bin/sudo-users/vyatta-show-interfaces.pl line 60
        main::get_intf_description('gre0') called at /opt/vyatta/bin/sudo-users/vyatta-show-interfaces.pl line 225
        main::run_show_intf('eth0', 'gre0', 'gretap0', 'lo', 'tun0') called at /opt/vyatta/bin/sudo-users/vyatta-show-interfaces.pl line 497
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.  

DB<11> 

So what I did was to track down where the interface definitions were defined and they are present at ‘/opt/vyatta/etc/netdevice’;

I then added the missing interface definitions such as gre and gretap

vyos@vyos:~$ sudo cat /opt/vyatta/etc/netdevice
# device name to CLI path matching
lo      loopback
eth     ethernet
ifb     input
peth    pseudo-ethernet
br      bridge
bond    bonding
vtun    openvpn
tun     tunnel
vti     vti
wlm     wirelessmodem
wlan    wireless
pppoe   pppoe
dum     dummy
l2tpeth l2tpv3
vxlan   vxlan
gre     virtualtunnel
gretap  virtuall2tunnel

And this seems to have fixed the issue for both the commands:

vyos@vyos:~$ show interfaces counters 
Interface    Rx Packets   Rx Bytes     Tx Packets   Tx Bytes
eth0              15704    1198760           3780     690100
lo                52238    3151872          52238    3151872
tun0                  0          0              0          0
vyos@vyos:~$ show interfaces de
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b4:03:62 brd ff:ff:ff:ff:ff:ff
    inet 100.64.0.5/24 brd 100.64.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb4:362/64 scope link 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
       1200452      15723          0          0          0          4
    TX:  bytes    packets     errors    dropped    carrier collisions
        692112       3797          0          0          0          0
gre0: <NOARP> mtu 1476 qdisc noop state DOWN group default 
    link/gre 0.0.0.0 brd 0.0.0.0

    RX:  bytes    packets     errors    dropped    overrun      mcast
             0          0          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
             0          0          0          0          0          0
gretap0: <BROADCAST,MULTICAST> mtu 1476 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff

    RX:  bytes    packets     errors    dropped    overrun      mcast
             0          0          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
             0          0          0          0          0          0
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

    RX:  bytes    packets     errors    dropped    overrun      mcast
       3152352      52246          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
       3152352      52246          0          0          0          0
tun0@NONE: <MULTICAST,NOARP,ALLMULTI,UP,LOWER_UP> mtu 1472 qdisc noqueue state UNKNOWN group default 
    link/gre 0.0.0.0 brd 0.0.0.0
    inet 192.168.1.4/24 brd 192.168.1.255 scope global tun0
       valid_lft forever preferred_lft forever
    Description: test

    RX:  bytes    packets     errors    dropped    overrun      mcast
             0          0          0          0          0          0
    TX:  bytes    packets     errors    dropped    carrier collisions
             0          0          0          0          0          0
vyos@vyos:~$ 

Not sure if this is the right fix or even approach but thought I would share my findings here in case someone experiences the same issue.