blob: 0f84ae6a1977ca6abb96d7b3c128fecc0d865db5 [file] [log] [blame]
Matteo Scandoloaca86652017-08-08 13:05:27 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
AyumuUeha76a01bc2017-05-18 13:34:13 +090017#!/bin/bash
18#************************************************************/
19#** File: vcpe_proxy_ipv6_setup.sh */
20#** Contents: Contains shell script to setup VCPE IPv6 */
21#** environment and start apps */
22#************************************************************/
23echo "vcpe_proxy_ipv6_setup.sh: BEGIN" >/tmp/ipv6.log
24date >>/tmp/ipv6.log
25
26echo "stop dnsmasq" >>/tmp/ipv6.log
27sv down dnsmasq
28sv down dnsmasq-safe
29sleep 1
30
31ps -fade|grep dnsmasq >>/tmp/ipv6.log
32
33cd /home/ubuntu
34
35tar -xvf ipv6.tar
36
37echo "place conf files" >>/tmp/ipv6.log
38mv radvd.conf /etc/
39mv totd.conf /usr/local/etc/
40mv tayga.conf /usr/local/etc/
41
42ifconfig eth1 0.0.0.0
43ifconfig eth1 inet6 add 2001:468:181:f100::1/64 up
44sysctl -w net.ipv6.conf.all.forwarding=1
45
46echo "Setup NAT64 Tayga" >>/tmp/ipv6.log
47/home/ubuntu/tayga --mktun
48sleep 1
49ifconfig nat64 up
50ifconfig nat64 mtu 1442
51ip addr add 192.168.1.1 dev nat64
52ip addr add 2001:db8:1::1 dev nat64
53ip route add 192.168.255.0/24 dev nat64
54ip route add 2000:ffff::/96 dev nat64
55mkdir /var/db/
56mkdir /var/db/tayga
57
58ip6tables -A OUTPUT -p icmpv6 --icmpv6-type 1 -j DROP
59ip6tables -A FORWARD -d 2001:468:181:f100:: -j DROP
60
61echo "Start DHCPv6 radvd" >>/tmp/ipv6.log
62/etc/init.d/radvd start &
63sleep 1
64echo "Start NAT64 Tayga" >>/tmp/ipv6.log
65/home/ubuntu/tayga &
66sleep 1
67echo "Start DNS64 totd" >>/tmp/ipv6.log
68/home/ubuntu/totd &
69