centos set to boot from the startup script

1. Create a new script file

I am here to set the boot automatically set ipv6 tunnel, so named for the ipv6tunnel.sh

ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::66.220.18.42
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:470:c:8a7::2/64
route -A inet6 add ::/0 dev sit1

2. Add execute permission to the script

chmod +x ipv6tunnel.sh

3. Add the boot

Just add to /etc/rc.d/rc.local script (note the full path). In centos7, the privileges / etc / rc.d / rc.local file is reduced, boot time to perform in your own scripts of some services can not start, execute the following command file can be marked as executable file

chmod +x /etc/rc.d/rc.local

Guess you like

Origin www.cnblogs.com/roadwide/p/11266752.html