Ubuntu配置多IP路由
1、配置rc.service服务
从Ubuntu 16.10版本开始不再使用initd管理系统,改用systemd管理系统,而通过systemd管理系统可以实现开机运行自己的脚本 ,所以开机使用rc.service服务需做一下配置。
[root@localhost~]# vi /etc/systemd/system/rc-local.service
复制代码,保存进配置文件
[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
(复制粘贴配置文件中)
路由写入开机自启文件
[root@localhost~]# 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 "exit0" on success or any other 7
#value on