Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # network6 This starts and stops ipv6 on xenbr0
- #
- # chkconfig: 2345 15 85
- # description: ipv6 configuration
- # source: http://www.wirrewelt.de/entry/ipv6-mit-xenserver-5-5-bei-hetzner
- # Copyright 2010 Sascha Huck
- #
- ### BEGIN INIT INFO
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- ### END INIT INFO
- # Source function library.
- . /etc/rc.d/init.d/functions
- # Von Hetzner zugewiesenes Gateway
- IPV6GATEWAY=fe80::1
- # Eigene Adresse und eigenes Subnetz
- IPV6HOSTADDR=2a01:4f8:161:xxxx::2/112
- IPV6HOSTSUBNET=2a01:4f8:161:xxxx::0/112
- usage ()
- {
- echo "Usage: service $prog {start|stop}"
- RETVAL=1
- }
- start ()
- {
- # Insert kernel modules
- modprobe esp6
- # Configure our ip address
- ip -6 addr add $IPV6HOSTADDR dev xenbr0
- # Configure routing to hetzner gateway
- ip -6 route add $IPV6GATEWAY dev eth0
- ip -6 route add $IPV6GATEWAY dev xenbr0
- ip -6 route add default via $IPV6GATEWAY
- # Enable ipv6 forwarding (don't work in /etc/sysctl.conf)
- sysctl -w net.ipv6.conf.all.forwarding=1
- }
- stop ()
- {
- }
- case "$1" in
- start) start; RETVAL=$? ;;
- stop) stop; RETVAL=$? ;;
- *) usage ; RETVAL=2 ;;
- esac
- exit $RETVAL
- ########
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement