AyumuUeha | 76a01bc | 2017-05-18 13:34:13 +0900 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | #************************************************************/ |
| 3 | #** File: vcpe_proxy_ipv6_setup.sh */ |
| 4 | #** Contents: Contains shell script to setup VCPE IPv6 */ |
| 5 | #** environment and start apps */ |
| 6 | #************************************************************/ |
| 7 | echo "vcpe_proxy_ipv6_setup.sh: BEGIN" >/tmp/ipv6.log |
| 8 | date >>/tmp/ipv6.log |
| 9 | |
| 10 | echo "stop dnsmasq" >>/tmp/ipv6.log |
| 11 | sv down dnsmasq |
| 12 | sv down dnsmasq-safe |
| 13 | sleep 1 |
| 14 | |
| 15 | ps -fade|grep dnsmasq >>/tmp/ipv6.log |
| 16 | |
| 17 | cd /home/ubuntu |
| 18 | |
| 19 | tar -xvf ipv6.tar |
| 20 | |
| 21 | echo "place conf files" >>/tmp/ipv6.log |
| 22 | mv radvd.conf /etc/ |
| 23 | mv totd.conf /usr/local/etc/ |
| 24 | mv tayga.conf /usr/local/etc/ |
| 25 | |
| 26 | ifconfig eth1 0.0.0.0 |
| 27 | ifconfig eth1 inet6 add 2001:468:181:f100::1/64 up |
| 28 | sysctl -w net.ipv6.conf.all.forwarding=1 |
| 29 | |
| 30 | echo "Setup NAT64 Tayga" >>/tmp/ipv6.log |
| 31 | /home/ubuntu/tayga --mktun |
| 32 | sleep 1 |
| 33 | ifconfig nat64 up |
| 34 | ifconfig nat64 mtu 1442 |
| 35 | ip addr add 192.168.1.1 dev nat64 |
| 36 | ip addr add 2001:db8:1::1 dev nat64 |
| 37 | ip route add 192.168.255.0/24 dev nat64 |
| 38 | ip route add 2000:ffff::/96 dev nat64 |
| 39 | mkdir /var/db/ |
| 40 | mkdir /var/db/tayga |
| 41 | |
| 42 | ip6tables -A OUTPUT -p icmpv6 --icmpv6-type 1 -j DROP |
| 43 | ip6tables -A FORWARD -d 2001:468:181:f100:: -j DROP |
| 44 | |
| 45 | echo "Start DHCPv6 radvd" >>/tmp/ipv6.log |
| 46 | /etc/init.d/radvd start & |
| 47 | sleep 1 |
| 48 | echo "Start NAT64 Tayga" >>/tmp/ipv6.log |
| 49 | /home/ubuntu/tayga & |
| 50 | sleep 1 |
| 51 | echo "Start DNS64 totd" >>/tmp/ipv6.log |
| 52 | /home/ubuntu/totd & |
| 53 | |