summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/rc.conf3
-rw-r--r--etc/rc.d/network_ipv629
-rw-r--r--etc/rc.network629
3 files changed, 61 insertions, 0 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index e1be4ba..672765f 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -265,6 +265,9 @@ stf_interface_ipv4plen="0" # Prefix length for 6to4 IPv4 addr,
stf_interface_ipv6_ifid="0:0:0:1" # IPv6 interface id for stf0.
# If you like, you can set "AUTO" for this.
stf_interface_ipv6_slaid="0000" # IPv6 Site Level Aggregator for stf0
+ipv6_faith_prefix="NO" # Set faith prefix to enable a FAITH
+ # IPv6-to-IPv4 TCP translator. You also need
+ # faithd(8) setup.
ipv6_ipv4mapping="YES" # Leave empty to disable IPv4 mapped IPv6 addr
# communication. (like ::ffff:a.b.c.d)
ipv6_firewall_enable="NO" # Set to YES to enable IPv6 firewall
diff --git a/etc/rc.d/network_ipv6 b/etc/rc.d/network_ipv6
index a46194f..aa8d6a2 100644
--- a/etc/rc.d/network_ipv6
+++ b/etc/rc.d/network_ipv6
@@ -161,6 +161,9 @@ network6_pass1() {
# setup static routes
network6_static_routes_setup
+ # setup faith
+ network6_faith_setup
+
case ${ipv6_gateway_enable} in
[Yy][Ee][Ss])
# ipv6_router
@@ -389,6 +392,32 @@ network6_static_routes_setup() {
esac
}
+network6_faith_setup() {
+ case ${ipv6_faith_prefix} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ sysctl -w net.inet6.ip6.keepfaith=1
+ ifconfig faith0 up
+ for prefix in ${ipv6_faith_prefix}; do
+ prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
+ case ${prefixlen} in
+ '')
+ prefixlen=96
+ ;;
+ *)
+ prefix=`expr "${prefix}" : \
+ "\(.*\)/${prefixlen}"`
+ ;;
+ esac
+ route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
+ route change -inet6 ${prefix} -prefixlen ${prefixlen} \
+ -ifp faith0
+ done
+ ;;
+ esac
+}
+
network6_default_interface_setup() {
# Choose IPv6 default interface if it is not clearly specified.
case ${ipv6_default_interface} in
diff --git a/etc/rc.network6 b/etc/rc.network6
index a46194f..aa8d6a2 100644
--- a/etc/rc.network6
+++ b/etc/rc.network6
@@ -161,6 +161,9 @@ network6_pass1() {
# setup static routes
network6_static_routes_setup
+ # setup faith
+ network6_faith_setup
+
case ${ipv6_gateway_enable} in
[Yy][Ee][Ss])
# ipv6_router
@@ -389,6 +392,32 @@ network6_static_routes_setup() {
esac
}
+network6_faith_setup() {
+ case ${ipv6_faith_prefix} in
+ [Nn][Oo] | '')
+ ;;
+ *)
+ sysctl -w net.inet6.ip6.keepfaith=1
+ ifconfig faith0 up
+ for prefix in ${ipv6_faith_prefix}; do
+ prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
+ case ${prefixlen} in
+ '')
+ prefixlen=96
+ ;;
+ *)
+ prefix=`expr "${prefix}" : \
+ "\(.*\)/${prefixlen}"`
+ ;;
+ esac
+ route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
+ route change -inet6 ${prefix} -prefixlen ${prefixlen} \
+ -ifp faith0
+ done
+ ;;
+ esac
+}
+
network6_default_interface_setup() {
# Choose IPv6 default interface if it is not clearly specified.
case ${ipv6_default_interface} in
OpenPOWER on IntegriCloud