1
Linux 討論版 / Re: 請教CentOS 7 的 rc.local 啟動的問題
« 於: 2016-07-08 07:59 »
有找到,可以放在 network-online.target 中,
If you use NetworkManager you can do this by enabling NetworkManager-wait-online.service:
systemctl enable NetworkManager-wait-online.service
If you use systemd-networkd you can do this by enabling systemd-networkd-wait-online.service:
systemctl enable systemd-networkd-wait-online.service
systemd 的說明是這樣的,
只是還不太知道,NetworkManager-wait-online.server 的內容要如何編寫
更正一下,應該是修改 network-online.target 的內容才對,
只是它的內容如下
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Network is Online
Documentation=man:systemd.special(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
After=network.target
========================================
如果,我想加指令如下
ip route add default via x.x.x.x table wan1
ip rule add from x.x.x.x table wan1
不知道要如何加入
If you use NetworkManager you can do this by enabling NetworkManager-wait-online.service:
systemctl enable NetworkManager-wait-online.service
If you use systemd-networkd you can do this by enabling systemd-networkd-wait-online.service:
systemctl enable systemd-networkd-wait-online.service
systemd 的說明是這樣的,
只是還不太知道,NetworkManager-wait-online.server 的內容要如何編寫
更正一下,應該是修改 network-online.target 的內容才對,
只是它的內容如下
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Network is Online
Documentation=man:systemd.special(7)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
After=network.target
========================================
如果,我想加指令如下
ip route add default via x.x.x.x table wan1
ip rule add from x.x.x.x table wan1
不知道要如何加入