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