Skip to content

Instantly share code, notes, and snippets.

@unixfox
Last active June 4, 2023 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unixfox/fcfdd60193c99a4fccf52e65567bc004 to your computer and use it in GitHub Desktop.
Save unixfox/fcfdd60193c99a4fccf52e65567bc004 to your computer and use it in GitHub Desktop.
start script alpine linux ipv6 scaleway
#!/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
#!/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