可以自己改一下systemd的启动脚本:
vim /etc/systemd/system/happynet.service
里面的启动命令是:
ExecStart=/usr/local/bin/happynet /etc/happynet.conf -f
可以改成
ExecStart=/usr/local/bin/happynet /etc/happynet.conf -f && /sbin/ip route add xxxx via happyn0
然后执行
systemctl daemon-reload
systemctl restart happynet
生效