blob: 891cf174d954bda77c992236413527f62c5703c0 [file] [log] [blame]
Matteo Scandolo6288d5a2017-08-08 13:05:26 -07001
2{#
3Copyright 2017-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16#}
17
18
Andrea Campanellaedfdbca2017-02-01 17:33:47 -080019#!/bin/sh -e
20#
21# rc.local
22#
23# This script is executed at the end of each multiuser runlevel.
24# Make sure that the script will "exit 0" on success or any other
25# value on error.
26#
27# In order to enable or disable this script just change the execution
28# bits.
29#
30# By default this script does nothing.
31
32ufw enable
33ufw allow bootps
34ufw allow from 192.168.0.0/24
35{% if status == "enabled" %}
36ufw route allow in on eth1 out on eth0
37ufw route allow in on eth1 out on eth2
38{% else %}
39ufw route deny in on eth1 out on eth0
40ufw route deny in on eth1 out on eth2
41{% endif %}
42
43BWLIMIT=/usr/local/sbin/bwlimit.sh
44[ -e $BWLIMIT ] && $BWLIMIT restart || true
45
46exit 0