Use o systemd para iniciar o ppp em uma VLAN na inicialização

0

Estou substituindo meu roteador / AP de consumidor por uma caixa linux. Meu roteador consumidor discou para o meu provedor através de um link PPPoE em uma VLAN marcada. Eu tenho uma configuração de trabalho configurada em que ppp usa o dispositivo com tag enp7s0.201 e executa bem até que eu reinicie. Ao reinicializar, ppp aparece antes que o dispositivo de VLAN seja criado e morra imediatamente.

[me@router ~]$ sudo journalctl -b | egrep 'ppp|enp7s0'
Feb 11 03:01:22 router kernel: r8169 0000:07:00.0 enp7s0: renamed from eth0
Feb 11 03:01:23 router systemd[1]: [email protected]: Unit is bound to inactive unit sys-subsystem-net-devices-enp7s0.201.device. Stopping, too.
Feb 11 03:01:23 router systemd-networkd[444]: /etc/systemd/network/enp7s0.201.netdev:5: Unknown section 'VLAN'. Ignoring.
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0.201: netdev ready
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0: IPv6 successfully enabled
Feb 11 03:01:25 router kernel: r8169 0000:07:00.0 enp7s0: link down
Feb 11 03:01:25 router kernel: r8169 0000:07:00.0 enp7s0: link down
Feb 11 03:01:25 router kernel: IPv6: ADDRCONF(NETDEV_UP): enp7s0: link is not ready
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0.201: IPv6 successfully enabled
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0: Gained carrier
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0.201: Gained carrier
Feb 11 03:01:25 router systemd-networkd[444]: enp7s0.201: Lost carrier
Feb 11 03:01:26 router systemd-networkd[444]: enp7s0: Lost carrier
Feb 11 03:01:27 router systemd-networkd[444]: enp7s0.201: Gained IPv6LL
Feb 11 03:01:27 router systemd-networkd[444]: enp7s0: Gained carrier
Feb 11 03:01:27 router kernel: r8169 0000:07:00.0 enp7s0: link up
Feb 11 03:01:27 router kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp7s0: link becomes ready
Feb 11 03:01:27 router systemd-networkd[444]: enp7s0.201: Gained carrier
Feb 11 03:01:29 router systemd-networkd[444]: enp7s0: Gained IPv6LL
Feb 11 03:01:32 router systemd-networkd[444]: enp7s0: Lost carrier
Feb 11 03:01:32 router kernel: r8169 0000:07:00.0 enp7s0: link down
Feb 11 03:01:32 router systemd-networkd[444]: enp7s0.201: Lost carrier
Feb 11 03:01:35 router systemd-networkd[444]: enp7s0: Gained carrier
Feb 11 03:01:35 router kernel: r8169 0000:07:00.0 enp7s0: link up
Feb 11 03:01:35 router systemd-networkd[444]: enp7s0.201: Gained carrier

Eu removi um Before=network.target do arquivo [email protected] e adicionei um BindsTo=sys-subsystem-net-devices-enp7s0.201.device .

[me@router ~]$ sudo systemctl cat ppp@centurylink
[sudo] password for me: 
# /usr/lib/systemd/system/[email protected]
[Unit]
Description=PPP link to %I
#Before=network.target

[Service]
ExecStart=/usr/sbin/pppd call %I nodetach nolog

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/[email protected]/port-bind.conf
[Unit]
BindsTo=sys-subsystem-net-devices-enp7s0.201.device

No entanto, olhando para onde pppd é executado durante a inicialização, ainda é bem antes, quando enp7s0.201 está disponível.

EDIT: Sou um idiota. Esqueci que também precisava de um After=sys-subsystem-net-devices-enp7s0.201.device no drop-in.

    
por Huckle 11.02.2018 / 11:29

0 respostas