Advertisement
Guest User

Untitled

a guest
May 25th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # network6 This starts and stops ipv6 on xenbr0
  4. #
  5. # chkconfig: 2345 15 85
  6. # description: ipv6 configuration
  7. # source: http://www.wirrewelt.de/entry/ipv6-mit-xenserver-5-5-bei-hetzner
  8. # Copyright 2010 Sascha Huck
  9. #
  10. ### BEGIN INIT INFO
  11. # Default-Start: 2 3 4 5
  12. # Default-Stop: 0 1 6
  13. ### END INIT INFO
  14. # Source function library.
  15. . /etc/rc.d/init.d/functions
  16. # Von Hetzner zugewiesenes Gateway
  17. IPV6GATEWAY=fe80::1
  18. # Eigene Adresse und eigenes Subnetz
  19. IPV6HOSTADDR=2a01:4f8:161:xxxx::2/112
  20. IPV6HOSTSUBNET=2a01:4f8:161:xxxx::0/112
  21.  
  22. usage ()
  23. {
  24. echo "Usage: service $prog {start|stop}"
  25. RETVAL=1
  26. }
  27. start ()
  28. {
  29. # Insert kernel modules
  30. modprobe esp6
  31. # Configure our ip address
  32. ip -6 addr add $IPV6HOSTADDR dev xenbr0
  33. # Configure routing to hetzner gateway
  34. ip -6 route add $IPV6GATEWAY dev eth0
  35. ip -6 route add $IPV6GATEWAY dev xenbr0
  36. ip -6 route add default via $IPV6GATEWAY
  37.  
  38. # Enable ipv6 forwarding (don't work in /etc/sysctl.conf)
  39. sysctl -w net.ipv6.conf.all.forwarding=1
  40.  
  41. }
  42. stop ()
  43. {
  44. }
  45. case "$1" in
  46. start) start; RETVAL=$? ;;
  47. stop) stop; RETVAL=$? ;;
  48. *) usage ; RETVAL=2 ;;
  49. esac
  50. exit $RETVAL
  51. ########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement