Last active
June 4, 2023 21:19
-
-
Save unixfox/fcfdd60193c99a4fccf52e65567bc004 to your computer and use it in GitHub Desktop.
start script alpine linux ipv6 scaleway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# /opt/setipv6.sh | |
# apk add curl | |
# rc-update add local default | |
until $(curl --output /dev/null --silent --head --fail http://169.254.42.42/conf); do | |
sleep 5 | |
done | |
export $(curl -s http://169.254.42.42/conf | grep IPV6_ADDRESS) | |
export $(curl -s http://169.254.42.42/conf | grep IPV6_GATEWAY) | |
ip -6 addr add "$IPV6_ADDRESS"/64 dev eth0 | |
ip -6 route add default via $IPV6_GATEWAY | |
echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# /etc/local.d/setipv6background.start | |
ash /opt/setipv6.sh & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment