Hey there! nmstate 0.3.0 is out and it contains some interesting new features.

VLAN filtering on Linux Bridge

Nmstate now supports VLAN filtering in Linux Bridge. If you are not aware about what is VLAN filtering, I recommend you to read the following article about Linux bridges and VLAN filtering. But I made up a little summary.

When using VLAN filtering, the bridge interface works like a switch, the user or sysadmin can set up different subnets on servers without needing to create multiple VLANs and bridges.

On nmstate you can configure VLAN filtering in the bridge interface by adding the “vlan” subtree to the interface state. You can find a simple example in the nmstate API documentation.

Support 3+ single stack DNS nameservers

When configuring the static nameservers, nmstate is doing a validation that means the nameserver must have a validinterface to be associated with. Due to that validation, currently it is not possible to configure 2+ mixed stack DNS nameservers but it is possible to configure 3+ nameservers if they are single stack. Please, see the example below:

---
dns-resolver:
  config:
    search: []
    server:
    - 192.168.122.1
    - 8.8.8.8
    - 1.1.1.1
  running:
    search: []
    server:
    - 192.168.122.1
    - 8.8.8.8
    - 1.1.1.1
route-rules:
  config: []
routes:
  config: []
  running:
  - destination: 0.0.0.0/0
    metric: 100
    next-hop-address: 192.168.122.1
    next-hop-interface: enp1s0
    table-id: 254
  - destination: 192.168.122.0/24
    metric: 100
    next-hop-address: ''
    next-hop-interface: enp1s0
    table-id: 254
  - destination: fe80::/64
    metric: 100
    next-hop-address: ''
    next-hop-interface: enp1s0
    table-id: 254
interfaces:
- name: enp1s0
  type: ethernet
  state: up
  ipv4:
    address:
    - ip: 192.168.122.50
      prefix-length: 24
    auto-dns: false
    auto-gateway: true
    auto-routes: true
    dhcp: true
    enabled: true
  ipv6:
    address:
    - ip: fe80::5054:ff:fedc:16a
      prefix-length: 64
    auto-dns: true
    auto-gateway: true
    auto-routes: true
    autoconf: true
    dhcp: true
    enabled: true
  mac-address: 52:54:00:DC:01:6A
  mtu: 1500

Allow route rule filtering by interface when showing

When showing an interface state with nmstate, now it is possible to filter the route-rules by the interface name. Please, see the example below.

---
routes:
  config:
  - destination: 192.168.2.0/24
    metric: 108
    next-hop-address: 192.168.1.3
    next-hop-interface: eth1
    table-id: 200
  - destination: 2001:db8:a::/64
    metric: 108
    next-hop-address: 2001:db8:1::2
    next-hop-interface: eth1
    table-id: 200
route-rules:
  config:
    - ip-from: 192.168.3.2/32
      route-table: 200
    - ip-from: 2001:db8:b::/64
      route-table: 200
interfaces:
  - name: eth1
    type: ethernet
    state: up
    mtu: 1500
    ipv4:
      enabled: true
      dhcp: false
      address:
      - ip: 192.168.1.1
        prefix-length: 24
    ipv6:
      enabled: true
      dhcp: false
      autoconf: false
      address:
      - ip: 2001:db8:1::1
        prefix-length: 64