- vi /etc/systemd/system/rc-local.service 系统开机运行rc.local
- vi /etc/rc.local 改写开机启动权限
- !/bin/bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel. 6 # Make sure that the script will “exit 0” on success or any other 7 # value on error.
#
# In order to enable or disable this script just change the execution 10 # bits.
#
# By default this script does nothing. 13
sleep 10
ip ro add default via 网关 table 1
ip ru add from IP table 1
exit 0 (复制粘贴配置文件中)
vi /etc/systemd/system/rc-local.service 系统开机运行rc.local
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=multi-user.target (复制粘贴配置文件中)