Matteo Scandolo | aca8665 | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 1 | |
| 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 | |
AyumuUeha | 76a01bc | 2017-05-18 13:34:13 +0900 | [diff] [blame] | 17 | #!/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 | #************************************************************/ |
| 23 | echo "vcpe_proxy_ipv6_setup.sh: BEGIN" >/tmp/ipv6.log |
| 24 | date >>/tmp/ipv6.log |
| 25 | |
| 26 | echo "stop dnsmasq" >>/tmp/ipv6.log |
| 27 | sv down dnsmasq |
| 28 | sv down dnsmasq-safe |
| 29 | sleep 1 |
| 30 | |
| 31 | ps -fade|grep dnsmasq >>/tmp/ipv6.log |
| 32 | |
| 33 | cd /home/ubuntu |
| 34 | |
| 35 | tar -xvf ipv6.tar |
| 36 | |
| 37 | echo "place conf files" >>/tmp/ipv6.log |
| 38 | mv radvd.conf /etc/ |
| 39 | mv totd.conf /usr/local/etc/ |
| 40 | mv tayga.conf /usr/local/etc/ |
| 41 | |
| 42 | ifconfig eth1 0.0.0.0 |
| 43 | ifconfig eth1 inet6 add 2001:468:181:f100::1/64 up |
| 44 | sysctl -w net.ipv6.conf.all.forwarding=1 |
| 45 | |
| 46 | echo "Setup NAT64 Tayga" >>/tmp/ipv6.log |
| 47 | /home/ubuntu/tayga --mktun |
| 48 | sleep 1 |
| 49 | ifconfig nat64 up |
| 50 | ifconfig nat64 mtu 1442 |
| 51 | ip addr add 192.168.1.1 dev nat64 |
| 52 | ip addr add 2001:db8:1::1 dev nat64 |
| 53 | ip route add 192.168.255.0/24 dev nat64 |
| 54 | ip route add 2000:ffff::/96 dev nat64 |
| 55 | mkdir /var/db/ |
| 56 | mkdir /var/db/tayga |
| 57 | |
| 58 | ip6tables -A OUTPUT -p icmpv6 --icmpv6-type 1 -j DROP |
| 59 | ip6tables -A FORWARD -d 2001:468:181:f100:: -j DROP |
| 60 | |
| 61 | echo "Start DHCPv6 radvd" >>/tmp/ipv6.log |
| 62 | /etc/init.d/radvd start & |
| 63 | sleep 1 |
| 64 | echo "Start NAT64 Tayga" >>/tmp/ipv6.log |
| 65 | /home/ubuntu/tayga & |
| 66 | sleep 1 |
| 67 | echo "Start DNS64 totd" >>/tmp/ipv6.log |
| 68 | /home/ubuntu/totd & |
| 69 | |