]>
git.ipfire.org Git - people/stevee/network.git/blob - helpers/miredo-helper
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2012 IPFire Network Development Team #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 LOG_FACILITY
="miredo-helper"
24 .
/usr
/lib
/network
/functions
30 assert zone_exists
${zone}
32 log DEBUG
"Called for zone=${zone} action=${action}."
36 # Configure the requested MTU.
37 isset MTU
&& device_set_mtu
${zone} ${MTU}
39 # Bring up the device.
42 # Apply the link-local address.
43 ip_address_add
${zone} "${LLADDRESS}/64"
45 # Apply the public IP address.
46 ip_address_add
${zone} "${ADDRESS}/32"
48 # Write all data to the routing database.
49 routing_db_set
${zone} ipv6
type "teredo"
50 routing_db_set
${zone} ipv6 local-ip-address
"${ADDRESS}/32"
51 routing_db_set
${zone} ipv6 active
1
53 # Update the routing database.
54 routing_update
${zone} ipv6
55 routing_default_update
59 # Remove the routing database and update the tables.
60 routing_db_remove
${zone} ipv6
61 routing_update
${zone} ipv6
62 routing_default_update
64 # Set down the device.
65 device_set_down
${zone}
73 log ERROR
"Unknown action passed: ${action}"