Como eu faço o systemd-networkd ignorar a rota padrão do DHCP?

3

Eu quero que systemd-networkd ignore a rota / s padrão empurrada pelo DHCP em uma interface.

Minha configuração de trabalho tem 3 interfaces de rede. Eu tenho um arquivo de rede para cada interface:

eth0) internet

[Match]
Name=eth0
[Network]
DHCP=yes
DNS=127.0.0.1

eth1) rede de testes local

[Match]
Name=eth1

[Network]
Address=192.168.78.1/24
IPForward=ipv4
IPMasquerade=yes
DHCPServer=yes

[DHCPServer]
PoolOffset=10
PoolSize=100
EmitDNS=yes
DNS=192.168.78.1

eth2) Conexão do roteador VPN ao site principal.

[Match]
Name=eth2

[Network]
DHCP=ipv4

[Route]
Gateway=10.3.10.1
Destination=10.100.102.0/24
Metric=0

[Route]
Gateway=10.3.10.1
Destination=10.3.13.0/24
Metric=0

[Route]
Gateway=10.3.10.1
Destination=10.3.14.0/24
Metric=0

[DHCP]
UseDNS=false
SendHostname=true
UseRoutes=false
RouteMetric=2000

vnet0) interface de ponte sem conexão com interface real para VMs

[Match]
Name=vnet0

[Network]
Address=192.168.77.1/24
IPForward=ipv4
IPMasquerade=yes
DHCPServer=yes

[DHCPServer]
PoolOffset=10
PoolSize=100
EmitDNS=yes
DNS=192.168.77.1

Como você pode ver, UseRoutes=false está definido e ainda tenho uma rota padrão na rede eth2:

default via 192.168.178.1 dev eth0  proto dhcp  src 192.168.178.52  metric 1024 
default via 10.3.10.1 dev eth2  proto dhcp  src 10.3.10.196  metric 2000 
10.3.10.0/24 dev eth2  proto kernel  scope link  src 10.3.10.196 
10.3.10.1 dev eth2  proto dhcp  scope link  src 10.3.10.196  metric 2000 
192.168.77.0/24 dev vnet0  proto kernel  scope link  src 192.168.77.1 linkdown 
192.168.78.0/24 dev eth1  proto kernel  scope link  src 192.168.78.1 
192.168.178.0/24 dev eth0  proto kernel  scope link  src 192.168.178.52 
192.168.178.1 dev eth0  proto dhcp  scope link  src 192.168.178.52  metric 1024 

Eu também tentei UseRoutes=no , o que também não faz diferença. Alguém tem alguma idéia do que estou fazendo errado?

versões e pacotes:

mavu  ~  uname -a
Linux saaclt0006 4.3.0-1-amd64 #1 SMP Debian 4.3.3-2 (2015-12-17) x86_64 GNU/Linux

mavu  ~  dpkg -l |grep systemd
ii  libpam-systemd:amd64                          228-2+b1                               amd64        system and service manager - PAM module
rc  libsystemd-daemon0:amd64                      215-5+b1                               amd64        systemd utility library (deprecated)
rc  libsystemd-id128-0:amd64                      215-5+b1                               amd64        systemd 128 bit ID utility library (deprecated)
rc  libsystemd-id128-0:i386                       215-5+b1                               i386         systemd 128 bit ID utility library (deprecated)
rc  libsystemd-journal0:amd64                     215-5+b1                               amd64        systemd journal utility library (deprecated)
rc  libsystemd-journal0:i386                      215-5+b1                               i386         systemd journal utility library (deprecated)
rc  libsystemd-login0:amd64                       215-5+b1                               amd64        systemd login utility library (deprecated)
ii  libsystemd0:amd64                             228-2+b1                               amd64        systemd utility library
ii  libsystemd0:i386                              228-2+b1                               i386         systemd utility library
ii  systemd                                       228-2+b1                               amd64        system and service manager
ii  systemd-shim                                  9-1                                    amd64        shim for systemd
ii  systemd-sysv                                  228-2+b1                               amd64        system and service manager - SysV links

grep systemd-networkd / var / log / syslog:

Jan  7 09:00:56 saaclt0006 systemd-networkd[12179]: wlan0: Lost carrier
Jan  7 09:01:03 saaclt0006 systemd-networkd[12179]: eth0: Gained carrier
Jan  7 09:01:05 saaclt0006 systemd-networkd[12179]: eth2: Could not set route: Network is unreachable
Jan  7 09:01:05 saaclt0006 systemd-networkd[12179]: eth2: Could not set route: Network is unreachable
Jan  7 09:01:05 saaclt0006 systemd-networkd[12179]: eth2: Could not set route: Network is unreachable
Jan  7 09:01:05 saaclt0006 systemd-networkd[12179]: eth1: Gained carrier
Jan  7 09:01:06 saaclt0006 systemd-networkd[12179]: eth1: Gained IPv6LL
Jan  7 09:01:06 saaclt0006 systemd-networkd[12179]: eth1: Configured
Jan  7 09:01:06 saaclt0006 systemd-networkd[12179]: eth2: Gained carrier
Jan  7 09:01:06 saaclt0006 systemd-networkd[12179]: eth2: DHCPv4 address 10.3.10.196/24 via 10.3.10.1
Jan  7 09:01:07 saaclt0006 systemd-networkd[12179]: eth0: DHCPv4 address 192.168.178.52/24 via 192.168.178.1
Jan  7 09:01:08 saaclt0006 systemd-networkd[12179]: eth2: Gained IPv6LL
Jan  7 09:01:08 saaclt0006 systemd-networkd[12179]: eth2: Configured
Jan  7 09:01:19 saaclt0006 systemd-networkd[12179]: eth1: Starting DHCPv6 client after NDisc timeout failed: Invalid argument
Jan  7 09:01:21 saaclt0006 systemd-networkd[12179]: eth2: Starting DHCPv6 client after NDisc timeout failed: Invalid argument
    
por mavu 07.01.2016 / 09:40

0 respostas