Многоадресная маршрутизация с использованием netplan

No es necesario sedsi todo lo que está haciendo es filtrar líneas según patrones. Para eso está grep:

grep -iv '^[[:space:]]*"content"' < file.txt

grep -i, a diferencia de ese indicador de dirección Ies estándar.

O si ese es un archivo JSON adecuado, puede usar una utilidad de análisis JSON como jqpara eliminar esa clave:

jq 'del(.properties.content)' < file.txt
2
23.07.2019, 10:26
2 ответа

Документы не очень ясны, но нам повезло со следующим:

routes:
  - to: 224.0.0.0/4
    via: 0.0.0.0
0
27.01.2020, 22:24

В Ubuntu 20.04, если вы настроите только to:, вы получите предупреждение о:

Error in network definition: unicast route must include both a 'to' and 'via' IP

Предполагается, что маршрут является одноадресным маршрутом. Однако viaне требуется при добавлении многоадресного маршрута.

Правильная конфигурация:

    ens224:
      addresses:
      - 192.160.0.1/24
      routes:
      - to: 224.0.0.0/4
        scope: link

В результате будет добавлен следующий маршрут:

224.0.0.0/4 dev ens224 proto static scope link

scope:описано в :http://manpages.ubuntu.com/manpages/focal/man5/netplan.5.htmlа точнее на :http://manpages.ubuntu.com/manpages/focal/man8/ip-route.8.html

              scope SCOPE_VAL
                     the scope of the destinations covered by the route prefix.  SCOPE_VAL may be
                     a number or a string from the file /etc/iproute2/rt_scopes.  If this
                     parameter is omitted, ip assumes scope global for all gatewayed unicast
                     routes, scope link for direct unicast and broadcast routes and scope host
                     for local routes.
2
22.12.2020, 16:18

Теги

Похожие вопросы