vlan bridges in netplan

March 21, 2019 - Reading time: ~1 minute

Took me a while to figure this one out in the netplan yaml syntax:


network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
  bridges:
    br20:
      dhcp4: no
      dhcp6: no
      interfaces: [ vlan20 ]
      addresses: [ 192.168.20.5/24 ]
      gateway4: 192.168.20.1
      nameservers:
        addresses:
          - "192.168.20.1"
    br40:
      dhcp4: no
      dhcp6: no
      interfaces: [ vlan40 ]
  vlans:
    vlan20:
      id: 20
      link: eno1
      dhcp4: no
      dhcp6: no
    vlan40:
      id: 40
      link: eno1
      dhcp4: no
      dhcp6: no

Bonus .vimrc settings for yaml


autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab

Pipe cron output to syslog/journalctl

March 8, 2019 - Reading time: ~1 minute

Simple way to pipe cron script output to journalctl / syslog


MAILTO=""
* * * * * user (echo "testing") 2>&1 | logger -t tag-to-use

gives following in journalctl


$ journalctl SYSLOG_IDENTIFIER=tag-to-use
-- Logs begin at Tue 2019-02-26 16:48:53 UTC, end at Fri 2019-03-08 22:12:03 UTC. --
Mar 08 22:04:01 server tag-to-use[25769]: testing